
Linux From Scratch - Version 7.0
49
Caution
At this point, it is imperative to stop and ensure that the basic functions (compiling and linking) of the new
toolchain are working as expected. To perform a sanity check, run the following commands:
echo 'main(){}' > dummy.c
cc dummy.c
readelf -l a.out | grep ': /tools'
If everything is working correctly, there should be no errors, and the output of the last command will be
of the form:
[Requesting program interpreter: /tools/lib/ld-linux.so.2]
Note that /tools/lib, or /tools/lib64 for 64-bit machines appears as the prefix of the dynamic
linker.
If the output is not shown as above or there was no output at all, then something is wrong. Investigate and
retrace the steps to find out where the problem is and correct it. This issue must be resolved before continuing
on. First, perform the sanity check again, using gcc instead of cc. If this works, then the /tools/bin/
cc symlink is missing. Install the symlink as per above. Next, ensure that the PATH is correct. This can
be checked by running echo $PATH and verifying that /tools/bin is at the head of the list. If the
PATH is wrong it could mean that you are not logged in as user lfs or that something went wrong back
in Section 4.4, “Setting Up the Environment.”
Once all is well, clean up the test files:
rm -v dummy.c a.out
Details on this package are located in Section 6.17.2, “Contents of GCC.”
Comentarios a estos manuales