Ketan Patil
Ketan Patil

Reputation: 89

LLVM: What changes need to be made in makefile to use llvm-link

I have source code of a project. I can create Makefile by running the command ./configure. Now if I want to change the compiler from gcc to clang, I can do this by CC=clang ./configure. Similarly if I want to use llvm-link as a linker, is there anything similar to this ? Otherwise what changes should I do in the makefile?

Upvotes: 1

Views: 976

Answers (1)

echristo
echristo

Reputation: 1727

llvm-link is a bitcode linker and not a full linker. For that you want lld. At that point you can pass -fuse-ld=lld to pick up lld as your linker in your link step. You can use LDFLAGS for this.

See lld's documentation for more information.

Upvotes: 2

Related Questions