Linker for the Clan?

Which linker do I use for clang? If I use clang or ld as a linker, I get a huge amount of errors, as if I were not linking to the standard library.

g ++ $ (OBJS) -o $ (BINDIR) / obtap

It seems I need to use g ++ to bind my clang objects.

+13
c ++ linker g ++ clang
Oct 13 2018-10-10
source share
3 answers

I used "clang" instead of "clang ++", that is, it did not link the standard C ++ library.

+21
Dec 09 2018-11-12T00:
source share

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

+3
30 Oct 2018-10-10T00:
source share

Follow-up: now is 2016, and llvm has made some progress on its own linker. It is called "lld", and is located here. It works great to create i386 and x86_64 binaries, while work continues for other systems.

This should eliminate the dependency on GNU tools for BSD if it is considered stable enough.

+3
Jan 15 '16 at 16:00
source share



All Articles