Linker for Clang?

前端 未结 3 2017
醉话见心
醉话见心 2021-01-01 19:05

Which linker do I use for clang? If I use clang or ld as a linker, I get massive amounts of errors as if I didn\'t link with the standard library.

g++

相关标签:
3条回答
  • 2021-01-01 19:08

    You do not have to use llvm's link editor. I will avoid getting into the technical details, but, in short, you will need to have a typical UNIX link editor available to use Clang at this time (read: GNU ld or Sun ld). Even llvm-ld uses the underlying platform's linker to link native binaries.

    0 讨论(0)
  • 2021-01-01 19:15

    I was running 'clang' instead of 'clang++', meaning it didn't link the c++ standard library.

    0 讨论(0)
  • 2021-01-01 19:22

    Followup: it's now 2016, and llvm has made some steady progress on their own linker. It's called "lld", and the website is here. It works fine to create i386 and x86_64 binaries, while work is ongoing to target other systems.

    This should remove the dependency on GNU tools for BSDs, once it is considered stable enough.

    0 讨论(0)
提交回复
热议问题