Opened 7 years ago

Closed 7 years ago

#3585 closed task (invalid)

library path problem while building libstdc++ (chapter 5.8. Libstdc++-4.8.2)

Reported by: miland Owned by: lfs-book@…
Priority: normal Milestone: 7.6
Component: Book Version: SVN
Severity: normal Keywords:
Cc:

Description

I'm baffled by this one: the configure fails with the following error:

checking dynamic linker characteristics... configure: error: Link tests are not allowed after GCC_NO_EXECUTABLES

After checking the config.log, these lines seem to indicate where the problem is (please note that instead of /tools root I use /usr/share/mk7i-toolchain/tools, but it's all consistent):

configure:6982: i686-alx-linux-gnu-gcc -o conftest -g -O2 conftest.c conftstm.o >&5

/usr/share/mk7i-toolchain/tools/lib/gcc/i686-alx-linux-gnu/4.8.2/../../../../i686-alx-linux-gnu/bin/ld: cannot find crt1.o: No such file or directory

... and so forth for a number of libraries and objects. So, I first suspected that maybe the built-in search path for ld was wrong, and checked:

mk7@mk7i-durovicm:/usr/share/mk7i-toolchain/tools/bin> /usr/share/mk7i-toolchain/tools/lib/gcc/i686-alx-linux-gnu/4.8.2/../../../../i686-alx-linux-gnu/bin/ld --verbose|grep SEARCH

SEARCH_DIR("/usr/share/mk7i-toolchain/tools/lib");

Next, I checked if the files were really there. This is also OK:

mk7@mk7i-durovicm:/usr/share/mk7i-toolchain/tools/bin> ls -l /usr/share/mk7i-toolchain/tools/lib/crt1.o

-rw-r--r-- 1 root root 2800 2014-05-19 08:14 /usr/share/mk7i-toolchain/tools/lib/crt1.o

Finally, I checked which ld program is invoked by the compiler by default:

mk7@mk7i-durovicm:/usr/share/mk7i-toolchain/tools/bin> /usr/share/mk7i-toolchain/tools/bin/i686-alx-linux-gnu-gcc -print-prog-name=ld

/usr/share/mk7i-toolchain/tools/lib/gcc/i686-alx-linux-gnu/4.8.2/../../../../i686-alx-linux-gnu/bin/ld

...and this seems to be OK, too. So, in a conclusion:

  • compiler uses the correct ld program.
  • ld program has the correct search path
  • the path contains all the files that ld complains are not there

I ran out of ideas on what to check next. The output from ./configure line follows:

../gcc-4.8.2/libstdc++-v3/configure --host=i686-alx-linux-gnu --prefix=/usr/share/mk7i-toolchain/tools --disable-multilib --disable-shared --disable-nls --disable-libstdcxx-threads --disable-libstdcxx-pch --with-gxx-include-dir=/usr/share/mk7i-toolchain/tools/i686-alx-linux-gnu/include/c++/4.8.2 configure: WARNING: If you wanted to set the --build type, don't use --host.

If a cross compiler is detected then cross compile mode will be used.

checking build system type... i686-pc-linux-gnu checking host system type... i686-alx-linux-gnu checking target system type... i686-alx-linux-gnu checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for i686-alx-linux-gnu-strip... i686-alx-linux-gnu-strip checking for a thread-safe mkdir -p... /bin/mkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... yes checking for i686-alx-linux-gnu-gcc... i686-alx-linux-gnu-gcc checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether i686-alx-linux-gnu-gcc accepts -g... yes checking for i686-alx-linux-gnu-gcc option to accept ISO C89... unsupported checking for i686-alx-linux-gnu-g++... i686-alx-linux-gnu-g++ checking whether we are using the GNU C++ compiler... yes checking whether i686-alx-linux-gnu-g++ accepts -g... yes checking how to run the C preprocessor... i686-alx-linux-gnu-gcc -E checking for grep that handles long lines and -e... /usr/bin/grep checking for egrep... /usr/bin/grep -E checking whether ln -s works... yes checking for i686-alx-linux-gnu-as... i686-alx-linux-gnu-as checking for i686-alx-linux-gnu-ar... i686-alx-linux-gnu-ar checking for i686-alx-linux-gnu-ranlib... i686-alx-linux-gnu-ranlib checking whether to enable maintainer-specific portions of Makefiles... no configure: CPU config directory is cpu/i486 configure: OS config directory is os/gnu-linux checking how to print strings... printf checking for a sed that does not truncate output... /usr/bin/sed checking for fgrep... /usr/bin/grep -F checking for ld used by i686-alx-linux-gnu-gcc... /usr/share/mk7i-toolchain/tools/i686-alx-linux-gnu/bin/ld checking if the linker (/usr/share/mk7i-toolchain/tools/i686-alx-linux-gnu/bin/ld) is GNU ld... yes checking for BSD- or MS-compatible name lister (nm)... /usr/share/mk7i-toolchain/tools/bin/i686-alx-linux-gnu-nm -B checking the name lister (/usr/share/mk7i-toolchain/tools/bin/i686-alx-linux-gnu-nm -B) interface... BSD nm checking the maximum length of command line arguments... 1572864 checking whether the shell understands some XSI constructs... yes checking whether the shell understands "+="... yes checking for /usr/share/mk7i-toolchain/tools/i686-alx-linux-gnu/bin/ld option to reload object files... -r checking for i686-alx-linux-gnu-objdump... i686-alx-linux-gnu-objdump checking how to recognize dependent libraries... pass_all checking for i686-alx-linux-gnu-ar... (cached) i686-alx-linux-gnu-ar checking for i686-alx-linux-gnu-strip... (cached) i686-alx-linux-gnu-strip checking for i686-alx-linux-gnu-ranlib... (cached) i686-alx-linux-gnu-ranlib checking command to parse /usr/share/mk7i-toolchain/tools/bin/i686-alx-linux-gnu-nm -B output from i686-alx-linux-gnu-gcc object... failed checking for ANSI C header files... no checking for sys/types.h... no checking for sys/stat.h... no checking for stdlib.h... no checking for string.h... no checking for memory.h... no checking for strings.h... no checking for inttypes.h... no checking for stdint.h... no checking for unistd.h... no checking for dlfcn.h... no checking for objdir... .libs checking if i686-alx-linux-gnu-gcc supports -fno-rtti -fno-exceptions... no checking for i686-alx-linux-gnu-gcc option to produce PIC... -fPIC -DPIC checking if i686-alx-linux-gnu-gcc PIC flag -fPIC -DPIC works... yes checking if i686-alx-linux-gnu-gcc static flag -static works... no checking if i686-alx-linux-gnu-gcc supports -c -o file.o... yes checking if i686-alx-linux-gnu-gcc supports -c -o file.o... (cached) yes checking whether the i686-alx-linux-gnu-gcc linker (/usr/share/mk7i-toolchain/tools/i686-alx-linux-gnu/bin/ld) supports shared libraries... yes checking dynamic linker characteristics... configure: error: Link tests are not allowed after GCC_NO_EXECUTABLES.

Change History (2)

comment:1 by miland, 7 years ago

just to throw a bit more light into what's happening, I tried compiling a test file, to simulate what configure script was trying to do, with -v flag on, just to expose where it was looking for stuff:

mk7@mk7i-durovicm:~> /usr/share/mk7i-toolchain/tools/bin/i686-alx-linux-gnu-gcc -v -I/usr/share/mk7i-toolchain/tools/include test.c Using built-in specs. COLLECT_GCC=/usr/share/mk7i-toolchain/tools/bin/i686-alx-linux-gnu-gcc COLLECT_LTO_WRAPPER=/usr/share/mk7i-toolchain/tools/libexec/gcc/i686-alx-linux-gnu/4.8.2/lto-wrapper Target: i686-alx-linux-gnu Configured with: ../gcc-4.8.2/configure --target=i686-alx-linux-gnu --prefix=/usr/share/mk7i-toolchain/tools --with-sysroot=/usr/share/mk7i-toolchain --with-newlib --without-headers --with-local-prefix=/usr/share/mk7i-toolchain/tools --with-native-system-header-dir=/usr/share/mk7i-toolchain/tools/include --disable-nls --disable-shared --disable-multilib --disable-decimal-float --disable-threads --disable-libatomic --disable-libgomp --disable-libitm --disable-libmudflap --disable-libquadmath --disable-libsanitizer --disable-libssp --disable-libstdc++-v3 --enable-languages=c,c++ Thread model: single gcc version 4.8.2 (GCC) COLLECT_GCC_OPTIONS='-v' '-I' '/usr/share/mk7i-toolchain/tools/include' '-mtune=generic' '-march=pentiumpro'

/usr/share/mk7i-toolchain/tools/libexec/gcc/i686-alx-linux-gnu/4.8.2/cc1 -quiet -v -I /usr/share/mk7i-toolchain/tools/include test.c -quiet -dumpbase test.c -mtune=generic -march=pentiumpro -auxbase test -version -o /tmp/ccS95aKe.s

GNU C (GCC) version 4.8.2 (i686-alx-linux-gnu)

compiled by GNU C version 4.1.2 20061115 (prerelease) (SUSE Linux), GMP version 5.1.3, MPFR version 3.1.2, MPC version 1.0.2

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 ignoring nonexistent directory "/usr/share/mk7i-toolchain/usr/share/mk7i-toolchain/tools/include" ignoring nonexistent directory "/usr/share/mk7i-toolchain/tools/lib/gcc/i686-alx-linux-gnu/4.8.2/../../../../i686-alx-linux-gnu/include" ignoring nonexistent directory "/usr/share/mk7i-toolchain/usr/share/mk7i-toolchain/tools/include" #include "..." search starts here: #include <...> search starts here:

/usr/share/mk7i-toolchain/tools/include /usr/share/mk7i-toolchain/tools/lib/gcc/i686-alx-linux-gnu/4.8.2/include /usr/share/mk7i-toolchain/tools/lib/gcc/i686-alx-linux-gnu/4.8.2/include-fixed

End of search list. GNU C (GCC) version 4.8.2 (i686-alx-linux-gnu)

compiled by GNU C version 4.1.2 20061115 (prerelease) (SUSE Linux), GMP version 5.1.3, MPFR version 3.1.2, MPC version 1.0.2

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 Compiler executable checksum: d4ab0d4090ea5fd2277f9bf8e110997e COLLECT_GCC_OPTIONS='-v' '-I' '/usr/share/mk7i-toolchain/tools/include' '-mtune=generic' '-march=pentiumpro'

/usr/share/mk7i-toolchain/tools/lib/gcc/i686-alx-linux-gnu/4.8.2/../../../../i686-alx-linux-gnu/bin/as -v -I /usr/share/mk7i-toolchain/tools/include --32 -o /tmp/ccUFxk7k.o /tmp/ccS95aKe.s

GNU assembler version 2.24 (i686-alx-linux-gnu) using BFD version (GNU Binutils) 2.24 COMPILER_PATH=/usr/share/mk7i-toolchain/tools/libexec/gcc/i686-alx-linux-gnu/4.8.2/:/usr/share/mk7i-toolchain/tools/libexec/gcc/i686-alx-linux-gnu/4.8.2/:/usr/share/mk7i-toolchain/tools/libexec/gcc/i686-alx-linux-gnu/:/usr/share/mk7i-toolchain/tools/lib/gcc/i686-alx-linux-gnu/4.8.2/:/usr/share/mk7i-toolchain/tools/lib/gcc/i686-alx-linux-gnu/:/usr/share/mk7i-toolchain/tools/lib/gcc/i686-alx-linux-gnu/4.8.2/../../../../i686-alx-linux-gnu/bin/ LIBRARY_PATH=/usr/share/mk7i-toolchain/tools/lib/gcc/i686-alx-linux-gnu/4.8.2/:/usr/share/mk7i-toolchain/tools/lib/gcc/i686-alx-linux-gnu/4.8.2/../../../../i686-alx-linux-gnu/lib/ COLLECT_GCC_OPTIONS='-v' '-I' '/usr/share/mk7i-toolchain/tools/include' '-mtune=generic' '-march=pentiumpro'

/usr/share/mk7i-toolchain/tools/libexec/gcc/i686-alx-linux-gnu/4.8.2/collect2 --sysroot=/usr/share/mk7i-toolchain --eh-frame-hdr -m elf_i386 -dynamic-linker /usr/share/mk7i-toolchain/tools/lib/ld-linux.so.2 crt1.o crti.o /usr/share/mk7i-toolchain/tools/lib/gcc/i686-alx-linux-gnu/4.8.2/crtbegin.o -L/usr/share/mk7i-toolchain/tools/lib/gcc/i686-alx-linux-gnu/4.8.2 -L/usr/share/mk7i-toolchain/tools/lib/gcc/i686-alx-linux-gnu/4.8.2/../../../../i686-alx-linux-gnu/lib /tmp/ccUFxk7k.o -lgcc -lc -lgcc /usr/share/mk7i-toolchain/tools/lib/gcc/i686-alx-linux-gnu/4.8.2/crtend.o crtn.o

/usr/share/mk7i-toolchain/tools/lib/gcc/i686-alx-linux-gnu/4.8.2/../../../../i686-alx-linux-gnu/bin/ld: cannot find crt1.o: No such file or directory /usr/share/mk7i-toolchain/tools/lib/gcc/i686-alx-linux-gnu/4.8.2/../../../../i686-alx-linux-gnu/bin/ld: cannot find crti.o: No such file or directory /usr/share/mk7i-toolchain/tools/lib/gcc/i686-alx-linux-gnu/4.8.2/../../../../i686-alx-linux-gnu/bin/ld: cannot find /usr/share/mk7i-toolchain/tools/lib/libc.so.6 inside /usr/share/mk7i-toolchain /usr/share/mk7i-toolchain/tools/lib/gcc/i686-alx-linux-gnu/4.8.2/../../../../i686-alx-linux-gnu/bin/ld: cannot find /usr/share/mk7i-toolchain/tools/lib/libc_nonshared.a inside /usr/share/mk7i-toolchain /usr/share/mk7i-toolchain/tools/lib/gcc/i686-alx-linux-gnu/4.8.2/../../../../i686-alx-linux-gnu/bin/ld: cannot find /usr/share/mk7i-toolchain/tools/lib/ld-linux.so.2 inside /usr/share/mk7i-toolchain collect2: error: ld returned 1 exit status mk7@mk7i-durovicm:~>

comment:2 by bdubbs@…, 7 years ago

Resolution: invalid
Status: newclosed

Sort this out on lfs-support.

Note: See TracTickets for help on using tickets.