0

I want to use the lld linker in my project.

I saw this Question but the solution didn't use apt-get.

I tried:

sudo apt-get install llvm
sudo apt-get install clang
sudo apt-get install clang-tools

Nothing worked.

I added to the Cmake -fuse-ld=lld:

set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++ -fuse-ld=lld")

I have a compilation error:

collect2: fatal error: cannot find 'ld'

Can't find lld:

lld --version
command not found: lld

Edit-1

I am using Ubuntu Ubuntu 18.04.6 LTS on arm architecture

Edit-2

It's not essential to the problem because Ubuntu 18.04 LTS has reached the end of its standard support life but for the sake of good order I will give full details:

arm64 architecture, universe repository is enabled

lior.i
  • 142
  • You've not provided any OS/release, though you do mention Ubuntu (but not product & release). The lld package is available I see for most releases/architectures (but not all), but as we don't know yours, we cannot provide much specifics. Have you tried a simple package install? for your unstated Ubuntu product/release/architecture? – guiverc Jul 06 '23 at 10:16
  • 1
    Does this answer your question? How do I enable the "Universe" repository? based on lld | 1:15.0-56~exp2 | lunar/universe | amd64, arm64, armhf, i386, ppc64el, riscv64 & lack of details provided by OP – guiverc Jul 06 '23 at 10:17
  • 2
    Ubuntu 18.04 LTS has reached the end of it's standard support life thus is now off-topic here unless your question is specific to helping you move to a fully supported release of Ubuntu. Ubuntu 18.04 ESM support is available, but not on-topic here, see https://askubuntu.com/help/on-topic See also https://ubuntu.com//blog/18-04-end-of-standard-support – guiverc Jul 06 '23 at 10:30
  • 1
    Its always helpful if you're specific with details; if you look back at the package details I provided of it existing for lunar you'll note its available for multiple ARM architectures... but you don't mention which only its ARM? Either way you're off-topic with this question given you're using an EOSS release, with only 20.04, 22.04, 22.10 & 23.04 now in standard Support & thus on-topic on this site. – guiverc Jul 06 '23 at 10:32
  • @guiverc, Thank you so much for the information, I was surprised to know that Ubuntu 18.04 LTS has reached the end of its standard support life so sadly I will have to wait with the lld linker until we will update our system, this is one more reason to do it. – lior.i Jul 10 '23 at 07:01
  • 1
    18.04 tells you it was the 2018-April release from the year.month format used for Ubuntu releases (2000 being subtracted from the year), thus adding 5 years of standard support isn't hard to work out in future. Warnings of the approaching EOSS also go out six weeks before EOSS (or EOL when its that) so watching for notices shouldn't be hard to detect either. – guiverc Jul 10 '23 at 07:09
  • ARM architecture isn't clear, as there are >8 ARM architectures in total, with Ubuntu providing support for two (armhf & arm64) for many releases; arm64 only for some also. Please be specific (armhf is the 6th (f) revision of 32-bit ARM*) – guiverc Jan 24 '24 at 00:06

1 Answers1

1

lld has its own package, not installed by default.

Install it with

sudo apt-get install lld
  • 2
    This answer is correct up to a point, but technically it's incorrect because the person who asked the question can't install lld because he's using an unsupported release. – karel Jan 23 '24 at 13:49