Dear all,

I'm having trouble compiling `dummy.c` in Ch 5.7 of Development LFS. As you
know, it is unwise to continue without being able to compile this file.

Specifically, `ld` is having trouble finding `crti.o` and `crt1.o` in
/tools/lib. However, `ls /tools/lib` plainly reveals that these files at
least exist. I'm fairly sure I've compiled binutils with the correct path,
and when I query the new `ld` command for its search path, it does include
`/tools/lib`.

Much googling reveals that this is a common problem but none of the
suggested fixes have helped. I've built and removed pass 1 of binutils,
gcc, linux-api-headers and glibc dozens of times with a wide variety of
different options in the last couple of days.

The host is a recently updated Arch Linux box, 64 bit AMD, 8gb RAM.

Manifest of attached files:

  * test.out: output of `$LFS_TGT-gcc -v dummy.c -o a.out`.
  * version-check.out: output of the version-check script.
  * ld-search-path: output of `$LFS_TGT-ld --verbose | grep -i search`.
  * ldconfig.out: output of `/tools/sbin/ldconfig --verbose`.

The scripts I'm using to build the various packages are here:
https://github.com/cryptarch/linux-from-scratch.git

To remove and rebuild a package, I would do something like:
$ ./binutils-pass1.sh clean && ./binutils-pass1.sh

The scripts don't exactly follow the book; in particular, rather than using
`make install`, I instead use a DESTDIR and then run a `find -exec` to do
the actual installation.

Also, I'm building LFS in an LVM on top of a LUKS partition. The temporary
tools go in one logical volume and the intended LFS root directory is in
another logical volume. The mount hierarchy is:

  * /dev/mapper/lfs-root -> /home/lfs/mnt
  * /dev/mapper/lfs-tools -> /home/lfs/mnt/tools
  * /home/lfs/mnt/tools -> /tools (mount --bind)

Does anyone have any ideas about what I could be doing wrong? Any help
would be much appreciated.


Kind regards,


Tim
/tools/lib:
        libm.so.6 -> libm.so.6
        libSegFault.so -> libSegFault.so
        libpcprofile.so -> libpcprofile.so
        libnss_compat.so.2 -> libnss_compat.so.2
        libc.so.6 -> libc.so.6
        libmemusage.so -> libmemusage.so
        libBrokenLocale.so.1 -> libBrokenLocale.so.1
        libthread_db.so.1 -> libthread_db.so.1
        librt.so.1 -> librt.so.1
        libresolv.so.2 -> libresolv.so.2
        libdl.so.2 -> libdl.so.2
        libpthread.so.0 -> libpthread.so.0
        libanl.so.1 -> libanl.so.1
        libcidn.so.1 -> libcidn.so.1
        libmvec.so.1 -> libmvec.so.1
        libnss_dns.so.2 -> libnss_dns.so.2
        libnss_nisplus.so.2 -> libnss_nisplus.so.2
        libutil.so.1 -> libutil.so.1
        libnss_nis.so.2 -> libnss_nis.so.2
        libnsl.so.1 -> libnsl.so.1
        libcc1.so.0 -> libcc1.so.0.0.0
        libnss_files.so.2 -> libnss_files.so.2
        libnss_hesiod.so.2 -> libnss_hesiod.so.2
        ld-linux-x86-64.so.2 -> ld-2.22.so
        libnss_db.so.2 -> libnss_db.so.2
        libcrypt.so.1 -> libcrypt.so.1
SEARCH_DIR("=/tools/x86_64-lfs-linux-gnu/lib64"); SEARCH_DIR("/tools/lib"); 
SEARCH_DIR("=/tools/x86_64-lfs-linux-gnu/lib");
Using built-in specs.
COLLECT_GCC=x86_64-lfs-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/tools/libexec/gcc/x86_64-lfs-linux-gnu/5.3.0/lto-wrapper
Target: x86_64-lfs-linux-gnu
Configured with: /home/lfs/sources/gcc-5.3.0/configure 
--target=x86_64-lfs-linux-gnu --prefix=/tools --with-glibc-version=2.11 
--with-sysroot=/home/lfs/mnt --with-newlib --without-headers 
--with-local-prefix=/tools --with-native-system-header-dir=/tools/include 
--disable-nls --disable-shared --disable-multilib --disable-decimal-float 
--disable-threads --disable-libatomic --disable-libgomp --disable-libquadmath 
--disable-libssp --disable-libvtv --disable-libstdcxx --enable-languages=c,c++
Thread model: single
gcc version 5.3.0 (GCC) 
COLLECT_GCC_OPTIONS='-v' '-o' 'a.out' '-mtune=generic' '-march=x86-64'
 /tools/libexec/gcc/x86_64-lfs-linux-gnu/5.3.0/cc1 -quiet -v dummy.c -quiet 
-dumpbase dummy.c -mtune=generic -march=x86-64 -auxbase dummy -version -o 
/tmp/cc0rJq3P.s
GNU C11 (GCC) version 5.3.0 (x86_64-lfs-linux-gnu)
        compiled by GNU C version 5.3.0, GMP version 6.1.0, MPFR version 
3.1.3-p5, MPC version 1.0.3
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory 
"/tools/lib/gcc/x86_64-lfs-linux-gnu/5.3.0/../../../../x86_64-lfs-linux-gnu/include"
ignoring duplicate directory "/home/lfs/mnt/tools/include"
#include "..." search starts here:
#include <...> search starts here:
 /tools/lib/gcc/x86_64-lfs-linux-gnu/5.3.0/include
 /home/lfs/mnt/tools/include
 /tools/lib/gcc/x86_64-lfs-linux-gnu/5.3.0/include-fixed
End of search list.
GNU C11 (GCC) version 5.3.0 (x86_64-lfs-linux-gnu)
        compiled by GNU C version 5.3.0, GMP version 6.1.0, MPFR version 
3.1.3-p5, MPC version 1.0.3
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: f6c833b42cb592c24ec88e3888f62de9
COLLECT_GCC_OPTIONS='-v' '-o' 'a.out' '-mtune=generic' '-march=x86-64'
 
/tools/lib/gcc/x86_64-lfs-linux-gnu/5.3.0/../../../../x86_64-lfs-linux-gnu/bin/as
 -v --64 -o /tmp/ccxnlg9v.o /tmp/cc0rJq3P.s
GNU assembler version 2.25.1 (x86_64-lfs-linux-gnu) using BFD version (GNU 
Binutils) 2.25.1
COMPILER_PATH=/tools/libexec/gcc/x86_64-lfs-linux-gnu/5.3.0/:/tools/libexec/gcc/x86_64-lfs-linux-gnu/5.3.0/:/tools/libexec/gcc/x86_64-lfs-linux-gnu/:/tools/lib/gcc/x86_64-lfs-linux-gnu/5.3.0/:/tools/lib/gcc/x86_64-lfs-linux-gnu/:/tools/lib/gcc/x86_64-lfs-linux-gnu/5.3.0/../../../../x86_64-lfs-linux-gnu/bin/
LIBRARY_PATH=/tools/lib/gcc/x86_64-lfs-linux-gnu/5.3.0/:/tools/lib/gcc/x86_64-lfs-linux-gnu/5.3.0/../../../../x86_64-lfs-linux-gnu/lib/
COLLECT_GCC_OPTIONS='-v' '-o' 'a.out' '-mtune=generic' '-march=x86-64'
 /tools/libexec/gcc/x86_64-lfs-linux-gnu/5.3.0/collect2 -plugin 
/tools/libexec/gcc/x86_64-lfs-linux-gnu/5.3.0/liblto_plugin.so 
-plugin-opt=/tools/libexec/gcc/x86_64-lfs-linux-gnu/5.3.0/lto-wrapper 
-plugin-opt=-fresolution=/tmp/ccQ3Swhc.res -plugin-opt=-pass-through=-lgcc 
-plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc 
--sysroot=/home/lfs/mnt --eh-frame-hdr -m elf_x86_64 -dynamic-linker 
/lib64/ld-linux-x86-64.so.2 -o a.out crt1.o crti.o 
/tools/lib/gcc/x86_64-lfs-linux-gnu/5.3.0/crtbegin.o 
-L/tools/lib/gcc/x86_64-lfs-linux-gnu/5.3.0 
-L/tools/lib/gcc/x86_64-lfs-linux-gnu/5.3.0/../../../../x86_64-lfs-linux-gnu/lib
 /tmp/ccxnlg9v.o -lgcc -lc -lgcc 
/tools/lib/gcc/x86_64-lfs-linux-gnu/5.3.0/crtend.o crtn.o
/tools/lib/gcc/x86_64-lfs-linux-gnu/5.3.0/../../../../x86_64-lfs-linux-gnu/bin/ld:
 cannot find crt1.o: No such file or directory
/tools/lib/gcc/x86_64-lfs-linux-gnu/5.3.0/../../../../x86_64-lfs-linux-gnu/bin/ld:
 cannot find crti.o: No such file or directory
collect2: error: ld returned 1 exit status
x86_64-lfs-linux-gnu-gcc failed to produce a.out
bash, version 4.3.42(1)-release
/bin/sh -> /usr/bin/bash
Binutils: (GNU Binutils) 2.25.1
bison (GNU Bison) 3.0.4
yacc is bison (GNU Bison) 3.0.4
bzip2,  Version 1.0.6, 6-Sept-2010.
Coreutils:  8.24
diff (GNU diffutils) 3.3
find (GNU findutils) 4.4.2
GNU Awk 4.1.3, API: 1.1 (GNU MPFR 3.1.3-p5, GNU MP 6.1.0)
/usr/bin/awk -> /usr/bin/gawk
gcc (GCC) 5.3.0
g++ (GCC) 5.3.0
(GNU libc) 2.22
grep (GNU grep) 2.22
gzip 1.6
Linux version 4.3.3-2-ARCH (builduser@tobias) (gcc version 5.3.0 (GCC) ) #1 SMP 
PREEMPT Wed Dec 23 20:09:18 CET 2015
m4 (GNU M4) 1.4.17
GNU Make 4.1
GNU patch 2.7.5
Perl version='5.22.1';
sed (GNU sed) 4.2.2
tar (GNU tar) 1.28
texi2any (GNU texinfo) 6.0
xz (XZ Utils) 5.2.2
g++ compilation OK
-- 
http://lists.linuxfromscratch.org/listinfo/lfs-chat
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to