4.6.1-RC1: Using LTO in canadian cross

Georg-Johann Lay avr@gjlay.de
Thu Jun 23 13:53:00 GMT 2011


Tryint to use LTO with a canadian cross gcc I get the following error 
message:

e:/winavr/4.6.1/bin/../lib/gcc/avr/4.6.1/../../../../avr/bin/ld.exe: 
unrecognized option '-plugin'

It's binutils 2.21 configured

Configured with: ../../source/binutils-2.21/configure --target=avr 
--prefix=/local/gnu/install/gcc-4.6-mingw32 --host=i586-mingw32 
--build=i686-linux-gnu

So maybe I misconfigured binutils? There is
   http://sourceware.org/PR12742
that addresses similar issue with binutils 2.20 without a hint. Is LTO 
supported in binutild 2.21 out of the box?

As canadian cross I used gcc from 4.6-branch (SVN 175201) configured 
with same --prefix, --host, --target and --build:

e:/WinAVR/4.6.1/bin/avr-gcc -mmcu=atmega168 -flto -Wl,-Map,morpheus.map 
-Wl,--cref -v -Wl,-v -o morpheus.elf frac8-asm.o parith-16-asm.o 
int-to-string.o sound.o text.o textmenu.o uhr.o menu.o main.o 
asteroids.o parith-16.o snake.o snake-onpixel.o snake-data.o testbild.o 
schoner.o dcf-oszi.o vektor-zeichen-data.o vektor-zeichen.o bresenham.o 
dac.o frame.o morse.o time.o mem-check.o uart.o rc5-pd.o countdown.o 
dcf77.o frac8.o
Using built-in specs.
COLLECT_GCC=e:/WinAVR/4.6.1/bin/avr-gcc
COLLECT_LTO_WRAPPER=e:/winavr/4.6.1/bin/../libexec/gcc/avr/4.6.1/lto-wrapper.exe
Target: avr
Configured with: ../../gcc.gnu.org/gcc-4_6-branch/configure --target=avr 
--prefix=/local/gnu/install/gcc-4.6-mingw32 --host=i586-mingw32 
--build=i686-linux-gnu --enable-languages=c,c++ --disable-nls 
--disable-shared --with-dwarf2
Thread model: single
gcc version 4.6.1 20110620 (prerelease) (GCC)
COMPILER_PATH=e:/winavr/4.6.1/bin/../libexec/gcc/avr/4.6.1/;e:/winavr/4.6.1/bin/../libexec/gcc/;e:/winavr/4.6.1/bin/../lib/gcc/avr/4.6.1/../../../../avr/bin/
LIBRARY_PATH=e:/winavr/4.6.1/bin/../lib/gcc/avr/4.6.1/avr5/;e:/winavr/4.6.1/bin/../lib/gcc/avr/4.6.1/../../../../avr/lib/avr5/;e:/winavr/4.6.1/bin/../lib/gcc/avr/4.6.1/;e:/winavr/4.6.1/bin/../lib/gcc/;e:/winavr/4.6.1/bin/../lib/gcc/avr/4.6.1/../../../../avr/lib/
COLLECT_GCC_OPTIONS='-mmcu=atmega168' '-flto' '-v' '-o' 'morpheus.elf'
  e:/winavr/4.6.1/bin/../libexec/gcc/avr/4.6.1/collect2.exe -plugin 
e:/winavr/4.6.1/bin/../libexec/gcc/avr/4.6.1/liblto_plugin-0.dll 
-plugin-opt=e:/winavr/4.6.1/bin/../libexec/gcc/avr/4.6.1/lto-wrapper.exe 
-plugin-opt=-fresolution=c:\Temp\cc0oaaaa.res 
-plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc 
-plugin-opt=-pass-through=-lgcc -flto -m avr5 -Tdata 0x800100 -o 
morpheus.elf 
e:/winavr/4.6.1/bin/../lib/gcc/avr/4.6.1/../../../../avr/lib/avr5/crtm168.o 
-Le:/winavr/4.6.1/bin/../lib/gcc/avr/4.6.1/avr5 
-Le:/winavr/4.6.1/bin/../lib/gcc/avr/4.6.1/../../../../avr/lib/avr5 
-Le:/winavr/4.6.1/bin/../lib/gcc/avr/4.6.1 
-Le:/winavr/4.6.1/bin/../lib/gcc 
-Le:/winavr/4.6.1/bin/../lib/gcc/avr/4.6.1/../../../../avr/lib -Map 
morpheus.map --cref -v frac8-asm.o parith-16-asm.o int-to-string.o 
sound.o text.o textmenu.o uhr.o menu.o main.o asteroids.o parith-16.o 
snake.o snake-onpixel.o snake-data.o testbild.o schoner.o dcf-oszi.o 
vektor-zeichen-data.o vektor-zeichen.o bresenham.o dac.o frame.o morse.o 
time.o mem-check.o uart.o rc5-pd.o countdown.o dcf77.o frac8.o -lgcc -lc 
-lgcc
collect2 version 4.6.1 20110620 (prerelease) (GNU assembler syntax)
e:/winavr/4.6.1/bin/../lib/gcc/avr/4.6.1/../../../../avr/bin/ld.exe 
-plugin e:/winavr/4.6.1/bin/../libexec/gcc/avr/4.6.1/liblto_plugin-0.dll 
-plugin-opt=e:/winavr/4.6.1/bin/../libexec/gcc/avr/4.6.1/lto-wrapper.exe 
-plugin-opt=-fresolution=c:\Temp\cc0oaaaa.res 
-plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc 
-plugin-opt=-pass-through=-lgcc -m avr5 -Tdata 0x800100 -o morpheus.elf 
e:/winavr/4.6.1/bin/../lib/gcc/avr/4.6.1/../../../../avr/lib/avr5/crtm168.o 
-Le:/winavr/4.6.1/bin/../lib/gcc/avr/4.6.1/avr5 
-Le:/winavr/4.6.1/bin/../lib/gcc/avr/4.6.1/../../../../avr/lib/avr5 
-Le:/winavr/4.6.1/bin/../lib/gcc/avr/4.6.1 
-Le:/winavr/4.6.1/bin/../lib/gcc 
-Le:/winavr/4.6.1/bin/../lib/gcc/avr/4.6.1/../../../../avr/lib -Map 
morpheus.map --cref -v frac8-asm.o parith-16-asm.o int-to-string.o 
sound.o text.o textmenu.o uhr.o menu.o main.o asteroids.o parith-16.o 
snake.o snake-onpixel.o snake-data.o testbild.o schoner.o dcf-oszi.o 
vektor-zeichen-data.o vektor-zeichen.o bresenham.o dac.o frame.o morse.o 
time.o mem-check.o uart.o rc5-pd.o countdown.o dcf77.o frac8.o -lgcc -lc 
-lgcc
e:/winavr/4.6.1/bin/../lib/gcc/avr/4.6.1/../../../../avr/bin/ld.exe: 
unrecognized option '-plugin'
e:/winavr/4.6.1/bin/../lib/gcc/avr/4.6.1/../../../../avr/bin/ld.exe: use 
the --help option for usage information
collect2: ld returned 1 exit status
make: *** [morpheus.elf] Error 1


The gcc source tree does not contain libelf;
    http://gcc.gnu.org/install/prerequisites.html
do no more mention libelf. However, that site is for current upcombing 
gcc 4.7 and I could not find a similar site for older releases of gcc.

Also I could not find 4.6 prerequesties in 4.6 Internals. Is there a 
site like http://gcc.gnu.org/install for older/antique versions of GCC?

Building 4.6 ordinary cross still works with libelf-0.8.12, but canadian 
cross build crash because some Solaris code is entered during libelf build.

In the ChangeLogs I found that support for libelf has been removed, so I 
guess it's simply not needed any more?

Is LTO supposed to work on MinGW or do I need explicit --enable-lto?

Yet another question: The above run generated temorary file names like 
c:\Temp\cc0oaaaa.res which is a bit annoying when comparing testsuite 
.log files.  Is thare a way so that different rund generate same file 
name(s)?

Then I read somewhere that LTO does not work together with -g. Is that 
still true for 4.6/4.7 or did I ran in some documentation-rot?

Thanks for your patience.

Johann



More information about the Gcc-help mailing list