Summary: | sys-devel/llvm should properly install binutils plugins for LTO to work | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Ambroz Bizjak <ambrop7> |
Component: | [OLD] Core system | Assignee: | Bernard Cafarelli <voyageur> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | mgorny, toolchain |
Priority: | Normal | Keywords: | EBUILD, PATCH |
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: | https://bugs.gentoo.org/show_bug.cgi?id=494228 | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | 477432 | ||
Bug Blocks: | |||
Attachments: | ebuild patch |
Description
Ambroz Bizjak
2012-06-19 17:01:52 UTC
Created attachment 315777 [details, diff]
ebuild patch
This patch to the ebuild adds code that creates the required symlinks. It does that in a simpler way than the instructions on the wiki say. In particular, instead of creating:
- symlink /usr/${CHOST}/binutils-bin/lib -> /usr/${CHOST}/lib
- symlink /usr/${CHOST}/lib/bfd-plugins -> /usr/$(get_libdir)/bfd-plugins
- directory /usr/$(get_libdir)/bfd-plugins
- symlinks in /usr/$(get_libdir)/bfd-plugins/ to plugins in /usr/$(get_libdir)/llbm/
it just creates:
- directory /usr/${CHOST}/binutils-bin/lib/bfd-plugins
- symlinks in /usr/${CHOST}/binutils-bin/lib/bfd-plugins/ to plugins in /usr/$(get_libdir)/llvm/
I've tested that this does in fact work, assuming that the instructions from the wiki have not been performed or have been undone.
Also, to make LTO work you need to build llvm with 'gold' use flag (and not anything else). It would probably be a good idea to make this more obvious somehow. That seems like a lot of symlinks to me, and I'm pretty certain I was able to get it running easier (by modifying the env). Toolchain, what do you think? Sorry, I think I mis-read you the first time. So let's update this... (In reply to comment #1) > it just creates: > > - directory /usr/${CHOST}/binutils-bin/lib/bfd-plugins > - symlinks in /usr/${CHOST}/binutils-bin/lib/bfd-plugins/ to plugins in > /usr/$(get_libdir)/llvm/ > > I've tested that this does in fact work, assuming that the instructions from > the wiki have not been performed or have been undone. I would be fine with that but I'd like toolchain to confirm it's the right thing to do. This should be fixed in -3.3-r1 and -9999. (In reply to Michał Górny from comment #4) i'm not terribly familiar with llvm internals, but this seems like the simplest hack if it works ... Well, nowadays clang should just put proper '--plugin' flags on the linker command-line. |