Dear all,

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

The problem is that when linking, $LFS_TGT-gcc 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 and gcc with the correct paths.

When I do a partial compile using "-c" and then run $LFS_TGT-ld manually,
no errors are output. That is, the following succeeds:

~~~
$LFS_TGT-gcc -c dummy.c
$LFS_TGT-ld -lc /tools/lib/crt* dummy.o
~~~

Much googling reveals that this is a common problem but none of the
suggested fixes have helped. I've checked the FAQ and searched the
archives. 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 weeks.

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`.
  * ldconfig.out: Output of `/tools/sbin/ldconfig --verbose`.
  * version-check.out: Output of the version-check script.
  * lfs-user.env: Output of env-check.sh script for checking that the LFS
    environment has been set up correctly.

The scripts I'm using to build the various packages are here:
https://github.com/cryptarch/linux-from-scratch.git
There are branches for doing LFS Development and using musl instead of
glibc. The master branch is for LFS Stable. All branches generate the same
error.

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. This way I can use the DESTDIR as a record of
which files belong to which packages.

I'm not using sudo anywhere. It's unnecessary and doesn't preserve the lfs
user environment.

Also, I'm building LFS in an LVM. The volume group is lfs and there are
logical volumes for root and tools. The mount hierarchy is:

  * /dev/mapper/lfs-root -> /home/lfs/mnt
  * /dev/mapper/lfs-tools -> /home/lfs/mnt/tools

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


Kind regards,


Tim

/tools/sbin/ldconfig: Warning: ignoring configuration file that cannot be 
opened: /tools/etc/ld.so.conf: No such file or directory
/tools/sbin/ldconfig: Path `/tools/lib64' given more than once
/tools/sbin/ldconfig: Can't stat /tools/libx32: No such file or directory
/tools/lib:
        libm.so.6 -> libm-2.22.so
        libSegFault.so -> libSegFault.so
        libpcprofile.so -> libpcprofile.so
        libnss_compat.so.2 -> libnss_compat-2.22.so
        libc.so.6 -> libc-2.22.so
        libmemusage.so -> libmemusage.so
        libcidn.so.1 -> libcidn-2.22.so
        libnss_nisplus.so.2 -> libnss_nisplus-2.22.so
        libnss_files.so.2 -> libnss_files-2.22.so
        libBrokenLocale.so.1 -> libBrokenLocale-2.22.so
        libmvec.so.1 -> libmvec-2.22.so
        libdl.so.2 -> libdl-2.22.so
        libthread_db.so.1 -> libthread_db-1.0.so
        librt.so.1 -> librt-2.22.so
        libresolv.so.2 -> libresolv-2.22.so
        libpthread.so.0 -> libpthread-2.22.so
        libanl.so.1 -> libanl-2.22.so
        libcc1.so.0 -> libcc1.so.0.0.0
        libcrypt.so.1 -> libcrypt-2.22.so
        libnss_dns.so.2 -> libnss_dns-2.22.so
        libnss_hesiod.so.2 -> libnss_hesiod-2.22.so
        libutil.so.1 -> libutil-2.22.so
        libnss_nis.so.2 -> libnss_nis-2.22.so
        libnsl.so.1 -> libnsl-2.22.so
        ld-linux-x86-64.so.2 -> ld-2.22.so
        libnss_db.so.2 -> libnss_db-2.22.so
SEARCH_DIR("=/tools/x86_64-lfs-linux-gnu/lib64"); SEARCH_DIR("/tools/lib"); 
SEARCH_DIR("=/tools/x86_64-lfs-linux-gnu/lib");
whoami
lfs

echo $LFS
/home/lfs/mnt

echo $LFS_TGT
x86_64-lfs-linux-gnu

echo $PATH
/tools/bin:/bin:/usr/bin:/sbin:/usr/sbin:.

echo $SHELLOPTS
braceexpand:hashall:interactive-comments:verbose

df -h | grep lfs
/dev/mapper/lfs-root   168G   60M  159G   1% /home/lfs/mnt
/dev/mapper/lfs-tools  7.8G  659M  6.7G   9% /home/lfs/mnt/tools

Using built-in specs.
COLLECT_GCC=x86_64-lfs-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/home/lfs/mnt/tools/bin/../libexec/gcc/x86_64-lfs-linux-gnu/5.2.0/lto-wrapper
Target: x86_64-lfs-linux-gnu
Configured with: /home/lfs/sources/gcc-5.2.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.2.0 (GCC) 
COLLECT_GCC_OPTIONS='-v' '-o' 'a.out' '-mtune=generic' '-march=x86-64'
 /home/lfs/mnt/tools/bin/../libexec/gcc/x86_64-lfs-linux-gnu/5.2.0/cc1 -quiet 
-v -iprefix /home/lfs/mnt/tools/bin/../lib/gcc/x86_64-lfs-linux-gnu/5.2.0/ 
dummy.c -quiet -dumpbase dummy.c -mtune=generic -march=x86-64 -auxbase dummy 
-version -o /tmp/ccsbdcZS.s
GNU C11 (GCC) version 5.2.0 (x86_64-lfs-linux-gnu)
        compiled by GNU C version 5.3.0, GMP version 6.0.0, MPFR version 3.1.3, 
MPC version 1.0.3
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory 
"/home/lfs/mnt/tools/bin/../lib/gcc/x86_64-lfs-linux-gnu/5.2.0/../../../../x86_64-lfs-linux-gnu/include"
ignoring duplicate directory 
"/home/lfs/mnt/tools/bin/../lib/gcc/../../lib/gcc/x86_64-lfs-linux-gnu/5.2.0/include"
ignoring duplicate directory 
"/home/lfs/mnt/tools/bin/../lib/gcc/../../lib/gcc/x86_64-lfs-linux-gnu/5.2.0/include-fixed"
ignoring nonexistent directory 
"/home/lfs/mnt/tools/bin/../lib/gcc/../../lib/gcc/x86_64-lfs-linux-gnu/5.2.0/../../../../x86_64-lfs-linux-gnu/include"
ignoring duplicate directory "/home/lfs/mnt/tools/include"
#include "..." search starts here:
#include <...> search starts here:
 /home/lfs/mnt/tools/bin/../lib/gcc/x86_64-lfs-linux-gnu/5.2.0/include
 /home/lfs/mnt/tools/bin/../lib/gcc/x86_64-lfs-linux-gnu/5.2.0/include-fixed
 /home/lfs/mnt/tools/include
End of search list.
GNU C11 (GCC) version 5.2.0 (x86_64-lfs-linux-gnu)
        compiled by GNU C version 5.3.0, GMP version 6.0.0, MPFR version 3.1.3, 
MPC version 1.0.3
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: ec129b0779fa76eb3c52c7ad64b3f5bb
COLLECT_GCC_OPTIONS='-v' '-o' 'a.out' '-mtune=generic' '-march=x86-64'
 
/home/lfs/mnt/tools/bin/../lib/gcc/x86_64-lfs-linux-gnu/5.2.0/../../../../x86_64-lfs-linux-gnu/bin/as
 -v --64 -o /tmp/ccejgjqz.o /tmp/ccsbdcZS.s
GNU assembler version 2.25.1 (x86_64-lfs-linux-gnu) using BFD version (GNU 
Binutils) 2.25.1
COMPILER_PATH=/home/lfs/mnt/tools/bin/../libexec/gcc/x86_64-lfs-linux-gnu/5.2.0/:/home/lfs/mnt/tools/bin/../libexec/gcc/:/home/lfs/mnt/tools/bin/../lib/gcc/x86_64-lfs-linux-gnu/5.2.0/../../../../x86_64-lfs-linux-gnu/bin/
LIBRARY_PATH=/home/lfs/mnt/tools/bin/../lib/gcc/x86_64-lfs-linux-gnu/5.2.0/:/home/lfs/mnt/tools/bin/../lib/gcc/:/home/lfs/mnt/tools/bin/../lib/gcc/x86_64-lfs-linux-gnu/5.2.0/../../../../x86_64-lfs-linux-gnu/lib/
COLLECT_GCC_OPTIONS='-v' '-o' 'a.out' '-mtune=generic' '-march=x86-64'
 /home/lfs/mnt/tools/bin/../libexec/gcc/x86_64-lfs-linux-gnu/5.2.0/collect2 
-plugin 
/home/lfs/mnt/tools/bin/../libexec/gcc/x86_64-lfs-linux-gnu/5.2.0/liblto_plugin.so
 
-plugin-opt=/home/lfs/mnt/tools/bin/../libexec/gcc/x86_64-lfs-linux-gnu/5.2.0/lto-wrapper
 -plugin-opt=-fresolution=/tmp/cc4IggSf.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 
/home/lfs/mnt/tools/bin/../lib/gcc/x86_64-lfs-linux-gnu/5.2.0/crtbegin.o 
-L/home/lfs/mnt/tools/bin/../lib/gcc/x86_64-lfs-linux-gnu/5.2.0 
-L/home/lfs/mnt/tools/bin/../lib/gcc 
-L/home/lfs/mnt/tools/bin/../lib/gcc/x86_64-lfs-linux-gnu/5.2.0/../../../../x86_64-lfs-linux-gnu/lib
 /tmp/ccejgjqz.o -lgcc -lc -lgcc 
/home/lfs/mnt/tools/bin/../lib/gcc/x86_64-lfs-linux-gnu/5.2.0/crtend.o crtn.o
/home/lfs/mnt/tools/bin/../lib/gcc/x86_64-lfs-linux-gnu/5.2.0/../../../../x86_64-lfs-linux-gnu/bin/ld:
 cannot find crt1.o: No such file or directory
/home/lfs/mnt/tools/bin/../lib/gcc/x86_64-lfs-linux-gnu/5.2.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
-- 
http://lists.linuxfromscratch.org/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Do not top post on this list.

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

http://en.wikipedia.org/wiki/Posting_style

Reply via email to