LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This 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


Reply
  Search this Thread
Old 10-08-2010, 03:29 PM   #1
guodah
LQ Newbie
 
Registered: Sep 2010
Posts: 23

Rep: Reputation: 0
Binary "perl" is missing wierdly. (Section 6.7.1 LFS 6.5)


Hi,

I am following Section 6.7.1 (LFS6.5).

After entering "make headers_check", it shows the following errors:

Quote:

root:/sources/linux-2.6.30.2# make headers_check
CHK include/linux/version.h
make[1]: 'scripts/unifdef' is up to date.
INSTALL include/asm-generic (12 files)
/bin/sh: /usr/bin/perl: No such file or directory
make[2]: *** [/sources/linux-2.630.2/usr/include/asm-generic/.install Error 1
make[1]: *** [asm-generic] Error 2
It seemed that "/bin/sh" and/or "/usr/bin/perl" are missing. But I found them both as follows:

Quote:

root:/sources/linux-2.6.30.2# ls -al /usr/bin/perl
lrwxrwxrwx 1 root root 15 15 Oct 7 20:21 /usr/bin/perl -> /tools/bin/perl

root:/sources/linux-2.6.30.2# ls -al /tools/bin/perl
-rwxr-xr-x 1 1000 102 1130200 Oct 1 21:29 /tools/bin/perl

root:/sources/linux-2.6.30.2# ls -al /bin/sh
lrwxrwxrwx 1 root root 4 Oct 7 20:23 /bin/sh -> bash
Then I tried to execute them and found "perl" cannot be found:

Quote:

root:/sources/linux-2.6.30.2# /bin/sh

root:/sources/linux-2.6.30.2# /usr/bin/perl
sh: /usr/bin/perl: No such file or directory
I am really puzzled. Any suggestions will be greatly appreciated!

Thanks,
Dan
 
Old 10-08-2010, 04:35 PM   #2
crts
Senior Member
 
Registered: Jan 2010
Posts: 2,020

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
Hi,

this is a strange error. My guess is that something went wrong in chapter 5 during the adjusting phase which resulted in a corrupted toolchain.
Can you perform the following command
Code:
ldd /tools/bin/perl
The output should be something like this:
Code:
linux-gate.so.1 => (0xb7751000)
libnsl.so.1 => /tools/lib/libnsl.so.2 (0xb7735000)
...
libc.so.6 => /tools/lib/libc.so.6 (0xb7596000)
/tools/lib/ld-linux.so.2 (0xb7752000)
The addresses will probably be different on your machine.
However, I suspect that the dynamic libraries were not installed in /tools/lib/ and you will probably get a 'No such file or directory' error.
If that happens then at least some of the libraries were installed somewhere on your host system. I hope you used the liveCD. Otherwise your host might be damaged.

Hope this helps.
 
Old 10-08-2010, 04:48 PM   #3
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
What does "file /tools/bin/perl" show?
 
Old 10-10-2010, 09:22 PM   #4
guodah
LQ Newbie
 
Registered: Sep 2010
Posts: 23

Original Poster
Rep: Reputation: 0
crts:

Thank you very much!

I ran "ldd /tools/bin/perl" and got the same error message "No such file or directary". But that is what happened after I chroot'ed. When I ran it under LiveCD's root, I got the same dependencies. It seems that there must've something wrong with how I chroot. But I used the exactly the same command in LFS-book-6.5. Any other idea?

MensaWater:

Thank you very much!

I ran "file /tools/bin/perl" under LiveCD's root and got the following response:

Quote:
/tools/bin/perl: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/linux 2.6.0, dynamically linked (uses shared libs), stripped
I cannot run "file /tools/bin/perl" after I chroot'ed.

Any other ideas?
 
Old 10-11-2010, 07:24 AM   #5
crts
Senior Member
 
Registered: Jan 2010
Posts: 2,020

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
Quote:
Originally Posted by guodah View Post
When I ran it under LiveCD's root, I got the same dependencies. It seems that there must've something wrong with how I chroot. But I used the exactly the same command in LFS-book-6.5. Any other idea?
Can you post the exact output that you have got when running ldd (when chrooted and when you are in your host's environment)? You did make sure that when compiling your toolchain you had a symlink created like
/tools -> /mnt/lfs/tools

In your host post the output of
Code:
ls -l /
ls -l /mnt/lfs/
One more thing I noticed
Code:
root:/sources/linux-2.6.30.2# ls -al /tools/bin/perl
-rwxr-xr-x 1 1000 102 1130200 Oct 1 21:29 /tools/bin/perl
This indicates that your toolchain is still owned by user lfs. At the end of chapter 5 the book says that you should change owner of toolchain to
Code:
chown -R root:root $LFS/tools
Apparently you skipped that.
 
Old 10-11-2010, 01:36 PM   #6
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Quote:
Originally Posted by guodah View Post
[B]crts:
I ran "ldd /tools/bin/perl" and got the same error message "No such file or directary". But that is what happened after I chroot'ed.
...
I cannot run "file /tools/bin/perl" after I chroot'ed.
Did you mention chroot before?

In your chroot environment you must have all files you intend to use as the entire point of this is to make sure the user can't see things above the new root. You may or may not want your user having access to ldd and file in chroot (that is to say YOU may want them available to you to debug issues there but that doesn't mean you want the user in chroot to see them.)

So if your chroot's real path on the system (when you're not chroot'ed) is say: /usr/local/billybob/chroot then you need to understand that when you ARE chroot'ed the "root directory" is relative to that path and is all the chroot'ed user can see. Therefore to have a chroot'ed user access "/tools/bin/perl" you must copy the "real" file into /usr/local/billybon/chroot/tools/bin. You can not use symbolic links for that purpose if they point outside the chroot.

Similarly you would need to copy in other things needed there such as any shared libaries or executables required such as /usr/bin/file which would become /usr/local/billybob/chroot/usr/bin/file (but would be seen by the chroot'ed user as simply /usr/bin/file.
 
Old 10-11-2010, 09:57 PM   #7
guodah
LQ Newbie
 
Registered: Sep 2010
Posts: 23

Original Poster
Rep: Reputation: 0
To CRTS

Thanks for your response! I really appreciate it!

The output of "ls -l /" is

Quote:
total 76
drwxr-xr-x 2 root root 4096 Dec 29 2007 bin
drwxr-xr-x 10 root root 4096 Oct 12 01:48 dev
lrwxrwxrwx 1 root root 23 Oct 11 20:47 drivers -> /dev/shm/.cdrom/drivers
drwxr-xr-x 33 root root 4096 Oct 12 01:48 etc
drwxr-xr-x 3 root root 4096 Dec 29 2007 home
lrwxrwxrwx 1 root root 27 Oct 11 20:47 lfs-sources -> /dev/shm/.cdrom/lfs-sources
drwxr-xr-x 7 root root 4096 Dec 29 2007 lib
drwx------ 2 root root 16384 Dec 29 2007 lost+found
drwxr-xr-x 4 root root 4096 Dec 29 2007 media
drwxr-xr-x 3 root root 4096 Oct 12 01:48 mnt
drwxr-xr-x 8 root root 4096 Dec 29 2007 opt
dr-xr-xr-x 51 root root 0 Oct 11 20:47 proc
drwxr-x--- 7 root root 4096 Oct 12 01:48 root
drwxr-xr-x 2 root root 4096 Dec 29 2007 sbin
drwxr-xr-x 2 root root 4096 Dec 29 2007 srv
drwxr-xr-x 11 root root 0 Oct 11 20:47 sys
drwxrwxrwt 2 root root 8192 Oct 11 20:47 tmp
lrwxrwxrwx 1 root root 14 Oct 12 01:48 tools -> /mnt/lfs/tools
drwxr-xr-x 10 root root 4096 Dec 29 2007 usr
drwxr-xr-x 12 root root 4096 Dec 29 2007 var

The output of " ls -l /mnt/lfs" is

Quote:
total 92
drwxr-xr-x 2 root root 4096 Oct 7 15:23 bin
drwxr-xr-x 2 root root 4096 Oct 7 15:08 boot
drwxr-xr-x 2 root root 4096 Oct 6 20:07 dev
drwxr-xr-x 3 root root 4096 Oct 7 15:37 etc
drwxr-xr-x 2 root root 4096 Oct 7 15:08 home
drwxr-xr-x 2 root root 4096 Oct 7 15:08 lib
drwx------ 2 root root 16384 Aug 20 06:24 lost+found
drwxr-xr-x 4 root root 4096 Oct 7 15:09 media
drwxr-xr-x 2 root root 4096 Oct 7 15:08 mnt
drwxr-xr-x 2 root root 4096 Oct 7 15:08 opt
drwxr-xr-x 2 root root 4096 Oct 6 20:01 proc
drwxr-x--- 2 root root 4096 Oct 7 15:38 root
drwxr-xr-x 2 root root 4096 Oct 7 15:09 sbin
drwxrwxrwt 25 root root 4096 Oct 8 11:38 sources
drwxr-xr-x 2 root root 4096 Oct 7 15:09 srv
drwxr-xr-x 2 root root 4096 Oct 6 20:01 sys
drwxrwxrwt 2 root root 4096 Oct 12 01:09 tmp
drwxr-xr-x 12 root root 4096 Oct 1 16:30 tools
drwxr-xr-x 9 root root 4096 Oct 7 15:14 usr
drwxr-xr-x 12 root root 4096 Oct 7 15:18 var
The output of "ldd /tools/bin/perl" after I chrooted is

Quote:
root:/sources/linux-2.6.30.2# ldd /tools/bin/perl
/tools/bin/ldd: line 126: /tools/bin/perl: No such file or directory
Output of "ldd /tools/bin/perl" in the host root is

Quote:
root[ ~ ]# ldd /tools/bin/perl
linux-gate.so.1 => (0xb7f61000)
libnsl.so.1 => /lib/libnsl.so.1 (0xb7f41000)
libdl.so.2 => /lib/libdl.so.2 (0xb7f3d000)
libm.so.6 => /lib/libm.so.6 (0xb7f18000)
libcrypt.so.1 => /lib/libcrypt.so.1 (0xb7eea000)
libutil.so.1 => /lib/libutil.so.1 (0xb7ee6000)
libc.so.6 => /lib/libc.so.6 (0xb7dbb000)
/lib/ld-linux.so.2 (0xb7f62000)


Thanks for finding that the root is the owner of $LFS/tools! But it still cannot find /tools/bin/perl after I ran "chown -R root:root $LFS/tools".
 
Old 10-11-2010, 10:12 PM   #8
guodah
LQ Newbie
 
Registered: Sep 2010
Posts: 23

Original Poster
Rep: Reputation: 0
To MensaWater

Thanks a lot for your response!

My chroot directory is /mnt/lfs/. And the binary "perl" is in /mnt/lfs/tools/bin/perl.

In chroot'ed root, this binary is "missing"

Quote:
root:/tools/bin# ./perl
bash: ./perl: No such file or directory
But this binary is accessible in the original root, because if I run the following command,

Quote:

root[ /mnt/lfs/tools/bin ]# ./perl

the shell will pause. I guess it is running.

Last edited by guodah; 10-11-2010 at 10:14 PM.
 
Old 10-12-2010, 04:59 AM   #9
crts
Senior Member
 
Registered: Jan 2010
Posts: 2,020

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
And here is your problem.
Code:
root[ ~ ]# ldd /tools/bin/perl
linux-gate.so.1 => (0xb7f61000)
libnsl.so.1 => /lib/libnsl.so.1 (0xb7f41000)
libdl.so.2 => /lib/libdl.so.2 (0xb7f3d000)
libm.so.6 => /lib/libm.so.6 (0xb7f18000)
libcrypt.so.1 => /lib/libcrypt.so.1 (0xb7eea000)
libutil.so.1 => /lib/libutil.so.1 (0xb7ee6000)
libc.so.6 => /lib/libc.so.6 (0xb7dbb000)
/lib/ld-linux.so.2 (0xb7f62000)
As I suspected, your toolchain is corrupted.
The output should have been:
Code:
root[ ~ ]# ldd /tools/bin/perl
linux-gate.so.1 => (0xb7f61000)
libnsl.so.1 => /tools/lib/libnsl.so.1 (0xb7f41000)
libdl.so.2 => /tools/lib/libdl.so.2 (0xb7f3d000)
libm.so.6 => /tools/lib/libm.so.6 (0xb7f18000)
libcrypt.so.1 => /tools/lib/libcrypt.so.1 (0xb7eea000)
libutil.so.1 => /tools/lib/libutil.so.1 (0xb7ee6000)
libc.so.6 => /tools/lib/libc.so.6 (0xb7dbb000)
/tools/lib/ld-linux.so.2 (0xb7f62000)
Your toolchain is not usable. Check some more binaries in /tools/bin, e.g.
/tools/bin/ls
/tools/bin/sed
/tools/bin/grep
...

If too many have been not been linked against the libs in /tools then you should start over from scratch.
 
Old 10-12-2010, 07:41 AM   #10
guodah
LQ Newbie
 
Registered: Sep 2010
Posts: 23

Original Poster
Rep: Reputation: 0
Hi, CRTS:

Finally, something wrong was found! I have run every command in /tools/bin. Only perl is not found. In addition, two other tools "mtrace" and "pod2man" depend on perl, hence do not work:

Quote:
./mtrace
bash: ./mtrace: /usr/bin/perl: bad interpreter: No such file or directory

./pod2man
bash: ./pod2man: /tools/bin/perl: bad interpreter: No such file or directory
Would you think it possible to reinstall perl to solve the problem? I do not mind starting all over from scratch, but want to give a shot to re-installation. Do you know how to uninstall a tool in LiveCD?

Thank you for your precious time and help!
 
Old 10-12-2010, 08:31 AM   #11
crts
Senior Member
 
Registered: Jan 2010
Posts: 2,020

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
Quote:
Originally Posted by guodah View Post
Hi, CRTS:

Finally, something wrong was found! I have run every command in /tools/bin. Only perl is not found. In addition, two other tools "mtrace" and "pod2man" depend on perl, hence do not work:



Would you think it possible to reinstall perl to solve the problem? I do not mind starting all over from scratch, but want to give a shot to re-installation. Do you know how to uninstall a tool in LiveCD?

Thank you for your precious time and help!
Hi,

if you are certain that perl is the only package that got linked falsely then you can try to fix it. Do not try to uninstall anything. Since you cannot _easily_ identify which binary belongs to perl you might break your toolchain even more. Just reinstall and everything belonging to perl should be overwritten. The procedure, however, is a bit tricky. Since you are using the liveCD you will have to recreate the user 'lfs' again. After that you will have to change owner ship of your toolchain back to user 'lfs'. Then you should be able rebuilding perl with a fresh untarred source as described in chapter 5.27. I just want to take a look if there are some dependencies/issues with subsequent packages. I'll provide you with some instructions in short.
 
Old 10-12-2010, 11:02 AM   #12
crts
Senior Member
 
Registered: Jan 2010
Posts: 2,020

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
Ok,

before you attempt to fix your toolchain let us do some sanity checks first. This will help to better assess the extent of the damage.
Do not chroot.
Create a file 'tcsanity.sh' with the following contents:
Code:
#!/bin/bash
# tcsanity.sh
for dir in bin $(uname -m)-{pc,lfs}-linux-gnu; do
  echo "Searching in: /mnt/lfs/tools/${dir}"
  find /mnt/lfs/tools/${dir} -type f -perm -u=x | xargs -I {} sh -c 'var=$(ldd "$1" | sed -r "\@linux-gate.so.1|executable|/tools/@ d"); if [[ "" != $var ]]; then echo "$1"; echo "${var}"; fi' {} {}
done
It's probably best if you copy+paste above commands. Save and make the file executable. Now run it:
Code:
./tcsanity.sh &> tcs.log
Post the content of 'tcs.log' here.
 
Old 10-12-2010, 12:16 PM   #13
guodah
LQ Newbie
 
Registered: Sep 2010
Posts: 23

Original Poster
Rep: Reputation: 0
Hi, CRTS:

I guess it is pretty bad

Quote:
Searching in: /mnt/lfs/tools/bin
/mnt/lfs/tools/bin/i686-lfs-linux-gnu-strings
libz.so.1 => /lib/libz.so.1 (0xb7eda000)
libc.so.6 => /lib/libc.so.6 (0xb7daf000)
/lib/ld-linux.so.2 (0xb7ef9000)
/mnt/lfs/tools/bin/i686-lfs-linux-gnu-c++filt
libz.so.1 => /lib/libz.so.1 (0xb7f15000)
libc.so.6 => /lib/libc.so.6 (0xb7dea000)
/lib/ld-linux.so.2 (0xb7f34000)
/mnt/lfs/tools/bin/i686-lfs-linux-gnu-readelf
libz.so.1 => /lib/libz.so.1 (0xb7f8e000)
libc.so.6 => /lib/libc.so.6 (0xb7e63000)
/lib/ld-linux.so.2 (0xb7fad000)
/mnt/lfs/tools/bin/i686-lfs-linux-gnu-ar
libz.so.1 => /lib/libz.so.1 (0xb7f21000)
libc.so.6 => /lib/libc.so.6 (0xb7df6000)
/lib/ld-linux.so.2 (0xb7f40000)
/mnt/lfs/tools/bin/perl
libnsl.so.1 => /lib/libnsl.so.1 (0xb7ed9000)
libdl.so.2 => /lib/libdl.so.2 (0xb7ed5000)
libm.so.6 => /lib/libm.so.6 (0xb7eb0000)
libcrypt.so.1 => /lib/libcrypt.so.1 (0xb7e82000)
libutil.so.1 => /lib/libutil.so.1 (0xb7e7e000)
libc.so.6 => /lib/libc.so.6 (0xb7d53000)
/lib/ld-linux.so.2 (0xb7efa000)
/mnt/lfs/tools/bin/i686-lfs-linux-gnu-objdump
libz.so.1 => /lib/libz.so.1 (0xb7ed6000)
libc.so.6 => /lib/libc.so.6 (0xb7dab000)
/lib/ld-linux.so.2 (0xb7ef5000)
/mnt/lfs/tools/bin/i686-lfs-linux-gnu-cpp
libc.so.6 => /lib/libc.so.6 (0xb7dc1000)
/lib/ld-linux.so.2 (0xb7ef7000)
/mnt/lfs/tools/bin/i686-lfs-linux-gnu-gcov
libc.so.6 => /lib/libc.so.6 (0xb7e91000)
/lib/ld-linux.so.2 (0xb7fc7000)
/mnt/lfs/tools/bin/i686-lfs-linux-gnu-gprof
libz.so.1 => /lib/libz.so.1 (0xb7f45000)
libm.so.6 => /lib/libm.so.6 (0xb7f20000)
libc.so.6 => /lib/libc.so.6 (0xb7df5000)
/lib/ld-linux.so.2 (0xb7f64000)
/mnt/lfs/tools/bin/i686-lfs-linux-gnu-size
libz.so.1 => /lib/libz.so.1 (0xb7edc000)
libc.so.6 => /lib/libc.so.6 (0xb7db1000)
/lib/ld-linux.so.2 (0xb7efb000)
/mnt/lfs/tools/bin/i686-lfs-linux-gnu-objcopy
libz.so.1 => /lib/libz.so.1 (0xb7fb6000)
libc.so.6 => /lib/libc.so.6 (0xb7e8b000)
/lib/ld-linux.so.2 (0xb7fd5000)
/mnt/lfs/tools/bin/i686-lfs-linux-gnu-ranlib
libz.so.1 => /lib/libz.so.1 (0xb7ef7000)
libc.so.6 => /lib/libc.so.6 (0xb7dcc000)
/lib/ld-linux.so.2 (0xb7f16000)
/mnt/lfs/tools/bin/i686-lfs-linux-gnu-nm
libz.so.1 => /lib/libz.so.1 (0xb7f3d000)
libc.so.6 => /lib/libc.so.6 (0xb7e12000)
/lib/ld-linux.so.2 (0xb7f5c000)
/mnt/lfs/tools/bin/i686-lfs-linux-gnu-ld
libz.so.1 => /lib/libz.so.1 (0xb7f51000)
libc.so.6 => /lib/libc.so.6 (0xb7e26000)
/lib/ld-linux.so.2 (0xb7f70000)
/mnt/lfs/tools/bin/i686-lfs-linux-gnu-strip
libz.so.1 => /lib/libz.so.1 (0xb7ecd000)
libc.so.6 => /lib/libc.so.6 (0xb7da2000)
/lib/ld-linux.so.2 (0xb7eec000)
/mnt/lfs/tools/bin/i686-lfs-linux-gnu-addr2line
libz.so.1 => /lib/libz.so.1 (0xb7f43000)
libc.so.6 => /lib/libc.so.6 (0xb7e18000)
/lib/ld-linux.so.2 (0xb7f62000)
/mnt/lfs/tools/bin/i686-lfs-linux-gnu-gcc
libc.so.6 => /lib/libc.so.6 (0xb7e50000)
/lib/ld-linux.so.2 (0xb7f86000)
/mnt/lfs/tools/bin/i686-lfs-linux-gnu-gcc-4.4.1
libc.so.6 => /lib/libc.so.6 (0xb7e4e000)
/lib/ld-linux.so.2 (0xb7f84000)
/mnt/lfs/tools/bin/i686-lfs-linux-gnu-as
libz.so.1 => /lib/libz.so.1 (0xb7f61000)
libc.so.6 => /lib/libc.so.6 (0xb7e36000)
/lib/ld-linux.so.2 (0xb7f80000)
Searching in: /mnt/lfs/tools/i686-pc-linux-gnu
Searching in: /mnt/lfs/tools/i686-lfs-linux-gnu
/mnt/lfs/tools/i686-lfs-linux-gnu/bin/ranlib
libz.so.1 => /lib/libz.so.1 (0xb7fb6000)
libc.so.6 => /lib/libc.so.6 (0xb7e8b000)
/lib/ld-linux.so.2 (0xb7fd5000)
/mnt/lfs/tools/i686-lfs-linux-gnu/bin/nm
libz.so.1 => /lib/libz.so.1 (0xb7f11000)
libc.so.6 => /lib/libc.so.6 (0xb7de6000)
/lib/ld-linux.so.2 (0xb7f30000)
/mnt/lfs/tools/i686-lfs-linux-gnu/bin/strip
libz.so.1 => /lib/libz.so.1 (0xb7f9c000)
libc.so.6 => /lib/libc.so.6 (0xb7e71000)
/lib/ld-linux.so.2 (0xb7fbb000)
/mnt/lfs/tools/i686-lfs-linux-gnu/bin/objcopy
libz.so.1 => /lib/libz.so.1 (0xb7f1a000)
libc.so.6 => /lib/libc.so.6 (0xb7def000)
/lib/ld-linux.so.2 (0xb7f39000)
/mnt/lfs/tools/i686-lfs-linux-gnu/bin/as
libz.so.1 => /lib/libz.so.1 (0xb7f42000)
libc.so.6 => /lib/libc.so.6 (0xb7e17000)
/lib/ld-linux.so.2 (0xb7f61000)
/mnt/lfs/tools/i686-lfs-linux-gnu/bin/ar
libz.so.1 => /lib/libz.so.1 (0xb7ed3000)
libc.so.6 => /lib/libc.so.6 (0xb7da8000)
/lib/ld-linux.so.2 (0xb7ef2000)
/mnt/lfs/tools/i686-lfs-linux-gnu/bin/objdump
libz.so.1 => /lib/libz.so.1 (0xb7fb1000)
libc.so.6 => /lib/libc.so.6 (0xb7e86000)
/lib/ld-linux.so.2 (0xb7fd0000)
/mnt/lfs/tools/i686-lfs-linux-gnu/bin/gcc
libc.so.6 => /lib/libc.so.6 (0xb7e57000)
/lib/ld-linux.so.2 (0xb7f8d000)
/mnt/lfs/tools/i686-lfs-linux-gnu/bin/ld
libz.so.1 => /lib/libz.so.1 (0xb7f1e000)
libc.so.6 => /lib/libc.so.6 (0xb7df3000)
/lib/ld-linux.so.2 (0xb7f3d000)
 
Old 10-12-2010, 02:11 PM   #14
crts
Senior Member
 
Registered: Jan 2010
Posts: 2,020

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
Quote:
Originally Posted by guodah View Post
Hi, CRTS:

I guess it is pretty bad
It doesn't look that bad. As it appears, perl is the only binary that has not been compiled properly.
All the other output is from your cross-compiler i686-lfs-linux-gnu-*. That's normal. This is gcc-package from pass1. It does indeed link against the host's systems libs.
From your other post I see that you have stripped your toolchain. I am not sure if this will be an issue when rebuilding. I *think* not.
So let's try to fix perl.

1.) Go back to chapter 4. Repeat all the steps from chapter 4.1 to chapter 4.4. Now you should have recreated user lfs again. Before you continue make sure that all files in /mnt/lfs/{tools,sources} are owned by user 'lfs'
Code:
chown -R lfs:lfs /mnt/lfs/{tools,sources}
2.) Check the compiler by executing the following commands
Code:
echo 'main(){}' > dummy.c
cc dummy.c
readelf -l a.out | grep ': /tools'
The output should be:
Code:
[Requesting program interpreter: /tools/lib/ld-linux.so.2]

Remove the dummy
Code:
rm -v dummy.c a.out
3.) Move on to chapter 5.27. Untar perl again, so you can work with untainted sources. cd into perl's source directory and follow the steps in that chapter exactly.

4.) When the installation has finished check the libs from perl again
Code:
ldd /tools/bin/perl
If the binary has been linked against /tools/lib/ then you should be good to go.
Good luck.

P.S.: When posting output or commands from your console then please use [CODE][/CODE] tags. Your output above is hard to read because the indentation is automatically removed when you use [QUOTE][/QUOTE] tags.

Last edited by crts; 10-12-2010 at 02:13 PM.
 
Old 10-12-2010, 03:10 PM   #15
guodah
LQ Newbie
 
Registered: Sep 2010
Posts: 23

Original Poster
Rep: Reputation: 0
Hi, CRTS

In your step 2

Code:
echo 'main(){}' > dummy.c
cc dummy.c
readelf -l a.out | grep ': /tools'
Should it be:

Code:
echo 'main(){}' > dummy.c
$LFS_TGT-gcc -B/tools/lib dummy.c
readelf -l a.out | grep ': /tools'
as in Section 5.8?

P.S.
I have said that many times. But I gotta say that again: thank you!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LFS6.3 livecd "ls : command not found" error after "su - lfs" rotu Linux From Scratch 2 06-19-2008 04:59 PM
"Xlib: extension "XFree86-DRI" missing on display ":0.0"." zaps Linux - Games 9 05-14-2007 04:07 PM
Video Card Nvidia Driver Xlib: extension "GLX" missing on display ":0.0". HELP! badgerbox76 Linux - Newbie 35 03-08-2007 03:27 AM
LFS 4.1: Stalled at Perl, "missing seperator" error from "make" SparceMatrix Linux From Scratch 1 06-07-2003 04:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 02:58 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration