I have successfully built clang and lld from source, and both are now available under my .../llvm-project/build/bin directory.
Following lld documentation, I am now trying to pass -fuse-ld=lld command line directive to clang to force it to use lld instead of system's default linker (which is GNU ld if I am not mistaken) as follows:
../llvm-project/build/bin/clang -fuse-ld=lld -c test.c
But I get this warning:
clang-16: warning: argument unused during compilation: '-fuse-ld=lld' [-Wunused-command-line-argument]
Which I suppose means lld was not used as the linker despite me asking for it.
What am I doing wrong?
I am on Ubuntu 22.04.1 LTS x86_64 and I am using clang version 16.0.0 and lld 16.0.0.