I am trying to build a cross-compiler from a x86-64 Linux host (Ubuntu-22.04 in WSL, with GCC 11) to arm-wrs-vxworks
, and I’m having some serious trouble doing so. I have very limited experience with cross-compilers and think I may be running into some simple configuration issues.
I’ve tried using the procedures detailed under Jonathan Wakely’s answer and in the community wiki answer at How to install GCC piece by piece with GMP, MPFR, MPC, ELF, without shared libraries?, to no avail.
In particular, doing this yields a compiler error related to the C++17 standard:
tar xzf gcc-4.9.4.tar.gz
cd gcc-4.9.4
./contrib/download_prerequisites
cd ..
mkdir objdir
cd objdir
$PWD/../gcc-4.9.4/configure --prefix=$HOME/GCC-4.9.4 --target=arm-wrs-vxworks
make -j
make install
I tried increasing the target GCC version to 8.1.0 and keeping the host GCC at 11. I also independently tried keeping the target version of 4.9.4 and changing to a host with GCC 7. (Note that I first attempted updating the target GCC to 12.1.0, though it appears versions that recent have dropped VxWorks support.) In both cases, I get past the C++17-related compiler error, but I see the same cannot compute suffix of object files
error that several other people have reported (see below).
compiling gcc, configure: error: cannot compute suffix of object files: cannot compile
LibGCC compilation Failed with an error: cannot compute suffix of object files: cannot compile
Gcc compilation “cannot compute suffix of object files: cannot compile”
I have tried messing with the LD_LIBRARY_PATH
variable, toggling various configuration options, and more, with no luck. Manually building and installing binutils
with target=arm-wrs-vxworks
didn’t seem to have any effect, either. (Even getting rid of the --target
option in the GCC configuration doesn’t fix the build completely – I eventually get an error about missing sys/ustat.h
instead.)
I also found references to a program called crosstool-NG
, which seemed promising. I tried it out, and unfortunately, it appears as though it does not support VxWorks targets at all.
I’ve also consulted the following documentation:
https://gcc.gnu.org/install/build.html
https://crosstool-ng.github.io/docs/toolchain-construction/
https://preshing.com/20141119/how-to-build-a-gcc-cross-compiler/
None of the procedures just seem to work. It’s as if half of the versions of these tools have out-of-the-box failures, and the other half are incompatible with what I need.
Is there something obvious I might be missing that would explain this? (If there’s any more information I can provide that may help narrow down the problem, please let me know.)