Vincent Lefevre <vinc...@vinc17.net> writes:
> That said, perhaps GMP might be improved to detect the ABI by a
> simple parsing of $CFLAGS when provided by the user (in case values
> like -m32 or -m64 are standard).
In Nettle, I try to detect the ABI used by the configured C compiler,
with a configure test like
case "$host_cpu" in
[x86_64 | amd64])
#if defined(__x86_64__) || defined(__arch64__)
#error 64-bit x86
], , [
(and the above misses x32). That's a bit verbose, but I think it's less
brittle than trying to parse compiler flags. For one, how would we know
which ABI the compiler uses by default?
The result is used when selecting assembly code.
But then the way I recommend to configure ABI is still not to set
CFLAGS, but to set CC. E.g.,
./configure CC='gcc -m32' CXX='g++ -m32'
Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677.
Internet email is subject to wholesale government surveillance.
gmp-bugs mailing list