Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference b/w llvm-ld and llvm-link

What is the difference between llvm-ld and llvm-link? I suppose llvm-ld performs link time optimization while llvm-link doesn't. Am I right?

like image 688
pythonic Avatar asked Apr 09 '12 07:04

pythonic


1 Answers

llvm-ld is a drop-in replacement for the system linker that supports both LLVM bitcode and native code. It produces bitcode executables by default (ie the resulting executable invokes the bitcode interpreter), but can also be used to produced native executables.

I don't use llvm-ld directly as it's more convenient to use the llvmc and clang frontends, which invoke the appropriate programs of the LLVM toolchain as necessary (note: llvmc was marked experimental and appears to have been removed in the 3.0 release).

llvm-link is a more low-level tool which joins several bitcode files into a single one. The documentation doesn't mention if it does optimizations, but it doesn't appear to do so. The next optimization passes will be triggered on native code generation.

like image 108
Christoph Avatar answered Sep 25 '22 05:09

Christoph