Closed takusuman closed 3 years ago
That is a good question.
I could not trace where I got that from... definitely from LFS... but latest book no longer has it and their build method changed.
I have yet to try a build with those 3 commands omitted
That is a good question.
I could not trace where I got that from... definitely from LFS... but latest book no longer has it and their build method changed.
I have yet to try a build with those 3 commands omitted
If i get an explanation for this, i will pull-request it for sure.
Apparently, it's from Chapter 5.7 of LFS 6.3?
During the build process, GCC runs a script (fixincludes) that scans the system for header files that may need to be fixed (they might contain syntax errors, for example), and installs the fixed versions in a private include directory. There is a possibility that, as a result of this process, some header files from the host system have found their way into GCC's private include directory. As the rest of this chapter only requires the headers from GCC and Glibc, which have both been installed at this point, any “fixed” headers can safely be removed. This helps to avoid any host headers polluting the build environment. Run the following commands to remove the header files in GCC's private include directory (you may find it easier to copy and paste these commands, rather than typing them by hand, due to their length):
GCC_INCLUDEDIR=`dirname $(gcc -print-libgcc-file-name)`/include && find ${GCC_INCLUDEDIR}/* -maxdepth 0 -xtype d -exec rm -rvf '{}' \; && rm -vf `grep -l "DO NOT EDIT THIS FILE" ${GCC_INCLUDEDIR}/*` && unset GCC_INCLUDEDIR
Which is strange because when LFS 6.3 was current, I wasnt even aware of Musl libc
During the build process, GCC runs a script (fixincludes) that scans the system for header files that may need to be fixed (they might contain syntax errors, for example), and installs the fixed versions in a private include directory. There is a possibility that, as a result of this process, some header files from the host system have found their way into GCC's private include directory.
That's a good point.
https://github.com/dslm4515/Musl-LFS/blob/988f2c6b9c763df812e9f878eff7161976324248/doc/2-toolchain/04-gcc#L111-L114 Link related.