[cfe-commits] [patch] Switch to using ld directly on linux. Add -use-gold-plugin option

Rafael EspĂ­ndola rafael.espindola at gmail.com
Sun Oct 31 21:52:56 PDT 2010

The attached patch changes clang to use ld instead of gcc on linux. I
tested this on

* Debian Lenny Amd64
* Debian Lenny i386
* DebianSqueeze Amd64,
* DebianSqueeze i386,
* Debian Squeeze Arm,
* Fedora 13 X86_64,
* Fedora 13 i686,
* OpenSuse 11_3 X86_64,
* OpenSuse 11_3 i686,
* Ubuntu Lucid Amd64,
* Ubuntu Lucid i386,
* Ubuntu Maverick Amd64,
* Ubuntu Maverick i386,

The patch still needs some cleanup and refactoring, but there are some
points I would like to get some feedback already

*) How do you detect which distribution the host is? The current patch is ad hoc
*) I assumed it was better to do this check at runtime. This way I can
for example copy a binary to a chroot and it will work.
*) I could not find a way to detect if the distro is 32 or 64 bits at runtime
*) Part of the reason the patch is so big is because I forced the
clang invocation of ld to be *identical* to that done by gcc. If we
relax this a bit to allow the options to be in a different order the
patch gets a bit simpler. Any preferences?
*) I am dropping support for running gcc for linking. I can keep it
in, but would prefer to just add any other distro that someone might

-------------- next part --------------
A non-text attachment was scrubbed...
Name: link.patch
Type: text/x-patch
Size: 18247 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20101101/7eb10388/attachment.bin>

More information about the cfe-commits mailing list