Configure fails on 32-bit platform

Vincent Lefevre vincent at vinc17.net
Mon Feb 12 13:46:52 UTC 2018


On 2018-02-12 12:52:49 +0100, Torbjorn Granlund wrote:
> It is less common that people set CC/CFLAGS to bad values (or at least
> we don't hear about that very often).  I don't think we should try to
> accomodate that since it would result in lots of fragile complexity.
> (If you don't agree, please see the logic for "ABI" -> (CFLAGS,mpn_path)
> selection.)

The problem here may be somewhere else. On an x86_64 machine, with
just "gcc", the processor is regarded as an x86_64: the __x86_64
macro is defined. But if one uses -m32, then the processor is
regarded as a 32-bit x86: __x86_64 is no longer defined; __i386 and
__i686 are defined instead.

The selection of the ABI seems to be based on $host in configure.ac:

case $host in
  [...]
  X86_PATTERN | X86_64_PATTERN)
    abilist="32"
    [...]
    case $host in
      X86_64_PATTERN)
        cclist_64="gcc cc"
        [...]
        abilist="64 x32 32"
[...]

So, in case of 32-bit x86 mode in the compiler, shouldn't $host be
seen as matching X86_PATTERN instead of X86_64_PATTERN?

Otherwise, since abilist="64 x32 32", for X86_64_PATTERN, shouldn't 32
be tried if 64 and x32 do not work (i.e. as if the user set ABI=32)?
There's a "for abi in $abilist; do" loop. So I'm wondering whether it
does all the necessary tests it could do. Here, it appears to decide
too early that ABI=64 is working.

-- 
Vincent Lefèvre <vincent at vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)


More information about the gmp-bugs mailing list