Hide Forgot
Right now gold is built without plugin support. If there is no particular reason for disabling it, it would be really cool if gold could be built with plugin support in the future. It would make it a lot easier to use the LLVM gold plugin (http://llvm.org/docs/GoldPlugin.html) on Fedora, making LTO builds with LLVM/clang work almost out of the box. Thanks!
Try binutils-2.21.51.0.6-2.fc16, now with Gold plugins are enabled. :-) Cheers Nick
Thanks for the new build! I'm going to install rawhide in a VM and will give it a try :)
I gave the new build a try and I noticed two issues: nm and ar always said "sorry - this program has been built without plugin support" when I tried to use them with the --plugin LLVMgold.so option. Can you enable plugin support for them as well? ld.gold on the other hand worked fine when passed --plugin LLVMgold.so, successfully creating a native executable from several LLVM bitcode files :) In order to build LLVMgold.so I had to obtain the plugin-api.h header from gold which defines the public plugin interface. I fetched it from the binutils.src.rpm, but I would assume it should become part of binutils-devel since it's a public API? Thanks again! Regards, Tilmann
Hi Tilmann, binutils-2.21.51.0.8-2.fc16 should fix the problem. I have reverted my previous patch (which only enabled plugins for gold) and instead fixes the binutils.spec file to pass --enable-plugins to all of the tools that it builds, including gold, ld, nm and ar. Cheers Nick
Hi Nick, I just tested the new build, works great! I was able to successfully do an LTO build of clang with clang :) Is there a chance that we can still get this into Fedora 15? E.g. with an update? Regards, Tilmann
Hi Tilmann, > Is there a chance that we can still get this into Fedora 15? E.g. with an > update? Sorry - I think not. The sources are frozen except for blocker bug fixes and this is one of them. It is also possible, although unlikely, that this change would break the building of some other package. I don't think that this would happen, but I would rather not take the chance at this late stage of the release cycle. Once the f15 release is final I will happily check in an update to apply this functionality. Cheers Nick
Hi Nick, an update after the Fedora 15 release is perfectly fine :) Regards, Tilmann
Hi Tilmann, Now that F15 is out of the door, I have checked in the patch to enable plugins. Please try out binutils-2.21.51.0.6-3.fc15. Cheers Nick
I am unable to reproduce Tilmann's success from comment #5. Tilmann, perhaps you can give more details about your working recipe? Or perhaps this bug needs to be reopened? I'm using Fedora 17 with the standard clang-3.0, llvm-3.0, and plugin-enabled binutils-2.22.52.1 RPMs. I tried to compile a trivial "Hello, world!" program using clang, with intermediate objects generated as bitcode and link-time optimization at the end to produce the native code: % clang -flto -Wl,-plugin,/usr/lib/llvm/LLVMgold.so -o main main.c This fails, reporting "File format not recognized" for the intermediate object file. Saving that file with "-save-temps" confirms that it is LLVM bitcode, not native object code, as I expected thanks to the "-flto" flag. Using "-v" I can see that "/usr/bin/ld" is receiving the "-plugin /usr/lib/llvm/LLVMgold.so" arguments. I can even trace that with "strace" and confirm that the plugin is being loaded. And yet the file format is not recognized. Why not? Why is the plugin-boosted linker not dealing with this correctly?