public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* lto and gold
@ 2009-08-15 15:56 VandeVondele Joost
  2009-08-16 14:08 ` Rafael Espindola
  0 siblings, 1 reply; 4+ messages in thread
From: VandeVondele Joost @ 2009-08-15 15:56 UTC (permalink / raw)
  To: gcc



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?

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: lto and gold
  2009-08-15 15:56 lto and gold VandeVondele Joost
@ 2009-08-16 14:08 ` Rafael Espindola
  2009-08-17  8:42   ` VandeVondele Joost
  0 siblings, 1 reply; 4+ messages in thread
From: Rafael Espindola @ 2009-08-16 14:08 UTC (permalink / raw)
  To: VandeVondele Joost; +Cc: gcc

2009/8/15 VandeVondele Joost <vondele@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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: lto and gold
  2009-08-16 14:08 ` Rafael Espindola
@ 2009-08-17  8:42   ` VandeVondele Joost
  2009-08-17 10:57     ` Rafael Espindola
  0 siblings, 1 reply; 4+ messages in thread
From: VandeVondele Joost @ 2009-08-17  8:42 UTC (permalink / raw)
  To: Rafael Espindola; +Cc: gcc, joost.vandevondele


>>
>> I guess this is some configure flag missing, does anybody have a clue?
>
> Yes, you must build with --enable-gold --enable-plugins :-)
>

Is that for gcc or for binutils (neither documents this in ./configure 
--help) ?

I used it for both, but only get this to work with binutils CVS, is that 
correct ?

Now, however, I get the following error:

gfortran -flto -use-linker-plugin main.f90 test1.f90 test2.f90
collect2: ld terminated with signal 6 [Aborted]
ld: /data03/vondele/gcc_lto/gcc/lto-plugin/lto-plugin.c:142: 
parse_table_entry: Assertion `t <= 4' failed.

with

==> main.f90 <==
CALL S1
CALL S2
END

==> test1.f90 <==
SUBROUTINE S1
END SUBROUTINE

==> test2.f90 <==
SUBROUTINE S2
END SUBROUTINE S2

and similar for C based sources.

Thanks,

Joost

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: lto and gold
  2009-08-17  8:42   ` VandeVondele Joost
@ 2009-08-17 10:57     ` Rafael Espindola
  0 siblings, 0 replies; 4+ messages in thread
From: Rafael Espindola @ 2009-08-17 10:57 UTC (permalink / raw)
  To: VandeVondele Joost; +Cc: gcc, joost.vandevondele

> Is that for gcc or for binutils (neither documents this in ./configure
> --help) ?

just binutils.

> I used it for both, but only get this to work with binutils CVS, is that
> correct ?

I don't know if there has been any release of binutils with plugin
support.  I use CVS.

> Now, however, I get the following error:
>
> gfortran -flto -use-linker-plugin main.f90 test1.f90 test2.f90
> collect2: ld terminated with signal 6 [Aborted]
> ld: /data03/vondele/gcc_lto/gcc/lto-plugin/lto-plugin.c:142:
> parse_table_entry: Assertion `t <= 4' failed.

The IL symbol table code probably got  bit bit rotten.  The gcc plugin
is not schedule to merge during this stage1.

>
> Thanks,
>
> Joost
>


Cheers,
-- 
Rafael Avila de Espindola

Google | Gordon House | Barrow Street | Dublin 4 | Ireland
Registered in Dublin, Ireland | Registration Number: 368047

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-08-17  9:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-15 15:56 lto and gold VandeVondele Joost
2009-08-16 14:08 ` Rafael Espindola
2009-08-17  8:42   ` VandeVondele Joost
2009-08-17 10:57     ` Rafael Espindola

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).