ld: bad -plugin option

Georg-Johann Lay avr@gjlay.de
Thu Dec 1 09:41:00 GMT 2011


Hi, I am running into this error from ld since I removed --disable-lto from the
configure.  I used --disable-lto some time because of problems with LTO.

Anyways, I'd like to build with LTO again and get this really not-very-specific
error

/home/georg/install/gcc-4.7/lib/gcc/avr/4.7.0/../../../../avr/bin/ld: bad
-plugin option
collect2: error: ld returned 1 exit status


Notice that binutils are configured --enable-plugins and not --enable-plugin

Thanks to Ian for spotting that typo.


== C Source (main.c) ==

int main()
{
    return 0;
}

 == Command line ==

> /home/georg/install/gcc-4.7/bin/avr-gcc main.c -mmcu=atmega128 -flto -v
-save-temps -Wl,-v


== Message ==

/home/georg/install/gcc-4.7/lib/gcc/avr/4.7.0/../../../../avr/bin/ld: bad
-plugin option
collect2: error: ld returned 1 exit status

Complete message attached as text file.


== GCC (trunk 181838) configure ==

../../gcc.gnu.org/trunk/configure --target=avr
--prefix=/home/georg/install/gcc-4.7 --disable-nls --enable-languages=c,c++
--with-dwarf2 --enable-checking=yes,rtl --enable-lto

also tried

../../gcc.gnu.org/trunk/configure --target=avr
--prefix=/home/georg/install/gcc-4.7 --disable-nls --enable-languages=c,c++
--with-dwarf2 --enable-checking=yes,rtl


== binutils 2.21 configure ==

../../source/binutils-2.21/configure --target=avr
--prefix=/home/georg/install/gcc-4.7 --disable-nls --enable-lto --enable-plugins

also tried:

../../source/binutils-2.21/configure --target=avr
--prefix=/home/georg/install/gcc-4.7 --disable-nls



== Environment ==

Build: i686-pc-linux-gnu
Host: i686-pc-linux-gnu
Target: avr-unknown-none
GCC 4.3.2 [gcc-4_3-branch revision 141291]
GMP  4.3.2
MPFR 2.4.2
MPC  0.8.2


Does LTO need some more configure options? I also tried --enable-lto or
--enable-plugins with binutils with no effect.

Does LD_LIBRARY_PATH needs to be set?
What if there are several toolchain installations in PATH, to what value(s)?

Similarly, I get the error when running the test suite on xgcc in incubator in
its build-directory as called with
> $BUILD/gcc/xgcc -B$BUILD/gcc/

Johann



-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: out.txt
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20111201/47f9481f/attachment.txt>


More information about the Gcc-help mailing list