GCC 15.2 defaults to C23:
$ aarch64-poky-linux-gcc --version
aarch64-poky-linux-gcc (GCC) 15.2.0
$ aarch64-poky-linux-gcc -dM -E - </dev/null | grep STDC_VERSION
#define __STDC_VERSION__ 202311L
As of ghostscript 10.06.0 the build is good with C23[1] and our cross
compiler is 15.2, so we can stop adding -std=gnu17 to the target CFLAGS.
However, our buildtools are currently using GCC 14.2 which has the
interesting behaviour that it has a -std=gnu23 option but does not then
actually claim to support C23:
$ gcc --version
gcc (GCC) 14.2.0
$ gcc -std=gnu23 -dM -E - </dev/null | grep STDC_VERSION
#define __STDC_VERSION__ 202000L
This then interacts badly with autoconf 2.73 which tells the compiler to
use C23, breaking stdpre.h which handles a number of different
compilers and C standards.
A bug has been filed with ghostscript[2] to try and handle this this
case in the source, but a workaround is to tell the native compiles to
explicitly use C17.
[1] ghostscript
ae9409464 ("Bug 708160: Fix compatibility with C23 compilers")
[2] https://bugs.ghostscript.com/show_bug.cgi?id=709290
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
--with-fontpath=${datadir}/fonts \
CUPSCONFIG="${STAGING_BINDIR_CROSS}/cups-config" \
PKGCONFIG=pkg-config \
+ CFLAGSAUX=-std=gnu17 \
"
EXTRA_OECONF:append:mipsarcho32 = " --with-large_color_index=0"
EXTRA_OECONF:append:armv7a = "${@bb.utils.contains('TUNE_FEATURES','neon','',' --disable-neon',d)}"
EXTRA_OECONF:append:armv7ve = "${@bb.utils.contains('TUNE_FEATURES','neon','',' --disable-neon',d)}"
-TARGET_CFLAGS += "-std=gnu17 -Wno-error=declaration-after-statement -fPIC"
+TARGET_CFLAGS += "-Wno-error=declaration-after-statement -fPIC"
inherit autotools pkgconfig