summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Krummenacher <max.krummenacher@toradex.com>2025-05-12 09:37:47 +0200
committerMax Krummenacher <max.krummenacher@toradex.com>2025-05-12 09:37:47 +0200
commitdc129ca65213d3dea3c8ab7ba5d6016605b44e7b (patch)
treed05d9b4ad4a9d7b37a4af39717b9223b2f4aef78
parent693c297a195b5196cb2fd317057ab32b5926dbb9 (diff)
downloadmeta-freescale-dc129ca65213d3dea3c8ab7ba5d6016605b44e7b.tar.gz
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 <max.krummenacher@toradex.com>
-rw-r--r--recipes-bsp/imx-vpu-hantro-vc/imx-vpu-hantro-vc/0001-base_type.h-make-header-compatible-with-c23.patch39
-rw-r--r--recipes-bsp/imx-vpu-hantro-vc/imx-vpu-hantro-vc_1.10.1.bb5
2 files changed, 43 insertions, 1 deletions
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 @@
1From e7f6097c9e7cb30f130502cc4804e1a1b01342de Mon Sep 17 00:00:00 2001
2From: Max Krummenacher <max.krummenacher@toradex.com>
3Date: Wed, 7 May 2025 16:13:38 +0000
4Subject: [PATCH] base_type.h: make header compatible with c23
5
6With C23 bool, true and false are built in keywords and cannot be
7redefined.
8
9Upstream-Status: Pending
10Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
11---
12 usr/include/hantro_VC8000E_enc/base_type.h | 4 ++++
13 1 file changed, 4 insertions(+)
14
15diff --git a/usr/include/hantro_VC8000E_enc/base_type.h b/usr/include/hantro_VC8000E_enc/base_type.h
16index 282fc81b8eba..af4212eed2bd 100755
17--- a/usr/include/hantro_VC8000E_enc/base_type.h
18+++ b/usr/include/hantro_VC8000E_enc/base_type.h
19@@ -67,6 +67,9 @@ typedef unsigned int UInt;
20 #define HANTRO_FALSE 0
21 #define HANTRO_TRUE 1
22
23+#if defined __STDC_VERSION__ && __STDC_VERSION__ > 201710L
24+/* bool, true and false are keywords. */
25+#else
26 #ifndef bool
27 typedef enum
28 {
29@@ -74,6 +77,7 @@ typedef enum
30 true = HANTRO_TRUE
31 } bool;
32 #endif
33+#endif
34
35 enum
36 {
37--
382.42.0
39
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"
6 6
7inherit fsl-eula-unpack 7inherit fsl-eula-unpack
8 8
9SRC_URI = "${FSL_MIRROR}/${BP}-${IMX_SRCREV_ABBREV}.bin;fsl-eula=true" 9SRC_URI = " \
10 ${FSL_MIRROR}/${BP}-${IMX_SRCREV_ABBREV}.bin;fsl-eula=true \
11 file://0001-base_type.h-make-header-compatible-with-c23.patch \
12"
10IMX_SRCREV_ABBREV = "c0244a1" 13IMX_SRCREV_ABBREV = "c0244a1"
11 14
12SRC_URI[sha256sum] = "713ba375f25490727fcc62bab5d5508f74de03204b4c153464b696b652c5c7df" 15SRC_URI[sha256sum] = "713ba375f25490727fcc62bab5d5508f74de03204b4c153464b696b652c5c7df"