Does llvm-ld still exist for clang 3.4?

The last time I checked clang, it was in version 3.1 / 3.2, now I have 64 bits under Ubuntu 13.04 and I installed clang and llvm (plus tools) from the official apt repository, but there is no trace of llvm-ld-3.4 , llvm-ld-3.0 and llvm-ld-3.1 are only 2 versions of this tool that are available on my machine, my question is: whit, what should I replace llvm-ld and create a library or executable?

+7
c ++ c linker llvm ld
source share
1 answer

llvm-ld no longer exists. From the LLVM 3.2 Release Note :

llvm-ld and llvm-stub have been removed, llvm-ld functionality can be partially replaced by llvm-link | opt | {llc | as, llc -filetype = obj} | ld or completely replaced by the Clan.

Or in a more convenient format:

  • Link all your .bc / .ll files to llvm-link to get one bit file.
  • Run opt to optimize the bitcode file
  • Creating an object file through one of
    • llc to get the asm file, then system assembler ( as ) to get the object file
    • llc -filetype=obj to get the object file (it just calls the system assembler on its own)
  • System Linker ( ld ) for linking your object files to all other necessary object files

Regarding the reason for its removal, check out this discussion of LLVM-dev .

Also, you might be interested in this related question: How do I link an object to libraries with LLVM> = 3.1? (no GNU ld)

+14
source share

All Articles