MacOS Ventura, Monterey Intel compiler error using /usr/bin/cc
Chris Johns
chrisj at rtems.org
Fri Dec 1 04:40:51 CET 2023
Hello,
Version 6.3.0, built from source, no patches
We build GMP from source when building the RTEMS GNU compiler tools using our
source builder tool. I am seeing an error only on Intel MacOS Ventura and
Monterey with the latest Xcode. There is no error on M2 Sonoma. The error is:
libtool: compile: /usr/bin/cc -O2 -pipe -fbracket-depth=1024
-I/opt/work/chris/rtems/rsb/rtems-source-builder.git/rtems/build/tmp/sb-501/tools/rtems-default-tools/opt/work/rtems/6/include
-DHAVE_CONFIG_H -I. -I.. -D__GMP_WITHIN_GMP -I.. -DOPERATION_fib_table -O2
-pedantic -fomit-frame-pointer -m64 -mtune=k8 -march=k8 -c fib_table.c -o
fib_table.o
In file included from fib_table.c:4:
../gmp-impl.h:1356:43: error: unexpected type name 'mpz_srcptr': expected identifier
void (*randseed_fn) (gmp_randstate_ptr, mpz_srcptr);
^
../gmp-impl.h:1356:24: error: a parameter list without types is only allowed in
a function definition
void (*randseed_fn) (gmp_randstate_ptr, mpz_srcptr);
^
../gmp-impl.h:1357:42: error: unexpected type name 'mp_ptr': expected identifier
void (*randget_fn) (gmp_randstate_ptr, mp_ptr, unsigned long int);
^
../gmp-impl.h:1357:50: error: expected identifier
void (*randget_fn) (gmp_randstate_ptr, mp_ptr, unsigned long int);
^
../gmp-impl.h:1358:25: error: a parameter list without types is only allowed in
a function definition
void (*randclear_fn) (gmp_randstate_ptr);
^
../gmp-impl.h:1359:24: error: a parameter list without types is only allowed in
a function definition
void (*randiset_fn) (gmp_randstate_ptr, gmp_randstate_srcptr);
^
../gmp-impl.h:1377:47: error: a parameter list without types is only allowed in
a function definition
__GMP_DECLSPEC void __gmp_randinit_mt_noseed (gmp_randstate_ptr);
^
7 errors generated.
I tracked the error down to using cc rather than gcc. We forced the compiler via
CC. The cc compiler is fine on aarch64 systems.
Is this expected behaviour?
Finally, thanks for supporting Apple M silicon out of the box in 6.3.0. It is
appreciated.
Thanks
Chris
More information about the gmp-bugs
mailing list