Minimum required CFLAGS

tg at trevorgross.com tg at trevorgross.com
Tue Aug 18 08:13:54 CEST 2026


Hi all,

When building on s390x, setting any CFLAGS causes this failure:

      cc -c -DHAVE_CONFIG_H -I. -I../../../gmp-6.3.0-c/mpn -I.. -D__GMP_WITHIN_GMP -I../../../gmp-6.3.0-c -DOPERATION_rsblsh1_n -Wa,--noexecstack tmp-rsblsh1_n.s -fPIC -DPIC -o rsblsh1_n.o
     addmul_2.c: In function ‘__gmpn_addmul_2’:
     addmul_2.c:476:1: error: %r11 cannot be used in ‘asm’ here
       476 | }
           | ^
     make[2]: *** [Makefile:492: addmul_2.lo] Error 1

After a bit of debugging, it seems like CFLAGS="-fomit-frame-pointer
-m64 -march=z15" is needed to match the default (specifically,
`-fomit-frame-pointer`).

This failure was obvious enough to catch, but it has me wondering
about whether I may be omitting needed flags on other platforms. Is
there a minimal set of flags documented anywhere, or easy to find,
that must be passed as part of CFLAGS? Or a way to append to rather
than override the default flags?

Thanks,
Trevor

P.S. This was discovered with the 6.3.0 release but does not appear in
the latest unreleased version, it appears s390 was reworked around
2023-08. But resolving this build error seems coincidental, so the
question remains.


More information about the gmp-discuss mailing list