RE: g++: error: -fuse-linker-plugin is not supported in this configuration

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

From: Jonathan Wakely 
> On 18 April 2012 11:09, Hite, Christopher wrote:
> > I can't get the linker plugin to work.
> > g++: error: -fuse-linker-plugin is not supported in this configuration
> >
> > I build a userland binutils and gcc with dependencies.  I've tried gold and bfd.  Does anyone see anything obvoiusly wrong with this?

> You mean apart from the fact you're running ./configure to build GCC, despite all the documentation saying not to do that?
Sorry didn't notice this.

> Also, are you really sure you want to build gmp, mpfr and mpc separately and install them to non-standard locations?  You'll need to use ldconfig or set LD_LIBRARY_PATH in order to use the gcc executables. See for a simpler approach.
Yeah, I have to do this.  I'm not root.  I use separate prefixes so I can keep them separate.

> No.  Install binutils first, then install GCC to the *same* prefix.
The system gcc is so crappy it couldn't build binutils.  So I have to build gcc twice.

> GCC will automatically use the ld it finds in that location, and as it's a recent version of binutils it will detect that linker plugin support works.  If you don't want to install GCC and ld to the same prefix then you can configure GCC with --with-ld=$INSTALLATION/binutils-2.22/bin/ld (and optionally
--with-as=$INSTALLATION/binutils-2.22/bin/as) but you still need to install binutils first to do that (think about it: GCC depends on binutils, not the other way around, so install binutils first.)

This is what caused serious problems for me.  Why would your build system look at prefix for dependencies?  

It seems like the build ignores the ld I have in my path and uses the system one and decides there's no plugin support.
$which ld
but it ignores that one.

I was looking for a --with-ld.  It finally shows up in --help=recursive, but doesn't mention "linker" or anything I guess I was searching for. 

I killed a day or two building gcc repeatedly in the background.  

Two more dumb questions:
1) Should I / how do I tell do it to build the standard libs with -flto?

2) Does it make sense to combine this with -ffunction-sections, -fdata-sections plus --gc-sections?  Or does LTO make that redundant?

Anyway thanks a bunch!!!  I was about to give up.

I have a bunch of template recursion that gets reduced this way.  My binaries are up to 90% smaller!


[Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

Add to Google