Skip to contentSkip to conversation

arm/optee-ftpm: silence new compiler errors from GCC 14.1

PATCH Applied Ross Burton 2 participants 4 messages Jun 18, 2024 – Jun 19, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 arm/optee-ftpm: silence new compiler errors from GCC 14.1

GCC 14.1 is stricter with code validation and the build now fails. However as upstream appear to be about to remove this source entirely from upstream[1] I didn't want to spend long investigating this if upstream changes will obsolete it, so just silence the errors for now.

[1] https://github.com/microsoft/ms-tpm-20-ref/pull/108

---
 meta-arm/recipes-security/optee-ftpm/optee-ftpm_git.bb | 5 +++++
 1 file changed, 5 insertions(+)
meta-arm/recipes-security/optee-ftpm/optee-ftpm_git.bb +5 -0
index d5f6e01d..9546215a 100644
@@ -42,6 +42,11 @@ EXTRA_OEMAKE:append:aarch64:qemuall = "\
     CFG_ARM64_ta_arm64=y \
 "
 
+# TODO: GCC 14.1 is finding genuine issues with the code but as upstream appear to be removing
+# the code we're building (https://github.com/microsoft/ms-tpm-20-ref/pull/108) lets just
+# ignore them for now.
+CFLAGS += "-Wno-implicit-function-declaration -Wno-incompatible-pointer-types"
+
 # python3-cryptography needs the legacy provider, so set OPENSSL_MODULES to the
 # right path until this is relocated automatically.
 export OPENSSL_MODULES="${STAGING_LIBDIR_NATIVE}/ossl-modules"
Signature · 1 line
2.34.1
#1 lore raw

PATCH 2/3 arm-bsp/firmware-image-juno: use UNPACKDIR

Update the source/fetching for the new S/UNPACKDIR behaviour. This patch is complicated by the recipe using UNPACK_DIR already, so I changed that to avoid confusion.

---
 .../recipes-bsp/images/firmware-image-juno.bb | 29 ++++++++++---------
 1 file changed, 15 insertions(+), 14 deletions(-)
meta-arm-bsp/recipes-bsp/images/firmware-image-juno.bb +15 -14
index 45f2ec72..0b17b024 100644
@@ -14,7 +14,7 @@ COMPATIBLE_MACHINE = "juno"
 
 LINARO_RELEASE = "19.06"
 
-SRC_URI = "http://releases.linaro.org/members/arm/platforms/${LINARO_RELEASE}/juno-latest-oe-uboot.zip;subdir=${UNPACK_DIR} \
+SRC_URI = "http://releases.linaro.org/members/arm/platforms/${LINARO_RELEASE}/juno-latest-oe-uboot.zip;subdir=${S} \
     file://images-r0.txt \
     file://images-r1.txt \
     file://images-r2.txt \
@@ -23,7 +23,8 @@ SRC_URI = "http://releases.linaro.org/members/arm/platforms/${LINARO_RELEASE}/ju
 SRC_URI[md5sum] = "01b662b81fa409d55ff298238ad24003"
 SRC_URI[sha256sum] = "b8a3909bb3bc4350a8771b863193a3e33b358e2a727624a77c9ecf13516cec82"
 
-UNPACK_DIR = "juno-firmware-${LINARO_RELEASE}"
+FIRMWARE_DIR = "juno-firmware-${LINARO_RELEASE}"
+S = "${UNPACKDIR}/${FIRMWARE_DIR}"
 
 inherit deploy nopackages
 
@@ -33,23 +34,23 @@ do_compile[noexec] = "1"
 # The ${D} is used as a temporary directory and we don't generate any
 # packages for this recipe.
 do_install() {
-    cp -a ${WORKDIR}/${UNPACK_DIR} ${D}
+    cp -a ${S} ${D}/
     cp -f ${RECIPE_SYSROOT}/firmware/bl1-juno.bin \
-        ${D}/${UNPACK_DIR}/SOFTWARE/bl1.bin
+        ${D}/${FIRMWARE_DIR}/SOFTWARE/bl1.bin
 
     cp -f ${RECIPE_SYSROOT}/firmware/fip-juno.bin \
-        ${D}/${UNPACK_DIR}/SOFTWARE/fip.bin
+        ${D}/${FIRMWARE_DIR}/SOFTWARE/fip.bin
 
     cp -f ${RECIPE_SYSROOT}/firmware/scp_romfw_bypass.bin \
-        ${D}/${UNPACK_DIR}/SOFTWARE/scp_bl1.bin
+        ${D}/${FIRMWARE_DIR}/SOFTWARE/scp_bl1.bin
 
     # u-boot environment file
-    cp -f ${WORKDIR}/uEnv.txt ${D}/${UNPACK_DIR}/SOFTWARE/
+    cp -f ${UNPACKDIR}/uEnv.txt ${D}/${FIRMWARE_DIR}/SOFTWARE/
 
     # Juno images list file
-    cp -f ${WORKDIR}/images-r0.txt ${D}/${UNPACK_DIR}/SITE1/HBI0262B/images.txt
-    cp -f ${WORKDIR}/images-r1.txt ${D}/${UNPACK_DIR}/SITE1/HBI0262C/images.txt
-    cp -f ${WORKDIR}/images-r2.txt ${D}/${UNPACK_DIR}/SITE1/HBI0262D/images.txt
+    cp -f ${UNPACKDIR}/images-r0.txt ${D}/${FIRMWARE_DIR}/SITE1/HBI0262B/images.txt
+    cp -f ${UNPACKDIR}/images-r1.txt ${D}/${FIRMWARE_DIR}/SITE1/HBI0262C/images.txt
+    cp -f ${UNPACKDIR}/images-r2.txt ${D}/${FIRMWARE_DIR}/SITE1/HBI0262D/images.txt
 }
 
 do_deploy() {
@@ -59,18 +60,18 @@ do_deploy() {
     # task.
     for f in ${KERNEL_DEVICETREE}; do
         install -m 755 -c ${DEPLOY_DIR_IMAGE}/$(basename $f) \
-            ${D}/${UNPACK_DIR}/SOFTWARE/.
+            ${D}/${FIRMWARE_DIR}/SOFTWARE/
     done
 
     if [ "${INITRAMFS_IMAGE_BUNDLE}" -eq 1 ]; then
         cp -L -f ${DEPLOY_DIR_IMAGE}/Image.gz-initramfs-juno.bin \
-            ${D}/${UNPACK_DIR}/SOFTWARE/Image
+            ${D}/${FIRMWARE_DIR}/SOFTWARE/Image
     else
-        cp -L -f ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE} ${D}/${UNPACK_DIR}/SOFTWARE/
+        cp -L -f ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE} ${D}/${FIRMWARE_DIR}/SOFTWARE/
     fi
 
     # Compress the files
-    tar -C ${D}/${UNPACK_DIR} -zcvf ${WORKDIR}/${PN}.tar.gz ./
+    tar -C ${D}/${FIRMWARE_DIR} -zcvf ${WORKDIR}/${PN}.tar.gz ./
 
     # Deploy the compressed archive to the deploy folder
     install -D -p -m0644 ${WORKDIR}/${PN}.tar.gz ${DEPLOYDIR}/${PN}.tar.gz
Signature · 1 line
2.34.1
#2 lore raw

PATCH 3/3 arm/libts: use UNPACKDIR

In reply to Ross Burton

Single files in SRC_URI are now in UNPACKDIR not WORKDIR.

---
 meta-arm/recipes-security/trusted-services/libts_git.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta-arm/recipes-security/trusted-services/libts_git.bb +1 -1
index 789bde7c..dfcd4bde 100644
@@ -19,7 +19,7 @@ TEE_GROUP_NAME ?= "teeclnt"
 do_install:append () {
     if ${@oe.utils.conditional('VIRTUAL-RUNTIME_dev_manager', 'busybox-mdev', 'false', 'true', d)}; then
         install -d ${D}${nonarch_base_libdir}/udev/rules.d/
-        install -m 755 ${WORKDIR}/tee-udev.rules ${D}${nonarch_base_libdir}/udev/rules.d/
+        install -m 755 ${UNPACKDIR}/tee-udev.rules ${D}${nonarch_base_libdir}/udev/rules.d/
         sed -i -e "s/teeclnt/${TEE_GROUP_NAME}/" ${D}${nonarch_base_libdir}/udev/rules.d/tee-udev.rules
     fi
 
Signature · 1 line
2.34.1
Applied
#3 lore raw
In reply to Ross Burton
Quoted 8 lines · Ross Burton

GCC 14.1 is stricter with code validation and the build now fails. However as upstream appear to be about to remove this source entirely from upstream[1] I didn't want to spend long investigating this if upstream changes will obsolete it, so just silence the errors for now.

[1] https://github.com/microsoft/ms-tpm-20-ref/pull/108

[...]

Applied, thanks!

[1/3] arm/optee-ftpm: silence new compiler errors from GCC 14.1

      commit: 1985604bebacab4ecbc721469d319e1a4a1de1c5
[2/3] arm-bsp/firmware-image-juno: use UNPACKDIR
      commit: 80be96437ee285611a46536d75c7f35a8afe61ec
[3/3] arm/libts: use UNPACKDIR
      commit: 981425c54e36e3414ab1abadd2c7b1f684f2c1ff

Best regards,

Signature · 1 line
Jon Mason <[email protected]>