From ed5585a03cd633e6e4e630b6010b508bac01fce3 Mon Sep 17 00:00:00 2001 From: Thomas Perale Date: Sat, 7 Jun 2025 14:00:22 +0200 Subject: [PATCH] package/yasm: fix build with host GCC 15 Fix the following autobuild error that started appearing with host GCC15 configs. ``` /usr/bin/gcc -DHAVE_CONFIG_H -I. -I/workdir/instance-0/output-1/host/include -O2 -I/workdir/instance-0/output-1/host/include -c -o modules/arch/x86/x86arch.o modules/arch/x86/x86arch.c In file included from modules/arch/x86/x86arch.h:30, from modules/arch/x86/x86arch.c:31: ./libyasm/bitvect.h:86:32: error: cannot use keyword 'false' as enumeration constant 86 | typedef enum boolean { false = FALSE, true = TRUE } boolean; | ^~~~~ ./libyasm/bitvect.h:86:32: note: 'false' is a keyword with '-std=c23' onwards ``` This is due to the change in the default C language version in GCC15. Fixes: https://autobuild.buildroot.org/results/d1d/d1d9a6e73c2ec278941dd90c6b07cce01b372feb/ Signed-off-by: Thomas Perale Signed-off-by: Peter Korsgaard (cherry picked from commit aa9ee1770140946bb9344e7c70e3be3d03481d0a) Signed-off-by: Thomas Perale --- .../0002-bitvect-fix-build-with-gcc-15.patch | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 package/yasm/0002-bitvect-fix-build-with-gcc-15.patch diff --git a/package/yasm/0002-bitvect-fix-build-with-gcc-15.patch b/package/yasm/0002-bitvect-fix-build-with-gcc-15.patch new file mode 100644 index 0000000000..684c8be042 --- /dev/null +++ b/package/yasm/0002-bitvect-fix-build-with-gcc-15.patch @@ -0,0 +1,38 @@ +From 64ef740eb262f329e55eebadf2ce276b146d44e9 Mon Sep 17 00:00:00 2001 +From: Martin Jansa +Date: Tue, 22 Apr 2025 19:06:24 +0200 +Subject: [PATCH] bitvect: fix build with gcc-15 + +* fixes: +libyasm/bitvect.h:86:32: error: cannot use keyword 'false' as enumeration constant + 86 | typedef enum boolean { false = FALSE, true = TRUE } boolean; + | ^~~~~ +../git/libyasm/bitvect.h:86:32: note: 'false' is a keyword with '-std=c23' onwards + +as suggested in: +https://github.com/yasm/yasm/issues/283#issuecomment-2661108816 + +Signed-off-by: Martin Jansa +Upstream: https://github.com/yasm/yasm/pull/287 +Signed-off-by: Thomas Perale +--- + libyasm/bitvect.h | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/libyasm/bitvect.h b/libyasm/bitvect.h +index 3aee3a531..a13470ada 100644 +--- a/libyasm/bitvect.h ++++ b/libyasm/bitvect.h +@@ -83,7 +83,11 @@ typedef Z_longword *Z_longwordptr; + #ifdef MACOS_TRADITIONAL + #define boolean Boolean + #else +- typedef enum boolean { false = FALSE, true = TRUE } boolean; ++ #if __STDC_VERSION__ < 202311L ++ typedef enum boolean { false = FALSE, true = TRUE } boolean; ++ #else ++ typedef bool boolean; ++ #endif + #endif + #endif +