From dc129ca65213d3dea3c8ab7ba5d6016605b44e7b Mon Sep 17 00:00:00 2001 From: Max Krummenacher Date: Mon, 12 May 2025 09:37:47 +0200 Subject: imx-vpu-hantro-vc: fix build with gcc 15 GCC 15 by default uses C23 as the standard. With C23 bool, true and false are built in keywords and cannot be redefined. Fixes build of imx-vpu-hantro-daemon: | ...imx-vpu-hantro-daemon/1.5.0/recipe-sysroot/usr/include/hantro_VC8000E_enc/base_type.h:73:3: error: cannot use keyword 'false' as enumeration constant | 73 | false = HANTRO_FALSE, Signed-off-by: Max Krummenacher --- ...se_type.h-make-header-compatible-with-c23.patch | 39 ++++++++++++++++++++++ .../imx-vpu-hantro-vc/imx-vpu-hantro-vc_1.10.1.bb | 5 ++- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 recipes-bsp/imx-vpu-hantro-vc/imx-vpu-hantro-vc/0001-base_type.h-make-header-compatible-with-c23.patch diff --git a/recipes-bsp/imx-vpu-hantro-vc/imx-vpu-hantro-vc/0001-base_type.h-make-header-compatible-with-c23.patch b/recipes-bsp/imx-vpu-hantro-vc/imx-vpu-hantro-vc/0001-base_type.h-make-header-compatible-with-c23.patch new file mode 100644 index 00000000..8d017ab7 --- /dev/null +++ b/recipes-bsp/imx-vpu-hantro-vc/imx-vpu-hantro-vc/0001-base_type.h-make-header-compatible-with-c23.patch @@ -0,0 +1,39 @@ +From e7f6097c9e7cb30f130502cc4804e1a1b01342de Mon Sep 17 00:00:00 2001 +From: Max Krummenacher +Date: Wed, 7 May 2025 16:13:38 +0000 +Subject: [PATCH] base_type.h: make header compatible with c23 + +With C23 bool, true and false are built in keywords and cannot be +redefined. + +Upstream-Status: Pending +Signed-off-by: Max Krummenacher +--- + usr/include/hantro_VC8000E_enc/base_type.h | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/usr/include/hantro_VC8000E_enc/base_type.h b/usr/include/hantro_VC8000E_enc/base_type.h +index 282fc81b8eba..af4212eed2bd 100755 +--- a/usr/include/hantro_VC8000E_enc/base_type.h ++++ b/usr/include/hantro_VC8000E_enc/base_type.h +@@ -67,6 +67,9 @@ typedef unsigned int UInt; + #define HANTRO_FALSE 0 + #define HANTRO_TRUE 1 + ++#if defined __STDC_VERSION__ && __STDC_VERSION__ > 201710L ++/* bool, true and false are keywords. */ ++#else + #ifndef bool + typedef enum + { +@@ -74,6 +77,7 @@ typedef enum + true = HANTRO_TRUE + } bool; + #endif ++#endif + + enum + { +-- +2.42.0 + diff --git a/recipes-bsp/imx-vpu-hantro-vc/imx-vpu-hantro-vc_1.10.1.bb b/recipes-bsp/imx-vpu-hantro-vc/imx-vpu-hantro-vc_1.10.1.bb index 2e4718c9..5aaf92c5 100644 --- a/recipes-bsp/imx-vpu-hantro-vc/imx-vpu-hantro-vc_1.10.1.bb +++ b/recipes-bsp/imx-vpu-hantro-vc/imx-vpu-hantro-vc_1.10.1.bb @@ -6,7 +6,10 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=ca53281cc0caa7e320d4945a896fb837" inherit fsl-eula-unpack -SRC_URI = "${FSL_MIRROR}/${BP}-${IMX_SRCREV_ABBREV}.bin;fsl-eula=true" +SRC_URI = " \ + ${FSL_MIRROR}/${BP}-${IMX_SRCREV_ABBREV}.bin;fsl-eula=true \ + file://0001-base_type.h-make-header-compatible-with-c23.patch \ +" IMX_SRCREV_ABBREV = "c0244a1" SRC_URI[sha256sum] = "713ba375f25490727fcc62bab5d5508f74de03204b4c153464b696b652c5c7df" -- cgit v1.2.3-54-g00ecf