gmp fails to configure when I pass --host
Bruno Haible
bruno at clisp.org
Sat Jan 14 19:59:19 CET 2012
Hi,
It was already reported here:
http://gmplib.org/list-archives/gmp-bugs/2010-February/001848.html
but it is still not fixed in the newest gmp release (5.0.2).
How to reproduce:
On a Linux/glibc/x86_64 system with coreutils 8.12 installed (it contains a
program called 'link'), do
$ tar xvfz gmp-5.0.2.tar.gz
$ cd gmp-5.0.2
$ ./configure --host=x86_64-pc-linux-gnu
...
checking for BSD- or MS-compatible name lister (nm)... no
checking for x86_64-pc-linux-gnu-dumpbin... no
checking for x86_64-pc-linux-gnu-link... no
checking for dumpbin... no
checking for link... link -dump -symbols
checking the name lister (link -dump -symbols) interface... BSD nm
...
checking if globals are prefixed by underscore... link: invalid option -- 'd'
Try `link --help' for more information.
unknown
configure: WARNING: +----------------------------------------------------------
configure: WARNING: | Cannot determine global symbol prefix.
configure: WARNING: | link -dump -symbols output doesn't contain a global data symbol.
configure: WARNING: | Will proceed with no underscore.
configure: WARNING: | If this is wrong then you'll get link errors referring
configure: WARNING: | to ___gmpn_add_n (note three underscores).
configure: WARNING: | In this case do a fresh build with an override,
configure: WARNING: | ./configure gmp_cv_asm_underscore=yes
configure: WARNING: +----------------------------------------------------------
checking how to switch to read-only data section... .section .rodata
checking for assembler .type directive... .type $1,@$2
checking for assembler .size directive... .size $1,$2
checking for assembler local label prefix... configure: WARNING: "link -dump -symbols" failure
configure: WARNING: cannot determine local label, using default L
L
checking for assembler byte directive... .byte
checking how to define a 32-bit word... link: invalid option -- 'd'
Try `link --help' for more information.
link: invalid option -- 'd'
Try `link --help' for more information.
configure: error: cannot determine how to define a 32-bit word
The problem was discussed in the threads at
http://gmplib.org/list-archives/gmp-bugs/2010-December/002151.html
http://lists.gnu.org/archive/html/bug-libtool/2010-12/msg00011.html
It appears because in the LT_PATH_NM the 'nm' program is being checked
for only if $build = $host. In the case of gmp,
$build = athlon64-unknown-linux-gnu
$host = x86_64-pc-linux-gnu
which are obviously different.
A workaround is to pass the argument NM=nm to configure,
so as to force the LT_PATH_NM to use the 'nm' program.
The result of the discussion in
http://lists.gnu.org/archive/html/bug-libtool/2010-12/msg00021.html
was that the problem is fixed in libtool 2.4 or newer.
I confirm this: Upgrading to libtool 2.4.2 fixes the problem.
$ tar xvfz gmp-5.0.2.tar.gz
$ cd gmp-5.0.2
$ cp .../libtool-2.4.2/libltdl/config/ltmain.sh ltmain.sh
$ cp .../libtool-2.4.2/libltdl/m4/*.m4 .
$ aclocal
$ autoconf
$ ./configure --host=x86_64-pc-linux-gnu
...
checking for BSD- or MS-compatible name lister (nm)... no
checking for x86_64-pc-linux-gnu-dumpbin... no
checking for x86_64-pc-linux-gnu-link... no
checking for dumpbin... no
checking for link... link -dump
checking the name lister (nm) interface... BSD nm
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... (cached) BSD nm
...
(succeeds)
Therefore, please upgrade to the newest libtool release.
Bruno
More information about the gmp-bugs
mailing list