what's the name of ubuntu package contains llvm linker lld
10
votes
3
answers
11951
views
Would like to try this [lld](http://lld.llvm.org/) from LLVM. The doc on apt could be found [here](http://llvm.org/apt/) , but I don't know which package contains the
lld
executable.
It seems the purpose of lld
is to remove the system dependency, but clang doesn't have lld
built-in. (Not yet?)
Using the following example to test if lld
is used. GNU-ld
places some constraint on the order of archive files appear, but lld
seems to be more tolerate on this (if I understand it correctly), so this example should build successfully, if lld
is used. However, it fails on my box.
# one.c
extern int two();
int main(int argc, char *argv[])
{
two();
return 0;
}
# two.c
void two(){}
$ clang -c two.c; ar cr two.a two.o ; clang -c one.c ; clang two.a one.o
one.o: In function `main':
one.c:(.text+0x19): undefined reference to `two'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
If we use -v
:
$ clang -c two.c; ar cr two.a two.o ; clang -c one.c ; clang -v two.a one.o
Ubuntu clang version 3.4-1ubuntu3 (tags/RELEASE_34/final) (based on LLVM 3.4)
Target: x86_64-pc-linux-gnu
Thread model: posix
Found candidate GCC installation: /usr/bin/../lib/gcc/i686-linux-gnu/4.9
Found candidate GCC installation: /usr/bin/../lib/gcc/i686-linux-gnu/4.9.0
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8.2
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.9
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.9.0
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.9.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8.2
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9.0
Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8
"/usr/bin/ld" -z relro --hash-style=gnu --build-id --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o a.out /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crt1.o /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crti.o /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/crtbegin.o -L/usr/bin/../lib/gcc/x86_64-linux-gnu/4.8 -L/usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu -L/lib/x86_64-linux-gnu -L/lib/../lib64 -L/usr/lib/x86_64-linux-gnu -L/usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../.. -L/lib -L/usr/lib two.a one.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/crtend.o /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crtn.o
one.o: In function `main':
one.c:(.text+0x19): undefined reference to `two'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
## ENV
Ubuntu clang version 3.4-1ubuntu3 (tags/RELEASE_34/final) (based on LLVM 3.4)
Target: x86_64-pc-linux-gnu
Thread model: posix
Asked by Albert Netymk
(203 rep)
Feb 10, 2015, 01:48 PM
Last activity: Oct 8, 2019, 11:13 AM
Last activity: Oct 8, 2019, 11:13 AM