2009/8/15 VandeVondele Joost <vond...@pci.uzh.ch>: > > > I'd like to test lto on a project where objects first go through an archive, > and so wanted to follow http://gcc.gnu.org/wiki/LinkTimeOptimization > using 'gcc -use-linker-plugin' > However, I can't get this to work. > > gfortran -use-linker-plugin -flto main.f90 test.f90 > /data03/vondele/binutils-2.19.1/build/bin/ld: -plugin: unknown option > /data03/vondele/binutils-2.19.1/build/bin/ld: use the --help option for > usage information > collect2: ld returned 1 exit status > > /data03/vondele/binutils-2.19.1/build/bin/ld -v > GNU gold (GNU Binutils 2.19.1) 1.7 > > I guess this is some configure flag missing, does anybody have a clue?
Yes, you must build with --enable-gold --enable-plugins :-) > gcc configured as: > > /data03/vondele/gcc_lto/gcc/configure --prefix=/data03/vondele/gcc_lto/build > --with-libelf=/data03/vondele/libelf-0.8.10/build/ --enable-gold > --enable-languages=c,c++,fortran --disable-multilib -disable-bootstrap > > binutils as: > ./configure --prefix=/data03/vondele/binutils-2.19.1/build --enable-gold > > This is what collect2 sees: > /data03/vondele/gcc_lto/build/libexec/gcc/x86_64-unknown-linux-gnu/4.5.0/collect2 > -plugin > /data03/vondele/gcc_lto/build/libexec/gcc/x86_64-unknown-linux-gnu/4.5.0/liblto_plugin.so > -plugin-opt=/data03/vondele/gcc_lto/build/libexec/gcc/x86_64-unknown-linux-gnu/4.5.0/lto-wrapper > -plugin-opt=gfortran -plugin-opt=-flto -flto --eh-frame-hdr -m elf_x86_64 > -dynamic-linker /lib64/ld-linux-x86-64.so.2 -use-linker-plugin > /usr/lib/../lib64/crt1.o /usr/lib/../lib64/crti.o > /data03/vondele/gcc_lto/build/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/crtbegin.o > -L/data03/vondele/gcc_lto/build/lib/gcc/x86_64-unknown-linux-gnu/4.5.0 > -L/data03/vondele/gcc_lto/build/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/../../../../lib64 > -L/lib/../lib64 -L/usr/lib/../lib64 > -L/data03/vondele/gcc_lto/build/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/../../.. > /tmp/ccUQ7wr3.o /tmp/cczQrSMz.o -lgfortran -lm -lgcc_s -lgcc -lc -lgcc_s > -lgcc > /data03/vondele/gcc_lto/build/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/crtend.o > /usr/lib/../lib64/crtn.o > > Thanks, > > Joost > > Cheers, -- Rafael Avila de Espindola Google | Gordon House | Barrow Street | Dublin 4 | Ireland Registered in Dublin, Ireland | Registration Number: 368047