too strict a check in aclocal.m4 causes build failures

Ximin Luo infinity0 at
Tue Dec 21 04:09:25 CET 2010

I have a core2 system, and have been trying to compile GMP 5.0.1 optimised for
other x86 CPUs, by doing (e.g.)

$ ./configure --host=pentium4-$(./config.guess | cut -d- -f2-)

However, these fail with an obscure error message about `link -dump -symbols`
(see snippet 1). After a convoluted path of debugging, I've worked out that the
cause is ./configure not detecting the presence of "/usr/bin/nm -B", in the
case where $build != $host.

The responsible line is in aclocal.m4:
3190   if test -n "$ac_tool_prefix" && test "$build" = "$host"; then

If you remove the second test, either here and running autoconf, or in
./configure directly, the build works fine.

Test code is available at [1]. Note the WORKAROUND on line 232 - removing it
will cause builds such as

$ ./ pentium4

to fail (assuming you're on a core2).

Hopefully my proposed fix doesn't break anything.



----> snippet 1 <----

checking if globals are prefixed by underscore... link: invalid option -- 'd'
Try `link --help' for more information.
configure: WARNING: +----------------------------------------------------------
configure: WARNING: | Cannot determine global symbol prefix.
configure: WARNING: | link -dump -symbols output doesn't contain a global data
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
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

Failed to configure for libjbigi-linux-pentium4; maybe it isn't supported on
your build environment.

Error building libjbigi-linux-pentium4!


More information about the gmp-bugs mailing list