Helllo,
On my WSL2 ubuntu 20.04 system, when I use the following command to invoke ld.lld, everything is OK:
clang -fuse-ld=/usr/local/bin/ld.lld ....
But when the option "--target=aarch64" is added, it will invoke gcc.
clang -fuse-ld=/usr/local/bin/ld.lld --target=aarch64
The actual command will be:
'/usr/bin/gcc' -fuse-ld=/usr/local/bin/ld.lld --target=aarch64
Note: when I run the below command, it shows:
simon@LAPTOP-JH2M71LG:~/musl-1.2.2$ clang -fuse-ld=/usr/local/bin/ld.lld --target=aarch64 -v obj/src/unistd/writev.lo
clang version 13.0.0
Target: aarch64
Thread model: posix
InstalledDir: /usr/local/bin
"/usr/bin/gcc" -fuse-ld=/usr/local/bin/ld.lld -o a.out obj/src/unistd/writev.lo
gcc: error: unrecognized command-line option ‘-fuse-ld=/usr/local/bin/ld.lld’
clang-13: error: linker (via gcc) command failed with exit code 1 (use -v to see invocation)
Note: At the same time I have link edthe ld to ld.lld by using following command:
sudo ln -fs /usr/local/bin/ld.lld /usr/bin/ld
Thanks,
Simon