GCC_NO_EXECUTABLES plaguing gcc final stage build
Gary Carlson
gcarlson@carlson-minot.com
Fri Jun 5 18:35:00 GMT 2009
Hello,
I am attempting to build a cross-compiler hosted on Mac OSX (Leopard) to
generate code for embedded arm-based platforms based on gcc-4.3 and
glibc-2.8 After pulling most of my hair the last week hammering through
various problems, I was finally able to get binutils, gcc-first stage,
glibc+linux headers, glibc-second stage, and glibc-final to build correctly.
Unfortunately the same can not be said for the final gcc cross compiler
step.
The problem at hand occurred once I enabled support for c++ in the final
stage using the following configure:
configure --target=arm-none-linux-gnueabi
--prefix=/Users/garycarlson/Documents/Embedded/arm/tools \
--with-gmp=/Users/garycarlson/Documents/Embedded/arm/tools \
--with-mpfr=/Users/garycarlson/Documents/Embedded/arm/tools \
--with-sysroot=/Users/garycarlson/Documents/Embedded/arm/sysroot \
--enable-threads --disable-libssp --disable-libgomp
--disable-libmudflap --enable-languages=c,c++
What resulted was familiar:
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... configure: error: Link tests are
not allowed after GCC_NO_EXECUTABLES.
make[1]: *** [configure-target-libstdc++-v3] Error 1
I traced the root cause of this failure to a dynamic link test performed in
the libstdc++-v3 configuration script:
configure:3576:/Users/garycarlson/Documents/Embedded/arm/build/gcc-stage3/./
gcc/xgcc -B/Users/garycarlson/Documents/Embedded/arm/build/gcc-stage3/./gcc/
-B/Users/garycarlson/Documents/Embedded/arm/tools/arm-none-linux-gnueabi/bin
/-B/Users/garycarlson/Documents/Embedded/arm/tools/arm-none-linux-gnueabi/li
b/ -isystem
/Users/garycarlson/Documents/Embedded/arm/tools/arm-none-linux-gnueabi/inclu
de -isystem
/Users/garycarlson/Documents/Embedded/arm/tools/arm-none-linux-gnueabi/sys-i
nclude -o conftest -O2 -g -g O2
--sysroot=/Users/garycarlson/Documents/Embedded/arm/tmp conftest.c >&5
/Users/garycarlson/Documents/Embedded/arm/tools/arm-none-linux-gnueabi/lib/c
rt1.o: In function `_start':
init.c:(.text+0x24): undefined reference to `__libc_start_main'
init.c:(.text+0x28): undefined reference to `abort'
init.c:(.text+0x2c): undefined reference to `__libc_csu_fini'
init.c:(.text+0x34): undefined reference to `__libc_csu_init'
If for troubleshooting purposes I manually attempt to link a sample
conftest.c file from the command line by replacing the B option so that it
points to the sysroot lib directory (where cross-compiled glibc was
installed earlier) instead of binutils lib shown above, the linker doesn¹t
complain.
Tracing this problem further I discovered the command string specifying the
search path is created from FLAGS_FOR_TARGET in the top level makefile and
is passed down to the libstdc++-v3 script.
So this leads me to my first question: why would the build want to point to
the binutils lib directory at this point? Shouldn¹t it be pointing to the
cross-compiled sysroot libs for the purpose of this test or I am missing the
bigger picture? I manually tried to override this flag in the make command,
but that just causes earlier build activities to crash somewhere else six
of one, half a dozen of another but same end result.
Hopefully someone can shed some light and give me some guidance how to get
past this problem. It is frustrating to be stalled a few feet from the
finish line!
Thanks
Gary Carlson
More information about the Gcc-help
mailing list