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
4
votes
1 answer

Unable to link C runtime library (libcmt.lib) using lld-link.exe (Windows)

I'm writing a language using LLVM. I'd like to avoid having to package clang and simply use the LLVM tools (ex. lld, lld-link). I've been trying to invoke the printf function from my simple IR code (testinput.ll): ; ModuleID =…
John Doe
  • 399
  • 1
  • 4
  • 23
4
votes
1 answer

Using llvm linker (lld) with mingw

I would like to have complete Win32 development toolchain without Microsoft SDKs. mingw64 works, but its linker is very slow. As an alternative, I am trying to use clang for windows. I can get clang 7.0.1 (but not 8.0.0) work with mingw…
Mirek Fidler
  • 330
  • 1
  • 9
4
votes
1 answer

How to debug an experimental toolchain producing malformed executables

I am working on cross compiling an experimental GNU free Linux toolchain using clang (instead of gcc), compiler-rt (instead of libgcc), libunwind (available at http://llvm.org/git/libunwind.git) (instead of libgcc_s), lld (instead of GNU ld), libcxx…
user964843
3
votes
1 answer

Does rust use lld linker as standard

I have started on the "zero to performance in rust" book. This discusses using the lld linker instead of the standard rust linker to speed up compile times. However, the book is now about a year old and it mentions that there is/was work in progress…
Pioneer_11
  • 670
  • 4
  • 19
3
votes
1 answer

LLVM linker places stack in the wrong place

I am trying to link Cortex-M4 firmware with clang + lld. The gcc build works fine. I am using the stock CMSIS linker script with only RAM & ROM size adjusted (bases are the same). Beginning of the script (without comments): __ROM_BASE =…
filo
  • 223
  • 3
  • 14
3
votes
0 answers

Linking simple C program using Clang + LLD (MSys2/MingW) generates wrong unwind table style (.eh_frame instead of.pdata)

So I am unable to find any information on the issue I am currently having. I am hoping someone here knows how to solve it. I am using Clang 11.0.0 to compile a very simple C program. I want it to generate a .pdata section which contains unwind…
Steffen Brem
  • 1,738
  • 18
  • 29
3
votes
1 answer

Why does `clang++ -fuse-ld=lld main.cpp` not work?

I installed clang-10 and lld-10, but I cannot use lld as the linker. messages: [root@mine ~]# ll /usr/local/bin/lld -rwxr-xr-x 1 root root 79005720 Mar 26 14:26 /usr/local/bin/lld [root@mine ~]# ll /usr/local/bin/ld.lld lrwxrwxrwx 1 root root 3 Mar…
xmllmx
  • 39,765
  • 26
  • 162
  • 323
3
votes
2 answers

Generate .map file with clang and lld

I use Qt, clang and lld. Is there any way to generate .map in my case? -Wl,-Map=output.map didn't work out for me. Thanks in advance
a_c
  • 61
  • 1
  • 7
3
votes
1 answer

How to build ELF on MacOS using LLVM?

I am trying to build ELF-file using LLVM (from Homebrew) but I can't get how to link it. My files: multiboot2.h: struct multiboot2_header_t { // Stub } multiboot2_header __attribute__((section(".multiboot"))); kernel.c: #include…
Denis Sologub
  • 7,277
  • 11
  • 56
  • 123
3
votes
1 answer

How do I declare a static variable in a specific memory region in Rust?

I have static constant that I want to place in a specific memory region of my MCU, and the program is written in Rust for an ARM stm32m4 MCU. In my test case I have defined the variable as such: #[link_section = ".device_info"] static DEVINFO:…
Kristoffer
  • 456
  • 5
  • 17
3
votes
1 answer

Disable relocations when linking with LLD

Is there an option for lld that will tell it not to perform relocations. I don't want PIC code, I just want relocations not to be performed. (Yes I know this will result in an executable that doesn't work.)
Timmmm
  • 88,195
  • 71
  • 364
  • 509
3
votes
1 answer

Command to check the 'linker' used(by clang++) for executable creation on Mac OS

I have an executable created using 'clang++' compiler(using mac os 10.9 sdk) on mac os. $ clang++ -v Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn) Target: x86_64-apple-darwin13.4.0 Thread model: posix $ ld -v @(#)PROGRAM:ld …
3
votes
1 answer

Emitting a single IR bitcode File with LLVM LLD using CMake

I'm using Ubuntu 16.04 x86_64 and LLVM 5.0 and would like to compile a project to a single LLVM IR bitcode file using CMake. I know there is a way to do this using the GOLD Linker with the LLVM Plugin and add the CMake linker flags "-fuse-ld=gold…
AndiH
  • 33
  • 4
3
votes
1 answer

How can I link files compiled with clang -flto using lld?

I am trying to use llvm-lld to link an object that has been compiled with -flto. I have the ld in the path call lld with all the arguments provided. I created a simple C++ program, which I compile with clang++: #include int main() { …
G Hatzsis
  • 31
  • 2
3
votes
0 answers

Android llvm linker

I heard the Android llvm toolchain use mclinker. But the llvm default linker is lld during its early development stage. Anyone know if it will use lld when lld is mature or plan to keep going with mclinker and enhance mclinker in future. Jonathan