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: Ian Lance Taylor <iant at google dot com>
- To: John Frankish <j-frankish at slb dot com>
- Cc: "gcc-help at gcc dot gnu dot org" <gcc-help at gcc dot gnu dot org>
- Date: Fri, 29 Mar 2013 06:40:03 -0700
- Subject: Re: glibc will not compile with -flto
- References: <E1B828866A01174CB7A0393CF2309BCC3E35C8C8 at NL0230MBX12N1 dot DIR dot slb 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?
Ian