Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LLVM compilation process and LLD

Tags:

llvm

clang

lld

I've been trying to make the switch to LLVM, since I'd like to get more into the whole 'software-dev' scene, and it seems like right now, LLVM is the future. I built LLVM/Clang/LLD/compiler-rt/libcxx from source several times now, both with GNU/GCC and LLVM/Clang.

The problem appears when I try to use the newly compiled compilers. From what I can see, clang is using GNU ld rather than LLVM's lld. Is this true?

LLD seems to be a very limited program from the lld -help output, but from what I have read, it is as full featured as ld. I cannot find documentation on how to use it anywhere -- does anyone know where I can find some kind of comprehensive manual on it?

Thank you.

like image 578
PyroAVR Avatar asked Jun 07 '26 20:06

PyroAVR


1 Answers

Pass -fuse-ld=lld to clang to make it use lld for linking. By now, it's in very good shape.

You can pass -v or -### to clang to make it print which linker command it runs or would run.

like image 108
thakis Avatar answered Jun 10 '26 11:06

thakis



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!