Constructing a Temporary System - Binutils - Pass 2 Question
Linux From ScratchThis Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Constructing a Temporary System - Binutils - Pass 2 Question
I am playing with LFS (again), but not following the directions exaclty (playing with uClibc) and currently building Temporary System under /tools. The question that I have is why in binutils run 1 there is --target=$LFS_TGT parameter, while in binutils run 2 there is no such parameter.
The thing is that before running binutils run2 I have the following: $ echo ${LFS_TGT}
x86_64-lfs-linux-uclibc
sources$ gcc-4.6.1/config.guess
x86_64-unknown-linux-gnu
and binutils is then installed into /tools/x86_64-unknown-linux-gnu
I am playing with LFS (again), but not following the directions exaclty (playing with uClibc) and currently building Temporary System under /tools. The question that I have is why in binutils run 1 there is --target=$LFS_TGT parameter, while in binutils run 2 there is no such parameter.
The thing is that before running binutils run2 I have the following: $ echo ${LFS_TGT}
x86_64-lfs-linux-uclibc
sources$ gcc-4.6.1/config.guess
x86_64-unknown-linux-gnu
and binutils is then installed into /tools/x86_64-unknown-linux-gnu
Which step in LFS book ensures that upon building binutils run2, config.guess returns ${LFS_TGT}?
None, straight from the book itself...
"CC="$LFS_TGT-gcc -B/tools/lib/" AR=$LFS_TGT-ar RANLIB=$LFS_TGT-ranlib
Because this is really a native build of Binutils, setting these variables ensures that the build system uses the cross-compiler and associated tools instead of the ones on the host system."
Binutils pass 1 was only ment to build the cross-compiler (not sure why you really need one since LFS only supports 1 arch).
What you are seeing is normal, you are building a NORMAL build of binutils with a cross-compiler.
Last edited by magiknight; 10-14-2011 at 09:24 AM.
Thanks, I guess my subsequent GCC pass2 issue is unrelated to Binutils run2:
/tools/x86_64-unknown-linux-gnu/bin/ld: cannot find crti.o: No such file or directory
This is Linux From Scratch - Version SVN-20111013
Physically look for this file, does it exist?
if it does, then I have a workaround for ld not linking against crti.o, it has nothing to do with ld at all, it's gcc's fault, it cant access the the file directly because of the assumption that crti.o is living is /usr/lib
Can you make a symlink from /tools/lib64 to /tools/lib? then rebuild gcc and see if that helps?
Physically look for this file, does it exist?
if it does, then I have a workaround for ld not linking against crti.o, it has nothing to do with ld at all, it's gcc's fault, it cant access the the file directly because of the assumption that crti.o is living is /usr/lib
Can you make a symlink from /tools/lib64 to /tools/lib? then rebuild gcc and see if that helps?
$ ls -l /tools
lrwxrwxrwx 1 root root 15 Oct 26 19:49 /tools -> /mnt/lfs/tools/
$ ls -l $LFS/tools/lib64
lrwxrwxrwx 1 lfs lfs 3 Oct 26 19:50 /mnt/lfs/tools/lib64 -> lib
$ ls -l $LFS/tools/lib64/crt*
-rw-r--r-- 1 lfs lfs 3637 Oct 26 21:07 /mnt/lfs/tools/lib64/crt1.o
-rw-r--r-- 1 lfs lfs 1512 Oct 26 21:07 /mnt/lfs/tools/lib64/crti.o
-rw-r--r-- 1 lfs lfs 1108 Oct 26 21:07 /mnt/lfs/tools/lib64/crtn.o
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.