Skip to contentSkip to conversation

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

PATCH In review [email protected] 2 participants 2 messages Jun 19, 2024 – Jun 20, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ti-img-rogue-driver_23.3.6512818: fix compile time error

From: Max Krummenacher <[email protected]>

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

---
 ...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
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 +35 -0
new file mode 100644
index 000000000000..deb6dfbe1c52
@@ -0,0 +1,35 @@
+From 9800beec79d13690a80f1796d67be8346c31b27d Mon Sep 17 00:00:00 2001
+From: Max Krummenacher <[email protected]>
+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 <[email protected]>
+---
+ 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
+
meta-ti-bsp/recipes-bsp/powervr-drivers/ti-img-rogue-driver_23.3.6512818.bb +4 -1
index 34c22cb2adf5..a7318fd6cf9c 100644
@@ -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"
 
Signature · 1 line
2.42.0
#1 lore raw
Quoted 59 lines · Max Krummenacher

From: Max Krummenacher <[email protected]>

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

---
 ...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
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 +35 -0
new file mode 100644
index 000000000000..deb6dfbe1c52
@@ -0,0 +1,35 @@
+From 9800beec79d13690a80f1796d67be8346c31b27d Mon Sep 17 00:00:00 2001
+From: Max Krummenacher <[email protected]>
+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 <[email protected]>
+---
+ 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
+
meta-ti-bsp/recipes-bsp/powervr-drivers/ti-img-rogue-driver_23.3.6512818.bb +0 -0
index 34c22cb2adf5..a7318fd6cf9c 100644
@@ -15,7 +15,10 @@ DEPENDS = "virtual/kernel"
 

meta-ti-bsp/recipes-bsp/powervr-drivers/ti-img-rogue-driver_23.3.6512818.bb DEPENDS = "virtual/kernel" · line 24

Quoted 10 lines
meta-ti-bsp/recipes-bsp/powervr-drivers/ti-img-rogue-driver_23.3.6512818.bb +4 -1
 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.