Move -DNO_ASM to config.h?

Marc Glisse marc.glisse at inria.fr
Sun Mar 20 11:14:49 UTC 2016


On Sun, 20 Mar 2016, Torbjörn Granlund wrote:

> Marc Glisse <marc.glisse at inria.fr> writes:
>
>  One issue with changing it is MPFR: src/mpfr-longlong.h tests for
>  NO_ASM, but there is no code to define it. As far as I understand,
>  MPFR uses __GMP_CFLAGS by default, in which GMP may have included
>  -DNO_ASM. If we move NO_ASM to config.h, that also affects them (not
>  that it should necessarily stop us). We could also define NO_ASM both
>  in CFLAGS and config.h. It looks like gcc and clang only warn when
>  redefining a macro to something different, they don't warn for
>  -DNO_ASM with #define NO_ASM 1, so it wouldn't be so bad.
>
> In what way is it relevant to MPFR whether a GMP build included asm or
> not?

I am guessing that, just like they want to use the exact same flags as GMP 
to compile (__GMP_CFLAGS), they also want to mimic this part of the build 
process. I don't know if their version of longlong.h is kept in sync with 
GMP's, but it seems likely that a user who went to the trouble of 
disabling assembly for GMP doesn't want to use that same assembly in MPFR. 
On the other hand, MPFR could probably add a --disable-assembly configure 
flag to define NO_ASM, so the user would just have to pass the same option 
to MPFR that he already passed to GMP.

I currently think I'll go with just config.h (no CFLAGS).

-- 
Marc Glisse


More information about the gmp-devel mailing list