LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 01-19-2018, 11:04 AM   #1
parotta36
Member
 
Registered: Dec 2017
Location: Madurai
Distribution: Linux Mint | Slackware
Posts: 59

Rep: Reputation: Disabled
No output for sanity check in Glibc-2.26 chapter 5.7 - Error in tools directory location


When I performed the sanity check,
Code:
echo 'int main(){}' > dummy.c
$LFS_TGT-gcc dummy.c
readelf -l a.out | grep ': /tools'
the expected output is,
Code:
[Requesting program interpreter: /tools/lib/ld-linux.so.2]
There was no output for me. when I tried readelf without grep,
I got
Code:
[Requesting program interpreter: tools/lib64/ld-linux-x86-64.so.2]
The tools directory doesn't seem to start from root. How do I resolve this?

Last edited by parotta36; 01-20-2018 at 06:33 AM. Reason: Sentence corrected.
 
Old 01-20-2018, 05:10 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,285

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
if your /tools isn't in /, put in a symlink.
Code:
one -sf /full/path/to/tools /tools
 
Old 01-20-2018, 06:46 AM   #3
parotta36
Member
 
Registered: Dec 2017
Location: Madurai
Distribution: Linux Mint | Slackware
Posts: 59

Original Poster
Rep: Reputation: Disabled
one? command not found

BTW, so the problem is, that the tools in LFS is not linked to /tools?
And also, will all the config in $LFS/tools reflect in /tools once linked?

I tried
Code:
ln -sf $LFS/tools /tools
even from root, and it didn't work.

Last edited by parotta36; 01-20-2018 at 06:57 AM. Reason: tried ln
 
Old 01-20-2018, 08:00 AM   #4
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,150

Rep: Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856
yes the link is linking the tools folder not the individual tools, creating this link is one of the earlier things the lfs book says todo, ALWAYS read the book !
 
Old 01-20-2018, 02:02 PM   #5
parotta36
Member
 
Registered: Dec 2017
Location: Madurai
Distribution: Linux Mint | Slackware
Posts: 59

Original Poster
Rep: Reputation: Disabled
Of course I executed the command. I don't know how or why it didn't link.
I'm stuck right now. ln also didn't work. Please help.
 
Old 01-20-2018, 02:33 PM   #6
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,150

Rep: Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856
this link needs to be made as root.
 
Old 01-21-2018, 06:13 AM   #7
parotta36
Member
 
Registered: Dec 2017
Location: Madurai
Distribution: Linux Mint | Slackware
Posts: 59

Original Poster
Rep: Reputation: Disabled
The folders are linked. But I still keep getting the same error.
Code:
[Requesting program interpreter: tools/lib64/ld-linux-x86-64.so.2]
 
Old 01-21-2018, 06:32 AM   #8
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,150

Rep: Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856
I would suggest starting from scratch as you are near the begining of chap 5, delete the tools folder AND the symlink in /, start again and check that all the commands have completed properly especialy the /tools symlink, you can use the readlink or file command to check where a link is pointing to.
 
Old 01-22-2018, 11:35 AM   #9
parotta36
Member
 
Registered: Dec 2017
Location: Madurai
Distribution: Linux Mint | Slackware
Posts: 59

Original Poster
Rep: Reputation: Disabled
Yes, I restarted my build as suggested. The file links just as before. I verified it using the Dolphin browser[I use Slackware] and I can confirm that it is linked. But when I use ls -l it didn't show the link.
This doesn't seem to be a problem right now.
But again, while performing the sanity check,
Code:
lfs:/mnt/lfs/sources/glibc-2.26/build$ echo 'int main(){}' > dummy.c
lfs:/mnt/lfs/sources/glibc-2.26/build$ $LFS_TGT-gcc dummy.c
/mnt/lfs/tools/bin/../lib/gcc/x86_64-lfs-linux-gnu/7.2.0/../../../../x86_64-lfs-linux-gnu/bin/ld:
cannot find crt1.o: No such file or directory
/mnt/lfs/tools/bin/../lib/gcc/x86_64-lfs-linux-gnu/7.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
lfs:/mnt/lfs/sources/glibc-2.26/build$ readelf -l a.out | grep ': /tools'
readelf: Error: 'a.out': No such file
Th bashrc and bash_profile files.
Code:
lfs:/mnt/lfs/sources/glibc-2.26/build$ cat ~/.bash_profile
exec env -i HOME=$HOME TERM=$TERM PS1='\u:\w\$ ' /bin/bash
lfs:/mnt/lfs/sources/glibc-2.26/build$ cat ~/.bashrc      
set +h
umask 022
LFS=/mnt/lfs
LC_ALL=POSIX
LFS_TGT=$(uname -m)-lfs-linux-gnu
PATH=/tools/bin:/bin:/usr/bin
export LFS LC_ALL LFS_TGT PATH
Code:
lfs:/mnt/lfs/sources/glibc-2.26/build$ find -L /tools -name "crt1.o"
/tools/lib/crt1.o
/tools/lib64/crt1.o
Output of version_check.s
Code:
bash-4.3# /host/version_check.sh 
bash, version 4.3.46(1)-release
/bin/sh -> /bin/bash
Binutils: version 2.26.20160125
bison (GNU Bison) 3.0.4
yacc is bison (GNU Bison) 3.0.4
bzip2,  Version 1.0.6, 6-Sept-2010.
Coreutils:  8.25
diff (GNU diffutils) 3.3
find (GNU findutils) 4.4.2
GNU Awk 4.1.3, API: 1.1 (GNU MPFR 3.1.4, GNU MP 6.1.1)
/usr/bin/awk -> /bin/gawk-4.1.3
gcc (GCC) 5.3.0
g++ (GCC) 5.3.0
(GNU libc) 2.23
grep (GNU grep) 2.25
gzip 1.8
Linux version 4.4.14 (root@hive64) (gcc version 5.3.0 (GCC) ) #2 SMP Fri Jun
24 13:38:27 CDT 2016
m4 (GNU M4) 1.4.17
GNU Make 4.1
GNU patch 2.7.5
Perl version='5.22.2';
sed (GNU sed) 4.2.2
tar (GNU tar) 1.29
texi2any (GNU texinfo) 6.1
xz (XZ Utils) 5.2.2
 
Old 01-22-2018, 02:16 PM   #10
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,150

Rep: Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856
If ls is not showing the link then it has NOT been created properly try:
Code:
readlink /tools
If the output points to anywhere other than your tools folder then you have a problem.

PLEASE NOTE:
"This doesn't seem to be a problem right now." -> WRONG!!!

When presented with ANY error while building the tool chain WILL make for a fubar'ed tool chain and ultimately a broken system, you MUST fix problems as they appear or you you will never get a working LFS system.
 
Old 01-23-2018, 07:12 AM   #11
parotta36
Member
 
Registered: Dec 2017
Location: Madurai
Distribution: Linux Mint | Slackware
Posts: 59

Original Poster
Rep: Reputation: Disabled
Yes, thanks. I can confirm that it is linked.
Now how to rectify the sanity check error?

Last edited by parotta36; 01-23-2018 at 08:43 AM.
 
  


Reply



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
[SOLVED] Linux from scratch , chapter 5.7 No output from sanity check flighter Linux From Scratch 8 08-20-2013 07:16 AM
[SOLVED] LFS 7.3 / Chapter 6.10 / Page 96 / Error from the sanity check Drumachine Linux From Scratch 4 08-15-2013 09:01 AM
[SOLVED] error after tools check glibc chapter 5.7 Lancelot1 Linux From Scratch 14 12-11-2012 10:32 AM
[SOLVED] LFS 6.8 - check error 2 when installing glibc for chapter 6.9 robofighter Linux From Scratch 4 07-30-2011 03:25 PM
No output from sanity check, chapter 5.7.*Adjusting the Toolchain Murdock_nl Linux From Scratch 2 09-13-2008 12:59 AM

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

All times are GMT -5. The time now is 12:47 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