Discussion:
configure error: linker with -z relro support required
Jeff Liu
2011-08-23 05:44:03 UTC
Permalink
Dear Developer,

I just tried to run `configure' against glibc git version, but it failed
with the following issue:

***@pibroch:~/gnu$ ./glibc/configure
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking for gcc... gcc
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
..........
.....
checking for .preinit_array/.init_array/.fini_array support... yes
checking whether to use .ctors/.dtors header and trailer... mawk: line
15: function strtonum never defined
mawk: line 15: function strtonum never defined
yes
checking for libunwind-support in compiler... no
checking for -z nodelete option... yes
checking for -z nodlopen option... yes
checking for -z initfirst option... yes
checking for -z relro option... no
configure: error: linker with -z relro support required

Actually, the `ld' in my binutils is definitely support this feature:
***@pibroch:~/gnu$ `which ld` --help|grep relro
-z norelro Don't create RELRO program header
-z relro Create RELRO program header
-z norelro Don't create RELRO program header
-z relro Create RELRO program header
-z norelro Don't create RELRO program header
-z relro Create RELRO program header

Any hint?

Thanks,
-Jeff
Jonathan Nieder
2011-08-23 05:46:14 UTC
Permalink
Hi Jeff,
Post by Jeff Liu
configure: error: linker with -z relro support required
See config.log. What ld are you using?
Jeff Liu
2011-08-23 06:01:02 UTC
Permalink
Hi Jonathan,

Thanks for your prompt response!
Post by Jonathan Nieder
Hi Jeff,
Post by Jeff Liu
configure: error: linker with -z relro support required
See config.log. What ld are you using?
looks it does not specified the absolute path for `ld', in this case,
IMHO, it means the '/usr/bin/ld'.
***@pibroch:~/gnu$ grep LD= config.log
ac_cv_prog_LD=ld
LD='ld'

more detail:
========
configure:2374: checking build system type
configure:2388: result: i686-pc-linux-gnu
configure:2408: checking host system type
configure:2421: result: i686-pc-linux-gnu
configure:2490: checking for gcc
configure:2506: found /usr/bin/gcc
configure:2517: result: gcc
configure:2746: checking for C compiler version
configure:2755: gcc --version >&5
gcc (Ubuntu/Linaro 4.5.2-8ubuntu4) 4.5.2
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:2766: $? = 0
configure:2755: gcc -v >&5
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5.2/lto-wrapper
Target: i686-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro
4.5.2-8ubuntu4' --with-bugurl=file:///usr/share/doc/gcc-4.5/README.Bugs
--enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr
--program-suffix=-4.5 --enable-shared --enable-multiarch
--with-multiarch-defaults=i386-linux-gnu --enable-linker-build-id
--with-system-zlib --libexecdir=/usr/lib/i386-linux-gnu
--without-included-gettext --enable-threads=posix
--with-gxx-include-dir=/usr/include/c++/4.5
--libdir=/usr/lib/i386-linux-gnu --enable-nls --with-sysroot=/
--enable-clocale=gnu --enable-libstdcxx-debug
--enable-libstdcxx-time=yes --enable-plugin --enable-gold
--enable-ld=default --with-plugin-ld=ld.gold --enable-objc-gc
--enable-targets=all --disable-werror --with-arch-32=i686
--with-tune=generic --enable-checking=release --build=i686-linux-gnu
--host=i686-linux-gnu --target=i686-linux-gnu


Thank you!
-Jeff
Jonathan Nieder
2011-08-23 06:10:25 UTC
Permalink
Post by Jonathan Nieder
See config.log. What ld are you using?
looks it does not specified the absolute path for `ld', in this case, IMHO,
it means the '/usr/bin/ld'.
I was referring to which _implementation_ of ld you use. It should be
possible to find out by running "ld --version" and seeing if it
mentions "GNU Binutils" or "gold". (The latter is not supported for
building eglibc yet iirc, though Roland was working on it.)
Jeff Liu
2011-08-23 06:13:44 UTC
Permalink
Post by Jonathan Nieder
Post by Jonathan Nieder
See config.log. What ld are you using?
looks it does not specified the absolute path for `ld', in this case, IMHO,
it means the '/usr/bin/ld'.
I was referring to which _implementation_ of ld you use. It should be
possible to find out by running "ld --version" and seeing if it
mentions "GNU Binutils" or "gold". (The latter is not supported for
building eglibc yet iirc, though Roland was working on it.)
"GNU Binutils" :)

***@pibroch:/btrfs$ ld --version
GNU ld (GNU Binutils for Ubuntu) 2.21.0.20110327
Copyright 2011 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later
version.
This program has absolutely no warranty.

Thanks,
-Jeff
Jonathan Nieder
2011-08-23 06:25:34 UTC
Permalink
Post by Jeff Liu
Post by Jonathan Nieder
I was referring to which _implementation_ of ld you use. It should be
possible to find out by running "ld --version" and seeing if it
mentions "GNU Binutils" or "gold". (The latter is not supported for
building eglibc yet iirc, though Roland was working on it.)
"GNU Binutils" :)
Ah, then it's Roland's fault.

Commit 9fa2c032 ("Adjust relro test to work around GNU ld limitations.")
might help. Sorry for the nonsense before --- I'm behind the times. :)
Jeff Liu
2011-08-23 06:31:50 UTC
Permalink
Post by Jonathan Nieder
Post by Jeff Liu
Post by Jonathan Nieder
I was referring to which _implementation_ of ld you use. It should be
possible to find out by running "ld --version" and seeing if it
mentions "GNU Binutils" or "gold". (The latter is not supported for
building eglibc yet iirc, though Roland was working on it.)
"GNU Binutils" :)
Ah, then it's Roland's fault.
Commit 9fa2c032 ("Adjust relro test to work around GNU ld limitations.")
might help. Sorry for the nonsense before --- I'm behind the times. :)
Its very nice of you to point me out that, I'll try until find out a
workable commit.

Thanks,
-Jeff
Carlos O'Donell
2011-08-23 11:02:00 UTC
Permalink
Post by Jeff Liu
Any hint?
Use gawk. Unless things have been fixed in the last 10 years glibc's
configure didn't work with mawk. YMMV.

Cheers,
Carlos.
Jeff Liu
2011-08-23 11:58:44 UTC
Permalink
Post by Carlos O'Donell
Post by Jeff Liu
Any hint?
Use gawk. Unless things have been fixed in the last 10 years glibc's
configure didn't work with mawk. YMMV.
Thanks for pointing this out, after replacing to gawk, everything is
fine. :)


Cheers,
-Jeff
Post by Carlos O'Donell
Cheers,
Carlos.
Jeff Liu
2011-08-23 12:53:52 UTC
Permalink
Oops!

unlucky, although configure procedure works fine for me, but make still
failed due to the following issue:

../sysdeps/i386/fpu/s_frexp.S: Assembler messages:
../sysdeps/i386/fpu/s_frexp.S:66: Error: invalid identifier for ".ifdef"
../sysdeps/i386/fpu/s_frexp.S:66: Error: junk at end of line, first
unrecognized character is `1'
../sysdeps/i386/fpu/s_frexp.S:66: Error: junk at end of line, first
unrecognized character is `1'
../sysdeps/i386/fpu/s_frexp.S:66: Error: Missing symbol name in directive
../sysdeps/i386/fpu/s_frexp.S:66: Error: junk at end of line, first
unrecognized character is `1'
../sysdeps/i386/fpu/s_frexp.S:66: Error: Missing symbol name in directive
../sysdeps/i386/fpu/s_frexp.S:66: Error: junk at end of line, first
unrecognized character is `.'
../sysdeps/i386/fpu/s_frexp.S:66: Error: junk at end of line, first
unrecognized character is `1'
../sysdeps/i386/fpu/s_frexp.S:66: Error: expected comma after name `' in
.size directive
../sysdeps/i386/fpu/s_frexp.S:66: Error: ".endif" without ".if"
../sysdeps/i386/fpu/s_frexp.S:66: Error: junk `.get_pc_thunk.dx' after
expression
make[2]: *** [/home/jeff/gnu/glibc/build/math/s_frexp.os] Error 1
make[2]: Leaving directory `/home/jeff/gnu/glibc/math'
make[1]: *** [math/subdir_lib] Error 2
make[1]: Leaving directory `/home/jeff/gnu/glibc'
make: *** [all] Error 2

Am I missing something here? Any more compile env I need to post?


Thanks,
-Jeff
Post by Jeff Liu
Post by Carlos O'Donell
Post by Jeff Liu
Any hint?
Use gawk. Unless things have been fixed in the last 10 years glibc's
configure didn't work with mawk. YMMV.
Thanks for pointing this out, after replacing to gawk, everything is
fine. :)
Cheers,
-Jeff
Post by Carlos O'Donell
Cheers,
Carlos.
Carlos O'Donell
2011-08-23 12:57:54 UTC
Permalink
Post by Jeff Liu
Oops!
../sysdeps/i386/fpu/s_frexp.S:66: Error: invalid identifier for ".ifdef"
../sysdeps/i386/fpu/s_frexp.S:66: Error: junk at end of line, first unrecognized character is `1'
../sysdeps/i386/fpu/s_frexp.S:66: Error: junk at end of line, first unrecognized character is `1'
../sysdeps/i386/fpu/s_frexp.S:66: Error: Missing symbol name in directive
../sysdeps/i386/fpu/s_frexp.S:66: Error: junk at end of line, first unrecognized character is `1'
../sysdeps/i386/fpu/s_frexp.S:66: Error: Missing symbol name in directive
../sysdeps/i386/fpu/s_frexp.S:66: Error: junk at end of line, first unrecognized character is `.'
../sysdeps/i386/fpu/s_frexp.S:66: Error: junk at end of line, first unrecognized character is `1'
../sysdeps/i386/fpu/s_frexp.S:66: Error: expected comma after name `' in .size directive
../sysdeps/i386/fpu/s_frexp.S:66: Error: ".endif" without ".if"
../sysdeps/i386/fpu/s_frexp.S:66: Error: junk `.get_pc_thunk.dx' after expression
make[2]: *** [/home/jeff/gnu/glibc/build/math/s_frexp.os] Error 1
make[2]: Leaving directory `/home/jeff/gnu/glibc/math'
make[1]: *** [math/subdir_lib] Error 2
make[1]: Leaving directory `/home/jeff/gnu/glibc'
make: *** [all] Error 2
Am I missing something here? Any more compile env I need to post?
Yes, this is the now classic i686 compiler define problem.

You need patches similar to this:
http://sourceware.org/ml/libc-alpha/2006-04/msg00090.html

Or stop using --with-arch.

Cheers,
Carlos.
Jeff Liu
2011-08-23 13:17:44 UTC
Permalink
Post by Carlos O'Donell
Post by Jeff Liu
Oops!
../sysdeps/i386/fpu/s_frexp.S:66: Error: invalid identifier for ".ifdef"
../sysdeps/i386/fpu/s_frexp.S:66: Error: junk at end of line, first unrecognized character is `1'
../sysdeps/i386/fpu/s_frexp.S:66: Error: junk at end of line, first unrecognized character is `1'
../sysdeps/i386/fpu/s_frexp.S:66: Error: Missing symbol name in directive
../sysdeps/i386/fpu/s_frexp.S:66: Error: junk at end of line, first unrecognized character is `1'
../sysdeps/i386/fpu/s_frexp.S:66: Error: Missing symbol name in directive
../sysdeps/i386/fpu/s_frexp.S:66: Error: junk at end of line, first unrecognized character is `.'
../sysdeps/i386/fpu/s_frexp.S:66: Error: junk at end of line, first unrecognized character is `1'
../sysdeps/i386/fpu/s_frexp.S:66: Error: expected comma after name `' in .size directive
../sysdeps/i386/fpu/s_frexp.S:66: Error: ".endif" without ".if"
../sysdeps/i386/fpu/s_frexp.S:66: Error: junk `.get_pc_thunk.dx' after expression
make[2]: *** [/home/jeff/gnu/glibc/build/math/s_frexp.os] Error 1
make[2]: Leaving directory `/home/jeff/gnu/glibc/math'
make[1]: *** [math/subdir_lib] Error 2
make[1]: Leaving directory `/home/jeff/gnu/glibc'
make: *** [all] Error 2
Am I missing something here? Any more compile env I need to post?
Yes, this is the now classic i686 compiler define problem.
http://sourceware.org/ml/libc-alpha/2006-04/msg00090.html
Thank you and Jonathan to help me out!

Cheers,
-Jeff
Post by Carlos O'Donell
Or stop using --with-arch.
Cheers,
Carlos.
Robert
2012-07-25 09:06:18 UTC
Permalink
Post by Jeff Liu
mawk: line 15: function strtonum never defined
checking for -z relro option... no
configure: error: linker with -z relro support required
Use gawk instead of mawk.

sudo apt-get install gawk
Works for me.

Loading...