[cfe-dev] Bug with -O4

Daniel Dunbar daniel at zuster.org
Sat May 2 16:35:06 PDT 2009


On Wed, Apr 29, 2009 at 1:19 PM, Matthieu CASTET <castet.matthieu at free.fr>wrote:

> Chris Lattner <clattner at ...> writes:
>
> >
> > What OS are you developing on?  If you're on the mac, or if you use
> > the new Binutils "gold" linker for linux, you might have a solution.
> > Otherwise, the fix is "don't do that".
> >
>
> Why llvm-ld isn't enough ?


For many uses, it would be...


>
> After some basic test caaling llvm-ld (instead of gcc) with the
> transformation
> (sed -e "s/-Wl,/-Xlinker=/g" -e "s/-l/-l=/g") seems to produce working
> output.
>
> Why clang can't be a wrapper around llvm-ld ?


Primarily because no one has written the code yet. Its also worth pointing
out that llvm-ld by itself isn't enough to emulate the features of full LTO
support, for example on Darwin one can mix Mach-O objects and LLVM bit-code
files with ar, ld, etc. and things should just work. Using llvm-ld would
handle some cases, but not all.

The right long term solution is to find a way to get real LTO support on
other platforms, this work is progressing but I have no idea what kind of
time frame to expect. In the short term adding llvm-ld support in the clang
driver would at least allow some very useful things to work (like passing
clang with -emit-llvm to configure, currently this will normally fail
because clang with -emit-llvm can't generate the test executables).

If you would like to see this work, please file a bug with test cases you
care about. And or a patch! :)

 - Daniel


> Matthieu
>
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20090502/1f98931b/attachment.html>


More information about the cfe-dev mailing list