Matt Burgess wrote: > On Thu, 2013-03-07 at 14:57 +0100, Pierre Labastie wrote: > >> Please add --with-sysroot to the configure switches in binutils-pass2. >> It is harmless (just adds a feature to ld), and corrects that bug. > > I think you meant --with-build-sysroot, right? The configure help > output for that says > > --with-build-sysroot=SYSROOT > use sysroot as the system root during the build > > So, I assume just '--with-build-sysroot' is enough,
Looking at configure.ac, it does look like SYSROOT is the default and does not need to be specified explicitly. i.e. setting it to a > null value? I still don't understand what that flag does and why/how it > fixes this issue. More importantly, I don't understand if it will > affect our builds in any other way. Looking at configure: if test "${with_build_sysroot+set}" = set; then : withval=$with_build_sysroot; if test x"$withval" != x ; then SYSROOT_CFLAGS_FOR_TARGET="--sysroot=$withval" fi else SYSROOT_CFLAGS_FOR_TARGET= fi It appears that it only sets SYSROOT_CFLAGS_FOR_TARGET if there is a value specified. Digging a little further, SYSROOT_CFLAGS_FOR_TARGET is used/specified in Makefile.in and Makefile.tpl (autogen template) # Makefile.in is generated from Makefile.tpl by 'autogen Makefile.def'. XGCC_FLAGS_FOR_TARGET = $(FLAGS_FOR_TARGET) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET) Running './configure --with-build-sysroot=SYSROOT', I find Makefile:SYSROOT_CFLAGS_FOR_TARGET = --sysroot=SYSROOT Re-running configure without --with-build-sysroot=SYSROOT', I only see: Makefile:SYSROOT_CFLAGS_FOR_TARGET = Running './configure --with-build-sysroot', I have: Makefile:SYSROOT_CFLAGS_FOR_TARGET = --sysroot=yes In both chapter05/gcc-pass1 and chapter05/binutils-pass1, we use --with-sysroot=$LFS. I'm getting a little lost here. Evidently check is not finding libpthread.so under some circumstances, but I don't know why. It should be in $LFS/tools/lib/. Perhaps setting LD_LIBRARY_PATH=$LFS/lib:$LFS/usr/lib:$LFS/tools/lib (maybe in Section 4.4) would be sufficient. I do see that the contents of $LFS/tools/lib/libpthread.so are: /* GNU ld script Use the shared library, but some functions are only in the static library, so try that secondarily. */ OUTPUT_FORMAT(elf64-x86-64) GROUP ( /tools/lib/libpthread.so.0 /tools/lib/libpthread_nonshared.a ) -- Bruce -- http://linuxfromscratch.org/mailman/listinfo/lfs-dev FAQ: http://www.linuxfromscratch.org/faq/ Unsubscribe: See the above information page