I have found similar issue https://stackoverflow.com/questions/15928925/lfs-7-2-glibc-2-16-0-make-error and tried to changechanging LD_LIBRARY_PATH accordingly. HoweverHowever, doing so rises weird segmantation errors, when calling ls, cat and other tools. Making LD_LIBRARY_PATH='' helps return things back.
> echo 'int main(){}' > dummy.c > LD_LIBRARY_PATH=/path/to/my/folder/tools/lib $LFS_TGT-gcc dummy.c Segmentation fault (core dumped) > readelf -l a.out | grep ': /path/to/my/folder/tools' readelf: a.out: Error: No such file Inspired by the similar issue https://stackoverflow.com/questions/15928925/lfs-7-2-glibc-2-16-0-make-error and tried to change LD_LIBRARY_PATH accordingly. It does not seem to work.
> echo 'int main(){}' > dummy.c > LD_LIBRARY_PATH=/path/to/my/folder/tools/libgcc/x86_64-lfs-linux-gnu/7.2.0 $LFS_TGT-gcc dummy.c /path/to/my/folder/tools/lib/gcc/x86_64-lfs-linux-gnu/8.2.0/../../../../x86_64-lfs-linux-gnu/bin/ld: cannot find crt1.o: No such file or directory /path/to/my/folder/tools/lib/gcc/x86_64-lfs-linux-gnu/8.2.0/../../../../x86_64-lfs-linux-gnu/bin/ld: cannot find crti.o: No such file or directory /path/to/my/folder/tools/lib/gcc/x86_64-lfs-linux-gnu/8.2.0/../../../../x86_64-lfs-linux-gnu/bin/ld: cannot find /path/to/my/folder/tools/lib/libc.so.6 inside /path/to/my/folder /path/to/my/folder/tools/lib/gcc/x86_64-lfs-linux-gnu/8.2.0/../../../../x86_64-lfs-linux-gnu/bin/ld: cannot find /path/to/my/folder/tools/lib/libc_nonshared.a inside /path/to/my/folder /path/to/my/folder/tools/lib/gcc/x86_64-lfs-linux-gnu/8.2.0/../../../../x86_64-lfs-linux-gnu/bin/ld: cannot find /path/to/my/folder/tools/lib/ld-linux-x86-64.so.2 inside /path/to/my/folder collect2: error: ld returned 1 exit status > readelf -l a.out | grep ': /path/to/my/folder/tools' readelf: a.out: Error: No such file Can you please give a suggestion, how to deal with this nasty ld problem. I know that it is not good to skip LFS steps. Unfortunately, I have no way to fix this, but I want to upgrade my local environment as much as possible. Thank you!
P.S. I duplicated this question to Stack Overflow as I urgently need help.