Questions tagged [lld]

lld is the linker from LLVM.

lld is the linker from the LLVM project. It is modular, fast and compatible with existing linker options.

109 questions
2
votes
1 answer

Problem with OMNeT++ installation on Ubuntu: How to resolve 'Standard C math library -lm not found' error during ./configure?

I have a problem with the installation of OMNeT++ on Ubuntu. The error occurs during the ./configurecommand and relates to the math library: configure: error: Standard C math library -lm not found. I have installed all the necessary packages (e.g.,…
2
votes
1 answer

Error linking .o file to .wasm with wasm-ld

I've been trying to convert a cpp file to wasm without emscripten recently and I've been running with some errors, for example, when I run these commands: clang++ --target=wasm32 -nostdlib -O3 -o public/main.o -c src/*.cpp wasm-ld --no-entry…
2
votes
1 answer

mold and lld not linking against libc correctly

I've been writing some x64 assembly on linux - exactly what it is is not relevant - and I've come across a strange problem. In my assembly code, I've declared printf as an external label, and call it using the x64 Linux C Calling Convention. The…
nekodjin
  • 132
  • 5
2
votes
1 answer

How to use WebAssembly Reference Types with Clang

I'm writing a WebAssembly application in C using Clang and LLD. How do I write a C function that takes an externref as a parameter and how do I call this function from JavaScript? How do I use the externref value in C to call an imported function…
eyelash
  • 3,197
  • 25
  • 33
2
votes
0 answers

How to use rpath with LLD linker (LLVM)

I recently managed to use the lld linker in a big cmake project. (LLVM 11, from this package) I do not use clang, I use G++ with LLD. But I encounter the following issue: lld: error: unknown argument: -rpath Following the clang documentation, -rpath…
Soporythmique
  • 53
  • 1
  • 4
2
votes
0 answers

`cargo` uses `x86_64-w64-mingw32-ld` even if `linker=lld-link` is specified

I'm trying to build a UEFI binary in stable Rust, so I don't use the x86_64-unknown-uefi target as it requires the Nightly toolchain. To do so, I created .cargo/config.toml: [build] target =…
toku-sa-n
  • 798
  • 1
  • 8
  • 27
2
votes
1 answer

Clang 10 link error with boost-thread on Ubuntu 20.04

After upgrading from Ubuntu 18.04 with clang/lld 7 and boost 1.65 to 20.04 with clang/lld 10 and boost 1.71, I have encountered a linker errors that I don't know how to address. Is clang & boost on Ubuntu 20.04 known to be an incompatible pair? What…
2
votes
1 answer

Remove a section from ELF during linking stage

How can I remove a section from ELF during linking stage? Is there any linker option or flag for this? I'm mostly interested on how it can be done with LLVM, but any information about GCC will be appreciated as well. Thanks!
user13863960
2
votes
0 answers

Adding symbols around a debug section causes binary to triple in size

I would like to add a start and end symbol around each debug info section so that I can access them from my program. I tried the following scheme: .debug.info ALIGN(4K) : { DEBUG_INFO_START = .; *(.debug.info) DEBUG_INFO_END =…
SamTebbs33
  • 5,507
  • 3
  • 22
  • 44
2
votes
1 answer

Checking LLVM LTO & ThinLTO optimizations?

Normally, after compiler optimizations we get textual LLVM IR, so that we can compare the IR's before and after optimizations and reason about. In LTO, we usually input IR bitcode files to the linker (lld) and get native object files. Is there any…
PreeJackie
  • 587
  • 4
  • 14
2
votes
0 answers

Does ld.lld linker work correctly on windows?

At first ld.lld seems to link successfully, but the executable crashes when executing a call instruction. I'm using clang 6.0.1 My program links and executes just fine using the gcc ld. Someone told me the driver is incomplete, is this true? Has…
SedatedSnail
  • 113
  • 7
2
votes
1 answer

How do I provide the shared library path for LLVM lld?

I am trying to use LLVM lld linker instead of the GNU ld linker that I was previously using. ld --version LLD 8.0.0 (compatible with GNU linkers) I have some shared libraries placed in /usr/local/lib. I had the path set in ld.so.conf for the GNU…
vaibhav kumar
  • 885
  • 1
  • 11
  • 13
2
votes
0 answers

Is there a way to disable a specific llvm lld warning?

I'm getting the following warning from llvm 6.0.0 lld while linking to the libiomp5.so which I'm getting pre-built from the llvm 6.0.0 ubuntu 14.04 download (here) warning: found local symbol '__kmp_gtid' in global part of symbol table in file…
David
  • 27,652
  • 18
  • 89
  • 138
2
votes
2 answers

how to link libstdc++ using llvm lld

I want to link test.ll and libstdc++.a in window OS. I have simple test IR code like this. @.str = internal constant [14 x i8] c"hello, world\0A\00" declare i32 @printf(i8*, ...) define i32 @main(i32 %argc, i8** %argv) nounwind { entry: %tmp1…
SilverJun
  • 23
  • 1
  • 4
2
votes
1 answer

Specify a minimum starting address for text segment

How can I tell lld to place code at or above a certain position? I have a legacy piece of code that relies on a rather questionable piece of logic: a certain function can receive a value that either represents an index into an array of function…
Alex Celeste
  • 12,824
  • 10
  • 46
  • 89