2023-02-20

Slitaz64 - echo 'int main(){}' | gcc -xc -


echo 'int main(){}' | gcc -xc -

> # echo 'int main() { return 0; }' > test.c

> # gcc -v -o test.o test.c

> See `config.log' for more details

1. config.log
$ grep -A10 int config.log

| int
| main ()
| {
|
| ;
| return 0;
| }
configure:3505: error: in `/home/slitaz/wok/xorg-xf86-video-amdgpu/source/xorg-xf86-video-amdgpu-22.0.0':
configure:3507: error: C compiler cannot create executables
See `config.log' for more details.

2. Installation of Glibc

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 'int main(){}' | gcc -xc -
readelf -l a.out | grep ld-linux

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: /lib64/ld-linux-x86-64.so.2]

Note that for 32-bit machines, the interpreter name will be /lib/ld-linux.so.2.

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.

Once all is well, clean up the test file:

rm -v a.out

https://www.linuxfromscratch.org/lfs/view/11.2/chapter05/glibc.html


https://forum.slitaz.org/topic/slitaz-future/page/18#post-51392