LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   GCC main build ch 6.2 - Sanity check error - directories (https://www.linuxquestions.org/questions/linux-from-scratch-13/gcc-main-build-ch-6-2-sanity-check-error-directories-4175648502/)

parotta36 02-17-2019 12:57 PM

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");

business_kid 02-18-2019 05:39 AM

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.

parotta36 02-18-2019 06:04 AM

I am, copy pasting every command.

This is the first time, there was a different output

business_kid 02-18-2019 09:08 AM

Recheck chapter 5 gcc checks and the kernel headers

parotta36 02-18-2019 11:52 AM

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.

parotta36 02-18-2019 12:24 PM

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.

business_kid 02-18-2019 02:32 PM

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?

parotta36 02-19-2019 09:52 AM

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.

business_kid 02-19-2019 01:41 PM

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

parotta36 02-20-2019 12:32 AM

Damn.
Okay, I'll check it. Thanks!


All times are GMT -5. The time now is 10:30 AM.