This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
RE: glibc will not compile with -flto
- From: John Frankish <j-frankish at slb dot com>
- To: "gcc-help at gcc dot gnu dot org" <gcc-help at gcc dot gnu dot org>
- Cc: Ian Lance Taylor <iant at google dot com>
- Date: Sat, 30 Mar 2013 06:10:08 +0000
- Subject: RE: glibc will not compile with -flto
- References: <E1B828866A01174CB7A0393CF2309BCC3E35C8C8 at NL0230MBX12N1 dot DIR dot slb dot com> <CAKOQZ8wMktGNrL=YVCdj218BFoMd9jaFXfugbqfgcq6jNjupqQ at mail dot gmail dot com>
> On Fri, Mar 29, 2013 at 3:35 AM, John Frankish <j-frankish@slb.com> wrote:
> > Using binutils-2.23.1 and gcc-4.7.2, both compiled with "--enable-lto"
> > to compile glibc-2.17
> >
> > Removing "-flto -fuse-linker-plugin" removes the error below, but how do I
> > compile glibc with -flto?
> >
> > John
> > ----------
> > CC="gcc -flto -fuse-linker-plugin -march=i486 -mtune=i686 -Os -pipe"
> > CXX="g++ -flto -fuse-linker-plugin -march=i486 -mtune=i686 -Os -pipe
> > -fno-exceptions -fno-rtti" ../glibc-2.17/configure --prefix=/usr
> > --disable-profile --enable-kernel=3.0.21 --libexecdir=/usr/lib/glibc
> > --cache-file=config.cache
> >
> > checking whether to put _rtld_local into .sdata section... no checking
> > for .preinit_array/.init_array/.fini_array support... no
> > configure: error: Need linker with .init_array/.fini_array support.
> >
> > Config.log:
> > configure:6121: checking for .preinit_array/.init_array/.fini_array support
> > configure:6137: gcc -flto -fuse-linker-plugin -march=i486 -mtune=i686 -Os -
> > pipe -g -o conftest
> > conftest.c -static -nostartfiles -nostdlib
> > 1>&5
> > collect2: fatal error: cannot find 'ld'
>
> That's an odd error. Is the newly build binutils 2.23.1 installed in a bin
> directory that is on your PATH? Did you configure GCC and binutils with the
> same --prefix option?
>
Yes, the newly built binutils is in the PATH and binutils and gcc have the same "--prefix".
Note that when I remove "-flto -fuse-linker-plugin", the same config test passes and the same setup compiles without problems.
John