ABI defaults

Vincent Lefevre vincent+gmp at vinc17.org
Tue Nov 23 15:47:04 CET 2010

On 2010-11-23 14:26:14 +0100, Torbjorn Granlund wrote:
> nisse at lysator.liu.se (Niels Möller) writes:
>   By the way, which of
>     ./configure ABI=default CC="gcc -m64"
>   and
>     ./configure ABI=default CFLAGS="-m64"
>   do you think should be the recommended way to set ABI-selection flags
>   manually? I imagine it may complicate the code which adds options to
>   CFLAGS if we insist on supporting both variants. And we may also need a
>   way for the user to say "Use exactly these flags, don't mess with them";
>   if explicitly setting CFLAGS should be that way, then the answer to the
>   above question ought to be CC="gcc -m64".
> I think CC="gcc -m32" or CC="gcc -maix64", etc, would be the correct
> way.


> If we recommend using CFLAGS, people will tend to switch off
> optimisation; it would be weird if we overrode CFLAGS, since then
> there would be no way to, say, make a debug build without
> optimisation.

There could still be the possibility to detect an explicit -O0,
and add a -O... option only if there isn't already one. I don't
really like this idea, though.

> I suppose another method would be use loop through the ABI compiler
> flags we are aware of, and see if we get the same object file for
> a plain compiler invocation:
>   $CC foo.c -c
>   cp foo.o ref.o
>   for abi in $abilist
>     do
>       eval cflags=\"\$${ccbase}${abi}_cflags\"
>       $ccbase foo.c -c
>       if cmp foo.o ref.o
>         then defaultabi=$abi; break
>         fi
>     done
> Untested, probably broken in a few ways. Object formats that include
> a time stamp (such as COFF) will not be detected.

Don't some compilers use non-deterministic compilation?

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

More information about the gmp-devel mailing list