On 2020-09-03 17:16 -0500, jam wrote:
> Hi
> 
> I'm attempting an LFS 10.0 systemd build.
> 
> I am building on an X86_64 system running Fedora32 (kernel 
> 5.8.4-200.fc32.x86_64)
>
> version-check.sh output:
> 
> bash, version 5.0.17(1)-release
> /bin/sh -> /usr/bin/bash
> Binutils: version 2.34-4.fc32
> bison (GNU Bison) 3.5
> yacc is /usr/bin/yacc - 1.9 20191125
> bzip2,  Version 1.0.8, 13-Jul-2019.
> Coreutils:  8.32
> diff (GNU diffutils) 3.7
> find (GNU findutils) 4.7.0
> GNU Awk 5.0.1, API: 3.0 (GNU MPFR 4.0.2-p9, GNU MP 6.1.2)
> /usr/bin/awk -> /usr/bin/gawk
> gcc (GCC) 10.2.1 20200723 (Red Hat 10.2.1-1)
> g++ (GCC) 10.2.1 20200723 (Red Hat 10.2.1-1)
> (GNU libc) 2.31
> grep (GNU grep) 3.3
> gzip 1.10
> Linux version 5.8.4-200.fc32.x86_64 
> (mockbu...@bkernel01.iad2.fedoraproject.org) (gcc (GCC) 10.2.1 20200723 
> (Red Hat 10.2.1-1), GNU ld version 2.34-4.fc32) #1 SMP Wed Aug 26 
> 22:28:08 UTC 2020
> m4 (GNU M4) 1.4.18
> GNU Make 4.2.1
> GNU patch 2.7.6
> Perl version='5.30.3';
> Python 3.8.5
> sed (GNU sed) 4.5
> tar (GNU tar) 1.32
> texi2any (GNU texinfo) 6.7
> xz (XZ Utils) 5.2.5
> g++ compilation OK
> 
> ----------------------
> 
> I encountered my only problem so far on page 52 with the sanity check 
> compilation of the dummy.c program ( After the build of Glibc-2.3.2)
> 
> The output from the compile attempt:
> 
> fs:~$ $LFS_TGT-gcc dummy.c
> /mnt/lfs/tools/lib/gcc/x86_64-lfs-linux-gnu/10.2.0/../../../../x86_64-lfs-
> linux-gnu/bin/ld: 
> cannot find crt1.o: No such file or directory
> /mnt/lfs/tools/lib/gcc/x86_64-lfs-linux-gnu/10.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
> 
> Checking the search Path of ld:
> 
> lfs:/mnt/lfs/lib$ $LFS_TGT-ld --verbose | grep SEARCH
> SEARCH_DIR("=/mnt/lfs/tools/x86_64-lfs-linux-gnu/lib64"); 
> SEARCH_DIR("=/usr/local/lib64"); SEARCH_DIR("=/lib64"); 
> SEARCH_DIR("=/usr/lib64"); 
> SEARCH_DIR("=/mnt/lfs/tools/x86_64-lfs-linux-gnu/lib"); 
> SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); 
> SEARCH_DIR("=/usr/lib");crt1.o
> 
> There are only 2 lfs directories nether of which contain  crt1.o or crti.o

"=/usr/lib" is a lfs directory.  "=" is replaced by sysroot prefix, which is set
with "--with-sysroot=$LFS" in Ch. 5 Binutils.

And, "SEARCH_DIR" has nothing to do finding crt1.o.  It's only the library
search path, not the path to crt1.o.  The path to crt1.o should be hardcoded in
gcc, and passed to ld by gcc.

> I did find these files located in /mnt/lfs/usr/lib/

They should be in /mnt/lfs/usr/lib, not other directories.

> I then copied these files from /mnt/lfs/usr/lib/  to 
> /mnt/lfs/tools/x86_64-lfs-linux-gnu/lib  and attempted the re-compile 
> and it worked !
> 
> lfs:~$ $LFS_TGT-gcc dummy.c
> 
> lfs:~$ readelf -l a.out | grep '/ld-linux'
>        [Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]

Don't messing around. These "hotfixes" can break the system later.  Go back and
try to figure out what is wrong.

> My question is what am I doing wrong ??

I guess you forgot --with-sysroot in Ch. 5 GCC.  But it's only my guess.  I
suggest to redo Ch. 5 carefully, saving the build logs, like

mkdir -pv $LFS/sources/buildlog
../configure ... 2>&1 | tee $LFS/sources/buildlog/binutils-configure.log
make 2>&1 | tee $LFS/sources/buildlog/binutils-make.log
... ...

If you encounter the same issue again, you can upload the logs somewhere (they
are large so email attachment may not work), and let us to investigate.
-- 
Xi Ruoyao <xry...@mengyan1223.wang>
School of Aerospace Science and Technology, Xidian University

-- 
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