From 358b4116c762caff26f22ecbfff874692d7c77ee Mon Sep 17 00:00:00 2001 From: Romain Naour Date: Sun, 24 Aug 2025 19:18:21 +0200 Subject: [PATCH] package/xvisor: Use '-std=gnu11' to fix build with GCC 15 Since Buildroot commit [1] "update to Bootlin toolchains 2025.08-1", the TestXvisor fails when building xvisor with gcc 15.1.0. GCC 15 changed the default C standard version to C23 [2], resulting in errors from the xvisor definitions of bool from core/include/vmm_types.h, which is a reserved keyword under C23. Since CFLAGS are hardcoded in the main Makefile, add '-std=gnu11' to 'cflags' to resolve the error. [1] https://gitlab.com/buildroot.org/buildroot/-/commit/947dbc92a20c5acea7882166cae7893e6ea661e1 [2] https://gcc.gnu.org/gcc-15/porting_to.html Fixes: https://gitlab.com/buildroot.org/buildroot/-/jobs/11042295047 Cc: Julien Olivain Signed-off-by: Romain Naour Signed-off-by: Julien Olivain --- ...e-std-gnu11-to-fix-build-with-GCC-15.patch | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 package/xvisor/0003-Makefile-Use-std-gnu11-to-fix-build-with-GCC-15.patch diff --git a/package/xvisor/0003-Makefile-Use-std-gnu11-to-fix-build-with-GCC-15.patch b/package/xvisor/0003-Makefile-Use-std-gnu11-to-fix-build-with-GCC-15.patch new file mode 100644 index 0000000000..f78e6efb9c --- /dev/null +++ b/package/xvisor/0003-Makefile-Use-std-gnu11-to-fix-build-with-GCC-15.patch @@ -0,0 +1,40 @@ +From 53a53af30ce1704b7de806a51d822472fbcc57de Mon Sep 17 00:00:00 2001 +From: Romain Naour +Date: Sun, 24 Aug 2025 18:26:52 +0200 +Subject: [PATCH] Makefile: Use '-std=gnu11' to fix build with GCC 15 + +GCC 15 changed the default C standard version to C23 [1], resulting in +errors from the xvisor definitions of bool from core/include/vmm_types.h, +which is a reserved keyword under C23. + +Since CFLAGS are hardcoded in the main Makefile, add '-std=gnu11' to +'cflags' to resolve the error. + +[1] https://gcc.gnu.org/gcc-15/porting_to.html + +Upstream: https://github.com/xvisor/xvisor/pull/200 + +Fixes: +https://gitlab.com/buildroot.org/buildroot/-/jobs/11042295047 + +Signed-off-by: Romain Naour +--- + Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index 1984408c..8731ece0 100644 +--- a/Makefile ++++ b/Makefile +@@ -166,7 +166,7 @@ cppflags+=-I$(libs_dir)/include + cppflags+=$(cpu-cppflags) + cppflags+=$(board-cppflags) + cppflags+=$(libs-cppflags-y) +-cflags=-g -Wall -nostdlib --sysroot=$(drivers_dir)/include -fno-builtin -fno-stack-protector -D__VMM__ ++cflags=-std=gnu11 -g -Wall -nostdlib --sysroot=$(drivers_dir)/include -fno-builtin -fno-stack-protector -D__VMM__ + cflags+=$(board-cflags) + cflags+=$(cpu-cflags) + cflags+=$(libs-cflags-y) +-- +2.50.1 +