what's the name of ubuntu package contains llvm linker lld
Since January 2017, the LLVM apt repository includes lld, as do the snapshot packages available in Debian (starting with 4.0 in unstable, 5.0 in experimental). Since version 5, lld
packages are available in Debian (lld-5.0
in stretch-backports
, lld-6.0
in stretch-backports
and Debian 10, lld-7
in Debian 9 and 10, lld-8
in buster-backports
, and later packages in releases currently in preparation).
To install the upstream packages on Debian or Ubuntu, follow the instructions for your distribution.
Back in February 2015 when this answer was originally written, the LLVM apt repository stated that it included LLVM, Clang, compiler-rt, polly and LLDB. lld wasn't included. Even the latest snapshot packages in Debian (which are maintained by the same team as the LLVM packages) didn't include lld.
By the sounds of it, lld has not matched the maturity of Clang/LLVM yet, so it isn't included in the main packages.
There is some confusion around the linkers in LLVM (I was quite confused myself). The rest of this answer (while not directly answering the original question) helps clear up the confusion to define what it is we are talking about! There are three that could be called linkers:
- llvm-ld - this sounds like it was both a linker for LLVM bitfiles and executable binary object files. However, the answer here (and provided links) suggest that lld was removed back in LLVM 3.2. At that point, there was no substitute linker, and the system ld linker would have to be used.
- llvm-link - this is the current linker for LLVM bitfiles.
- lld - this sounds like an actively developed replacement for ld that only links executable binary object files. This answer here suggests it was in active development in May 2014. It is listed in the main LLVM list of projects as #13. I'm guessing it can only get better over time, and mature to a point where it is viable to include in the main LLVM package as a replacement for GNU ld / gold.