Discussion:
[lfs-support] LFS8.1 chapter 5.10 : /tools/bin/gcc is dynamically linked to host linker
Mohamed Dawod
2018-06-23 15:49:04 UTC
Permalink
HI,

I hope that some one can help me..
This is the 7th time i restart LFS building from chapter5 !!

The problem starts to appear in chapter6.7 (Linux-4.12.7 API Headers)
(/tools/bin/gcc file doesnt exist error)

The problem is explained in details here :
http://archive.linuxfromscratch.org/mail-archives/lfs-support/2016-February/049686.html

So, I restart from chapter5 and when I reached to section 5.10. (GCC-7.2.0
- Pass 2) , I tried to check the linking of /tools/bin/gcc using the
command

$readelf -l /tools/bin/cc | grep "interpreter"
the result was :
[Requesting program interpreter: /lib/ld-linux.so.2]

So,what is the reason of this problem ?
and what is the solution for this problem ?
--
Mohamed Dawod
Computer Engineering Department
Faculty of Engineering
Cairo University
Hazel Russman
2018-06-23 16:19:31 UTC
Permalink
On Sat, 23 Jun 2018 18:49:04 +0300
Post by Mohamed Dawod
HI,
I hope that some one can help me..
This is the 7th time i restart LFS building from chapter5 !!
The problem starts to appear in chapter6.7 (Linux-4.12.7 API Headers)
(/tools/bin/gcc file doesnt exist error)
http://archive.linuxfromscratch.org/mail-archives/lfs-support/2016-February/049686.html
So, I restart from chapter5 and when I reached to section 5.10. (GCC-7.2.0
- Pass 2) , I tried to check the linking of /tools/bin/gcc using the
command
$readelf -l /tools/bin/cc | grep "interpreter"
[Requesting program interpreter: /lib/ld-linux.so.2]
So,what is the reason of this problem ?
and what is the solution for this problem ?
--
Mohamed Dawod
Computer Engineering Department
Faculty of Engineering
Cairo University
Check the LFS user's command path (echo $PATH). It should start with /tools/bin. Also check that the LFS user's other environmental features are as they should be.

If you have tried *once* repeating from the beginning of chapter 5 and still get the same result, it's not worth doing it again, let alone repeatedly. The problem *must* lie earlier, probably in chapter 4, where the user environment is set up.
--
Hazel
--
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?
Bruce Dubbs
2018-06-23 16:27:28 UTC
Permalink
Post by Mohamed Dawod
HI,
I hope that some one can help me..
This is the 7th time i restart LFS building from chapter5 !!
The problem starts to appear in chapter6.7 (Linux-4.12.7 API Headers)
(/tools/bin/gcc file doesnt exist error)
http://archive.linuxfromscratch.org/mail-archives/lfs-support/2016-February/049686.html
So, I restart from chapter5 and when I reached to  section 5.10.
(GCC-7.2.0 - Pass 2) , I tried to check the linking of /tools/bin/gcc
using the command
$readelf -l /tools/bin/cc | grep "interpreter"
[Requesting program interpreter: /lib/ld-linux.so.2]
So,what is the reason of this problem ?
and what is the solution for this problem ?
It's difficult to say, but I suspect your environment variables are not
correct.

From your host system, try this:

$ sudo su - lfs
$ $ env|sort
HOME=/home/lfs
LC_ALL=POSIX
LFS=/mnt/lfs
LFS_TGT=x86_64-lfs-linux-gnu
PATH=/tools/bin:/bin:/usr/bin
PS1=\u:\w\$
PWD=/home/lfs
SHLVL=1
TERM=xterm-256color

Your result should be identical, except TERM which may differ a little.

Everything in Chapter 5 should be dome as user lfs. If the above is not
correct, the system will not build properly.

Another point to emphasize is that the environment variable LFS must be
defined for the root user in Chapters 2-4 and for sections 6.2 and 6.4.
It's especially important if the system is shut down in the middle of
the book and the build is resumed later.

-- Bruce
--
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.wikipedi
Mohamed Dawod
2018-06-24 05:09:34 UTC
Permalink
1) The path for my lfs usr : $echo $PATH
--The result : /tools/bin:/bin:/usr/bin
________________________________________________________
2) The environmental variables for lfs usr : $env|sort
--The result :
HOME=/home/lfs
LC_ALL=POSIX
LFS=/mnt/lfs
LFS_TGT=i686-lfs-linux-gnu
OLDPWD=/mnt/lfs
PATH=/tools/bin:/bin:/usr/bin
PS1=${debian_chroot:+($debian_chroot)}\u@\h:\w\$
PWD=/home/lfs
SHLVL=1
TERM=xterm
_=/usr/bin/env
________________________________________________________
3) The last time, I started from chapter4 , and i didn't reboot the system
till I reach section 5.10. (GCC-7.2.0 - Pass 2) where I found the linking
problem.

So, where is the problem here ?
Post by Bruce Dubbs
Post by Mohamed Dawod
HI,
I hope that some one can help me..
This is the 7th time i restart LFS building from chapter5 !!
The problem starts to appear in chapter6.7 (Linux-4.12.7 API Headers)
(/tools/bin/gcc file doesnt exist error)
http://archive.linuxfromscratch.org/mail-archives/lfs-
support/2016-February/049686.html
So, I restart from chapter5 and when I reached to section 5.10.
(GCC-7.2.0 - Pass 2) , I tried to check the linking of /tools/bin/gcc
using the command
$readelf -l /tools/bin/cc | grep "interpreter"
[Requesting program interpreter: /lib/ld-linux.so.2]
So,what is the reason of this problem ?
and what is the solution for this problem ?
It's difficult to say, but I suspect your environment variables are not
correct.
$ sudo su - lfs
$ $ env|sort
HOME=/home/lfs
LC_ALL=POSIX
LFS=/mnt/lfs
LFS_TGT=x86_64-lfs-linux-gnu
PATH=/tools/bin:/bin:/usr/bin
PS1=\u:\w\$
PWD=/home/lfs
SHLVL=1
TERM=xterm-256color
Your result should be identical, except TERM which may differ a little.
Everything in Chapter 5 should be dome as user lfs. If the above is not
correct, the system will not build properly.
Another point to emphasize is that the environment variable LFS must be
defined for the root user in Chapters 2-4 and for sections 6.2 and 6.4.
It's especially important if the system is shut down in the middle of the
book and the build is resumed later.
-- Bruce
--
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
--
Mohamed Dawod
Computer Engineering Department
Faculty of Engineering
Cairo University
Loading...