bioinfornatics
bioinfornatics

Reputation: 1808

How use llvm linker?

LLVM provides 2 tools llvm-link and llvm-ld. I would like to know:

I would like do this in c++ but if show to me how do that from command line i will found how do to do in c++.

thanks

Upvotes: 9

Views: 16783

Answers (1)

Eli Bendersky
Eli Bendersky

Reputation: 273756

  • llvm-link is a tool for linking (~ merging) LLVM IR files into another LLVM IR file.
  • llvm-ld tries to be compatible to ld. Note that LLVM currently has no real linking capabilities, so llvm-ld calls gcc to do the actual final stages.

Note that if you just want to have GCC's functionality, use the clang driver:

clang -c file.c -fpic
clang -shared file.o -o file.so

You can also pass the -Wl flags to clang as you'd do for gcc:

clang -shared file.o -Wl,-soname,libfile.so.8 -o file.so

Upvotes: 12

Related Questions