From f5516c2fcd6217bf83736326e78b14cf64282e3a Mon Sep 17 00:00:00 2001 From: Max Krummenacher Date: Mon, 12 May 2025 09:37:52 +0200 Subject: linux-imx-headers: make uapi ipu.h, pxp_dma.h compatible with c23 standard In C23 bool, false and true are reserved keywords. Make ipu.h, pxp_dma.h uapi include file compatible with C23 standard. The ipu.h header is i.e. used in the imx-gst1.0-plugin code. If building with GCC 15 the build fails. FAILED: libs/libgstfsl-1.0.so.0.0.0.p/v4l2_core_gstimxv4l2.c.o ...imx-gst1.0-plugin/4.9.2+git/recipe-sysroot/usr/include/imx/linux/ipu.h:32:23: error: 'bool' cannot be defined via 'typedef' 32 | typedef unsigned char bool; That pxp_dma.h is affected was found with grep. A configuration which actually includes the file is yet to be found. Signed-off-by: Max Krummenacher --- ...-mxc-make-uapi-ipu.h-pxp_dma.h-compatible.patch | 54 ++++++++++++++++++++++ recipes-kernel/linux/linux-imx-headers_6.6.bb | 5 +- 2 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 recipes-kernel/linux/linux-imx-headers/0001-video-fbdev-mxc-make-uapi-ipu.h-pxp_dma.h-compatible.patch diff --git a/recipes-kernel/linux/linux-imx-headers/0001-video-fbdev-mxc-make-uapi-ipu.h-pxp_dma.h-compatible.patch b/recipes-kernel/linux/linux-imx-headers/0001-video-fbdev-mxc-make-uapi-ipu.h-pxp_dma.h-compatible.patch new file mode 100644 index 00000000..1750d624 --- /dev/null +++ b/recipes-kernel/linux/linux-imx-headers/0001-video-fbdev-mxc-make-uapi-ipu.h-pxp_dma.h-compatible.patch @@ -0,0 +1,54 @@ +From a5bcb18b42cfc0485397da9f48be6a73de86dfac Mon Sep 17 00:00:00 2001 +From: Max Krummenacher +Date: Sat, 10 May 2025 14:21:35 +0200 +Subject: [PATCH] video: fbdev: mxc: make uapi ipu.h, pxp_dma.h compatible with + c23 standard + +In C23 standard bool, false, true are reserved keywords. +Make ipu.h, pxp_dma.h uapi include file compatible with C23 standard. + +Upstream-Status: Pending +Signed-off-by: Max Krummenacher +--- + include/uapi/linux/ipu.h | 4 ++++ + include/uapi/linux/pxp_dma.h | 4 ++++ + 2 files changed, 8 insertions(+) + +diff --git a/include/uapi/linux/ipu.h b/include/uapi/linux/ipu.h +index c92f292bcc9d..a7b60730bbd4 100644 +--- a/include/uapi/linux/ipu.h ++++ b/include/uapi/linux/ipu.h +@@ -29,9 +29,13 @@ + #include + + #ifndef __KERNEL__ ++#if defined __STDC_VERSION__ && __STDC_VERSION__ > 201710L ++/* bool, true and false are keywords. */ ++#else + #ifndef __cplusplus + typedef unsigned char bool; + #endif ++#endif + #define irqreturn_t int + #define dma_addr_t int + #define uint32_t unsigned int +diff --git a/include/uapi/linux/pxp_dma.h b/include/uapi/linux/pxp_dma.h +index 9b5228504095..e2deff07516d 100644 +--- a/include/uapi/linux/pxp_dma.h ++++ b/include/uapi/linux/pxp_dma.h +@@ -25,8 +25,12 @@ + + #ifndef __KERNEL__ + typedef unsigned long dma_addr_t; ++#if defined __STDC_VERSION__ && __STDC_VERSION__ > 201710L ++/* bool, true and false are keywords. */ ++#else + typedef unsigned char bool; + #endif ++#endif + + /* PXP Pixel format definitions */ + /* Four-character-code (FOURCC) */ +-- +2.42.0 + diff --git a/recipes-kernel/linux/linux-imx-headers_6.6.bb b/recipes-kernel/linux/linux-imx-headers_6.6.bb index dbf4442c..41c337c4 100644 --- a/recipes-kernel/linux/linux-imx-headers_6.6.bb +++ b/recipes-kernel/linux/linux-imx-headers_6.6.bb @@ -7,7 +7,10 @@ New headers are installed in ${includedir}/imx." LICENSE = "GPL-2.0-only" LIC_FILES_CHKSUM = "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46" -SRC_URI = "git://github.com/nxp-imx/linux-imx.git;protocol=https;branch=${SRCBRANCH}" +SRC_URI = " \ + git://github.com/nxp-imx/linux-imx.git;protocol=https;branch=${SRCBRANCH} \ + file://0001-video-fbdev-mxc-make-uapi-ipu.h-pxp_dma.h-compatible.patch \ +" SRCBRANCH = "lf-6.6.y" LOCALVERSION = "-6.6.52-2.2.0" SRCREV = "e0f9e2afd4cff3f02d71891244b4aa5899dfc786" -- cgit v1.2.3-54-g00ecf