diff mbox series

[meta-ti] ti-img-rogue-driver_23.3.6512818: fix compile time error

Message ID 20240619173253.1484039-1-max.oss.09@gmail.com
State Rejected
Delegated to: Ryan Eatmon
Headers show
Series [meta-ti] ti-img-rogue-driver_23.3.6512818: fix compile time error | expand

Commit Message

Max Krummenacher June 19, 2024, 5:32 p.m. UTC
From: Max Krummenacher <max.krummenacher@toradex.com>

GCC-14 set more warnings to errors, demote the ones which trigger to a warning.
This is when building bsp-ti-6_1. I did not notice it when building bsp-ti-6_6

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
---
 ...dvars.mk-demote-some-errors-to-warni.patch | 35 +++++++++++++++++++
 .../ti-img-rogue-driver_23.3.6512818.bb       |  5 ++-
 2 files changed, 39 insertions(+), 1 deletion(-)
 create mode 100644 meta-ti-bsp/recipes-bsp/powervr-drivers/ti-img-rogue-driver-23.3.6512818/0001-build-linux-buildvars.mk-demote-some-errors-to-warni.patch

Comments

Randolph Sapp June 20, 2024, 10:19 p.m. UTC | #1
On Wed Jun 19, 2024 at 12:32 PM CDT, Max Krummenacher wrote:
> From: Max Krummenacher <max.krummenacher@toradex.com>
>
> GCC-14 set more warnings to errors, demote the ones which trigger to a warning.
> This is when building bsp-ti-6_1. I did not notice it when building bsp-ti-6_6
>
> Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
> ---
>  ...dvars.mk-demote-some-errors-to-warni.patch | 35 +++++++++++++++++++
>  .../ti-img-rogue-driver_23.3.6512818.bb       |  5 ++-
>  2 files changed, 39 insertions(+), 1 deletion(-)
>  create mode 100644 meta-ti-bsp/recipes-bsp/powervr-drivers/ti-img-rogue-driver-23.3.6512818/0001-build-linux-buildvars.mk-demote-some-errors-to-warni.patch
>
> diff --git a/meta-ti-bsp/recipes-bsp/powervr-drivers/ti-img-rogue-driver-23.3.6512818/0001-build-linux-buildvars.mk-demote-some-errors-to-warni.patch b/meta-ti-bsp/recipes-bsp/powervr-drivers/ti-img-rogue-driver-23.3.6512818/0001-build-linux-buildvars.mk-demote-some-errors-to-warni.patch
> new file mode 100644
> index 000000000000..deb6dfbe1c52
> --- /dev/null
> +++ b/meta-ti-bsp/recipes-bsp/powervr-drivers/ti-img-rogue-driver-23.3.6512818/0001-build-linux-buildvars.mk-demote-some-errors-to-warni.patch
> @@ -0,0 +1,35 @@
> +From 9800beec79d13690a80f1796d67be8346c31b27d Mon Sep 17 00:00:00 2001
> +From: Max Krummenacher <max.krummenacher@toradex.com>
> +Date: Thu, 13 Jun 2024 14:46:52 +0000
> +Subject: [PATCH] build/linux/buildvars.mk: demote some errors to warnings
> +
> +With GCC-14 I get compile time errors with the following patterns:
> +
> +.../work-shared/am62xx-evm/kernel-source/arch/arm64/include/asm/cpufeature.h:696:21: error: comparison of unsigned expression in '>= 0' is always true [-Werror=type-limits]
> +  696 |         return (val >= ID_AA64MMFR0_EL1_TGRAN4_SUPPORTED_MIN) &&
> +
> +| .../work/am62xx_evm-oe-linux/ti-img-rogue-driver/23.3.6512818/git/binary_am62_linux_lws-generic_release/target_aarch64/kbuild/services/server/devices/rgxfwcmnctx.c:144:9: error: missing initializer for field 'psCCB' of 'RGXFWIF_FWCOMMONCONTEXT' {aka 'struct RGXFWIF_FWCOMMONCONTEXT_'} [-Werror=missing-field-initializers]
> +|  144 |         RGXFWIF_FWCOMMONCONTEXT sFWCommonContext = { { 0 } };
> +
> +Upstream-Status: Pending
> +Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
> +---
> + build/linux/buildvars.mk | 2 +-
> + 1 file changed, 1 insertion(+), 1 deletion(-)
> +
> +diff --git a/build/linux/buildvars.mk b/build/linux/buildvars.mk
> +index ec5b14a01197..e387a56584b9 100644
> +--- a/build/linux/buildvars.mk
> ++++ b/build/linux/buildvars.mk
> +@@ -51,7 +51,7 @@
> + 
> + # These flags are used for kernel, User C and User C++
> + #
> +-COMMON_FLAGS := -W -Wall
> ++COMMON_FLAGS := -W -Wall -Wno-error=missing-field-initializers -Wno-error=type-limits
> + 
> + # Enable 64-bit file & memory handling on 32-bit systems.
> + #
> +-- 
> +2.42.0
> +
> diff --git a/meta-ti-bsp/recipes-bsp/powervr-drivers/ti-img-rogue-driver_23.3.6512818.bb b/meta-ti-bsp/recipes-bsp/powervr-drivers/ti-img-rogue-driver_23.3.6512818.bb
> index 34c22cb2adf5..a7318fd6cf9c 100644
> --- a/meta-ti-bsp/recipes-bsp/powervr-drivers/ti-img-rogue-driver_23.3.6512818.bb
> +++ b/meta-ti-bsp/recipes-bsp/powervr-drivers/ti-img-rogue-driver_23.3.6512818.bb
> @@ -15,7 +15,10 @@ DEPENDS = "virtual/kernel"
>  
>  BRANCH = "linuxws/scarthgap/k6.6/${PV}"
>  
> -SRC_URI = "git://git.ti.com/git/graphics/ti-img-rogue-driver.git;protocol=https;branch=${BRANCH}"
> +SRC_URI = " \
> +    git://git.ti.com/git/graphics/ti-img-rogue-driver.git;protocol=https;branch=${BRANCH} \
> +    file://0001-build-linux-buildvars.mk-demote-some-errors-to-warni.patch \
> +"
>  
>  S = "${WORKDIR}/git"
>  

Do not merge this patch.

Thanks for bringing this to my attention. This workaround actually pointed out
that the build/linux/tools/cc-check.sh script that both the um and km components
use to check compiler flags was actually flawed for GCC 14.

I hadn't noticed because the build hides logs from that script but it was
passing a program known to fail to GCC and then expecting that to return 0. In
GCC 14 this returns 1 and does not produce an output object. On top of that
unrecognized command line flags moved from warnings to notes. These changes
break every check in that script.

I'll update upstream for this.
diff mbox series

Patch

diff --git a/meta-ti-bsp/recipes-bsp/powervr-drivers/ti-img-rogue-driver-23.3.6512818/0001-build-linux-buildvars.mk-demote-some-errors-to-warni.patch b/meta-ti-bsp/recipes-bsp/powervr-drivers/ti-img-rogue-driver-23.3.6512818/0001-build-linux-buildvars.mk-demote-some-errors-to-warni.patch
new file mode 100644
index 000000000000..deb6dfbe1c52
--- /dev/null
+++ b/meta-ti-bsp/recipes-bsp/powervr-drivers/ti-img-rogue-driver-23.3.6512818/0001-build-linux-buildvars.mk-demote-some-errors-to-warni.patch
@@ -0,0 +1,35 @@ 
+From 9800beec79d13690a80f1796d67be8346c31b27d Mon Sep 17 00:00:00 2001
+From: Max Krummenacher <max.krummenacher@toradex.com>
+Date: Thu, 13 Jun 2024 14:46:52 +0000
+Subject: [PATCH] build/linux/buildvars.mk: demote some errors to warnings
+
+With GCC-14 I get compile time errors with the following patterns:
+
+.../work-shared/am62xx-evm/kernel-source/arch/arm64/include/asm/cpufeature.h:696:21: error: comparison of unsigned expression in '>= 0' is always true [-Werror=type-limits]
+  696 |         return (val >= ID_AA64MMFR0_EL1_TGRAN4_SUPPORTED_MIN) &&
+
+| .../work/am62xx_evm-oe-linux/ti-img-rogue-driver/23.3.6512818/git/binary_am62_linux_lws-generic_release/target_aarch64/kbuild/services/server/devices/rgxfwcmnctx.c:144:9: error: missing initializer for field 'psCCB' of 'RGXFWIF_FWCOMMONCONTEXT' {aka 'struct RGXFWIF_FWCOMMONCONTEXT_'} [-Werror=missing-field-initializers]
+|  144 |         RGXFWIF_FWCOMMONCONTEXT sFWCommonContext = { { 0 } };
+
+Upstream-Status: Pending
+Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
+---
+ build/linux/buildvars.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/build/linux/buildvars.mk b/build/linux/buildvars.mk
+index ec5b14a01197..e387a56584b9 100644
+--- a/build/linux/buildvars.mk
++++ b/build/linux/buildvars.mk
+@@ -51,7 +51,7 @@
+ 
+ # These flags are used for kernel, User C and User C++
+ #
+-COMMON_FLAGS := -W -Wall
++COMMON_FLAGS := -W -Wall -Wno-error=missing-field-initializers -Wno-error=type-limits
+ 
+ # Enable 64-bit file & memory handling on 32-bit systems.
+ #
+-- 
+2.42.0
+
diff --git a/meta-ti-bsp/recipes-bsp/powervr-drivers/ti-img-rogue-driver_23.3.6512818.bb b/meta-ti-bsp/recipes-bsp/powervr-drivers/ti-img-rogue-driver_23.3.6512818.bb
index 34c22cb2adf5..a7318fd6cf9c 100644
--- a/meta-ti-bsp/recipes-bsp/powervr-drivers/ti-img-rogue-driver_23.3.6512818.bb
+++ b/meta-ti-bsp/recipes-bsp/powervr-drivers/ti-img-rogue-driver_23.3.6512818.bb
@@ -15,7 +15,10 @@  DEPENDS = "virtual/kernel"
 
 BRANCH = "linuxws/scarthgap/k6.6/${PV}"
 
-SRC_URI = "git://git.ti.com/git/graphics/ti-img-rogue-driver.git;protocol=https;branch=${BRANCH}"
+SRC_URI = " \
+    git://git.ti.com/git/graphics/ti-img-rogue-driver.git;protocol=https;branch=${BRANCH} \
+    file://0001-build-linux-buildvars.mk-demote-some-errors-to-warni.patch \
+"
 
 S = "${WORKDIR}/git"