Linux LTO with lld from llvm 9

kinke kinke at
Fri Oct 4 09:54:44 UTC 2019

On Friday, 4 October 2019 at 03:06:19 UTC, Newbie2019 wrote:
> If I link without druntime, can I use lld from linux ?

Should work, independent from whether you link with or without 
druntime. If you have clang and lld installed, specify 
`-gcc=clang -linker=lld` in the LDC cmdline; when linking with 
clang directly, use `-fuse-ld=lld`.

> ld-new: fatal error: LLVM gold plugin has failed to create LTO 
> module: Unknown attribute kind (62) (Producer: 'LLVM9.0.0' 
> Reader: 'LLVM 8.0.1')
> clang-8: error: linker command failed with exit code 1 (use -v 
> to see invocation)

The problem here is that the produced bitcode is v9, but the gold 
plugin is from LLVM v8.0.1. LDC v1.18.0-beta2 features the v9 
gold plugin; it'll probably also work when updating your clang to 

More information about the digitalmars-d-ldc mailing list