On Fri, Dec 25, 2015 at 08:07:01PM +0000, brown wrap wrote:
> I have just started the build and up to completing build of glibc. I have
> ran into a problem that others have in compiling the dummy.c. Bottom line is
> the symbolic link is not working.
> If I try the example in the book, I get the 'cannot find crt1.o
>
> lfs:/LFS/sources/glibc-build$ $LFS_TGT-gcc dummy.c
> /LFS/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
> /LFS/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
> If I use "-B" , I get the desired results, "a.out".
>
> lfs:/LFS/sources/glibc-build$ $LFS_TGT-gcc -B/tools/lib dummy.c
> lfs:/LFS/sources/glibc-build$
>
> The same thing happens with a find command:
> lfs:/$ find /tools -name "ld*"
> Returned nothing
No, it might look similar, but the cause is different :
use find -H if you want to follow symlinks.
> If I use the full path:
> lfs:/$ find /LFS/tools -name "ld*"
> /LFS/tools/x86_64-lfs-linux-gnu/bin/ld.bfd
> /LFS/tools/x86_64-lfs-linux-gnu/bin/ld
> /LFS/tools/x86_64-lfs-linux-gnu/lib/ldscripts
> /LFS/tools/include/asm/ldt.h
> /LFS/tools/etc/ld.so.cache
> /LFS/tools/bin/ldd
> /LFS/tools/share/info/ld.info
> /LFS/tools/lib/ld-linux-x86-64.so.2
> /LFS/tools/lib/ld-2.22.so
> /LFS/tools/sbin/ldconfig
> Here is the actual link:
>
> lfs:/$ ls -larth /tools
> lrwxrwxrwx 1 root root 10 Dec 25 11:12 /tools -> /LFS/toolslfs:/$
^^^^^^^^^^^^^^^
I'm not used to all those flags in ls, but what I would _expect_ to
see from ls -l is a symlink to /mnt/lfs/tools : you appear to have
got something totally back to front in what you did. 'LFS' should
not be a directory in '/', and the link should be to /mnt/lfs/tools.
We use $LFS as /mnt/lfs and $LFS_TGT as, in this case,
x86_64-lfs-linux-gnu to fool the toolchain that we are
cross-compiling (to avoid the host toolchain in pass 2).
> Any ideas?
> Greg
>
In any case, the ld problem is because it cannot find crt1.o, not
because ld is not found.
I suggest that you check the lfs user's command history from the
beginning, and compare it to the book. When you can see where you
took a different approach from what the book said, start again. If
you cannot see what you did wrong (probably, something to do with
$LFS), please ask again.
When you start again, please re-read section 5.3 (and the Host
System Requirements, linked from the first 'Important' note there).
I haven't seen your particular issue before, but we have had a lot
of people who do not read that section, and they get problems.
And have fun working out where you went wrong, and then learn from
the error. We all make mistakes, it is when we go on to repeat them
even after we should know better that they really hurt. Yes, of
course we all do that too, but hopefully not for every mistake we
have ever made ;-)
ĸen
--
This email was written using 100% recycled letters.
--
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