LinuxQuestions.org
Review your favorite Linux distribution.
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 02-17-2019, 12:57 PM   #1
parotta36
Member
 
Registered: Dec 2017
Location: Madurai
Distribution: Linux Mint | Slackware
Posts: 58

Rep: Reputation: Disabled
GCC main build ch 6.2 - Sanity check error - directories


Search paths for header files and new linker are not as specified in the book.
I only get a few of those directories as output. Are these enough? Else, what am I supposed to do?

Code:
(lfs chroot) root:/sources/gcc-8.2.0/build# grep -B4 '^ /usr/include' dummy.log  
ignoring nonexistent directory "/tools/lib/gcc/x86_64-pc-linux-gnu/8.2.0/../../../../x86_64-pc-linux-gnu/include"
ignoring duplicate directory "/tools/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/include
Expected:
Quote:
#include <...> search starts here:

/usr/lib/gcc/x86_64-pc-linux-gnu/8.2.0/include

/usr/local/include

/usr/lib/gcc/x86_64-pc-linux-gnu/8.2.0/include-fixed

/usr/include
Code:
(lfs chroot) root:/sources/gcc-8.2.0/build# grep 'SEARCH.*/usr/lib' dummy.log |sed 's|; |\n|g'
SEARCH_DIR("=/tools/x86_64-pc-linux-gnu/lib64")
SEARCH_DIR("/usr/lib")
SEARCH_DIR("/lib")
SEARCH_DIR("=/tools/x86_64-pc-linux-gnu/lib");
Expected:
Quote:
SEARCH_DIR("/usr/x86_64-pc-linux-gnu/lib64")

SEARCH_DIR("/usr/local/lib64") SEARCH_DIR("/lib64")

SEARCH_DIR("/usr/lib64") SEARCH_DIR("/usr/x86_64-pc-linux-gnu/lib")

SEARCH_DIR("/usr/local/lib")

SEARCH_DIR("/lib")

SEARCH_DIR("/usr/lib");
 
Old 02-18-2019, 05:39 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 9,929

Rep: Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077
These are the sanity checks on your work in chapter 5. I think it's 6:4 where you enter the chroot and subsequently start compiling stuff.

Don't proceed. I would go back and do any sanity checks in chapter 5. Particularly what changes in chapter 6 is that /tools goes in at the end of the search paths, whereas previously it was in the beginning, IIRC. If your compiler in ch 5 is good, it should pass here. Typos?? Copy and paste if possible.

So in chapter 5, /tools (your new stuff) was used if it was there, otherwise the host system was used. Now you're heading up to the chroot, where the host system becomes invisible, and you want to use /tools only if the main system isn't built yet. So, for instance, a new gcc is built, and that gcc is used to build a second more comprehensive gcc.
 
1 members found this post helpful.
Old 02-18-2019, 06:04 AM   #3
parotta36
Member
 
Registered: Dec 2017
Location: Madurai
Distribution: Linux Mint | Slackware
Posts: 58

Original Poster
Rep: Reputation: Disabled
I am, copy pasting every command.

This is the first time, there was a different output
 
Old 02-18-2019, 09:08 AM   #4
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 9,929

Rep: Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077
Recheck chapter 5 gcc checks and the kernel headers
 
1 members found this post helpful.
Old 02-18-2019, 11:52 AM   #5
parotta36
Member
 
Registered: Dec 2017
Location: Madurai
Distribution: Linux Mint | Slackware
Posts: 58

Original Poster
Rep: Reputation: Disabled
There is only one check in ch 5 gcc(2nd pass),
Code:
echo 'int main(){}' > dummy.c
cc dummy.c
readelf -l a.out | grep ': /tools'
No output.

And the equivalent of this in ch6 works well.
 
Old 02-18-2019, 12:24 PM   #6
parotta36
Member
 
Registered: Dec 2017
Location: Madurai
Distribution: Linux Mint | Slackware
Posts: 58

Original Poster
Rep: Reputation: Disabled
There is only one check in ch 5 gcc(2nd pass),
Code:
echo 'int main(){}' > dummy.c
cc dummy.c
readelf -l a.out | grep ': /tools'
No output.

And the equivalent of this in ch6 works well.
 
Old 02-18-2019, 02:32 PM   #7
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 9,929

Rep: Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077
Sorry, I've been wasting your time. I misread your initial post - I thought you gave me a page number, but you did not, did you? Always quote the exact stage with a LFS query. For example, gcc is built in stage 6:21

Where exactly is this bit:
Code:
(lfs chroot) root:/sources/gcc-8.2.0/build# grep -B4 '^ /usr/include' dummy.log
Have you built gcc in chapter 6?
 
1 members found this post helpful.
Old 02-19-2019, 09:52 AM   #8
parotta36
Member
 
Registered: Dec 2017
Location: Madurai
Distribution: Linux Mint | Slackware
Posts: 58

Original Poster
Rep: Reputation: Disabled
Spelling mistake LOL, I meant 6.21.

I finished building GCC.

Code:
grep -B4 '^ /usr/include' dummy.log
is the 9th box after the Note box.
 
Old 02-19-2019, 01:41 PM   #9
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 9,929

Rep: Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077
LFS is always a string of defeats followed by silence and one uncertain victory 'Did I really do it right?'.

This, sadly, is a defeat. This gcc should not see /tools at all. Not in the executables $PATH, the includes path, or the library path. Because now we don't use /tools, we use the shiny new LFS system. You shoulkd be showing the system includes. That looks like a fault elsewhere, in binutils, or glibc or toolchain readjustments.

You have installed. I would try 'make uninstall' in case that works. Then I would
0. Check the errata for something on this.
1. Go to the top of page, rm -rf on the archive, untar afresh, and repeat.
2. Go back to chapter 6:1 and page through. Repeat the checks and double check the toolchain readjustments
3. Decide whether you restart ch 5 or ch 6
 
1 members found this post helpful.
Old 02-20-2019, 12:32 AM   #10
parotta36
Member
 
Registered: Dec 2017
Location: Madurai
Distribution: Linux Mint | Slackware
Posts: 58

Original Poster
Rep: Reputation: Disabled
Damn.
Okay, I'll check it. Thanks!
 
  


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
Error during Sanity Check after Installing GCC to Final System elephantus Linux From Scratch 3 08-17-2014 11:16 PM
[SOLVED] GCC make error - lib/cpp fails sanity check n1k0 Linux From Scratch 4 11-16-2011 01:56 PM
GCC fails to compile - Chapter 6.14 - C preprocessor "/lib/cpp" fails sanity check jaydoc Linux From Scratch 1 01-28-2009 05:17 PM
gcc installation error fails sanity check pgb205 Linux - Software 1 11-09-2007 08:04 PM
Solved Problem Second GCC-Pass(or gettext sanity check problem) hoes Linux From Scratch 0 09-04-2005 10:20 AM

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

All times are GMT -5. The time now is 05:09 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration