On Fri, 2020-05-15 at 18:21 +0300, Firas Khalil Khana via lfs-dev wrote: > Hey there, > > I'd like to inquire about the actual need for the /toolchain symlink > on the host system. > > Apparently, failure to create this link causes > configure/build/linking > problems starting from Chapter's 5 libstdc++ with errors in the form > of failure to perform sanity checks (mostly because cpp's (gcc -E) > include paths are wrong), ld not finding crt1.o, crti.o, and so on... > > I'm not really sure why this link is required though. I understand > that it's currently a must to build LFS (apparently not much > explanation is provided to how GCC/Binutils searching/configuring > works with regards to directory layout,so we need to cover for > $LFS/tools and /tools with the latter being silently used in some > places to make the toolchain build; by silently I mean automatically > appended to $LFS without knowing when/where so it won't error out), > but wouldn't specifying correct flags when configuring GCC, binutils > and Glibc remove the need for such symlink? > > These errors can be evaded by closely examining > `--with-native-system-header-dir` and `--with-sysroot` starting from > GCC Pass 1 (along with modifying the "../lib64" t-linux64 sed command > to "../../lib" based on where ld is searching), along with > `--with-lib-path` in binutils pass 1. > > I'm curious to hear your thoughts on the matter. > > Thanks for your time and effort.
Chapter 5 is not the problem: we could change to $LFS/tools everywhere we have /tools. But then, when going to chapter 6, some search paths would contain $LFS/tools, that we do not have in chroot. That's the reason to have the link and use it in chapter 5. Note, we could maybe create /mnt/lfs in chroot, and have: /mnt/lfs/tools->/tools in chroot. Never tried. Pierre -- http://lists.linuxfromscratch.org/listinfo/lfs-dev FAQ: http://www.linuxfromscratch.org/faq/ Unsubscribe: See the above information page