glibc will not compile with -flto
John Frankish
j-frankish@slb.com
Sat Mar 30 06:10:00 GMT 2013
> 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
More information about the Gcc-help
mailing list