Skip to contentSkip to conversation

CI: remove meta-clang

PATCH Applied Jon Mason 2 participants 6 messages Oct 20, 2025 – Oct 21, 2025

lore
Share & tools
lore

Jon Mason

author
#0 lore raw

PATCH 1/5 CI: remove meta-clang

Now that clang is in core, we don't need to use meta-clang anymore. Also, use PREFERRED_TOOLCHAIN_TARGET to specify the toolchain to use.

---
 ci/clang.yml    | 6 +-----
 ci/gcc.yml      | 4 ++--
 ci/update-repos | 1 -
 3 files changed, 3 insertions(+), 8 deletions(-)
ci/clang.yml +1 -5
index 402292a6b86d..dfe0c36616d0 100644
@@ -3,10 +3,6 @@
 header:
   version: 14
 
-repos:
-  meta-clang:
-    url: https://github.com/kraj/meta-clang
-
 local_conf_header:
   toolchain: |
-    TOOLCHAIN = "clang"
+    PREFERRED_TOOLCHAIN_TARGET = "clang"
ci/gcc.yml +2 -2
index 1f368c24dcb1..61e1d0e17791 100644
@@ -3,7 +3,7 @@
 header:
   version: 14
 
-#NOTE: This is the default for poky.  This is only being added for completeness/clarity
+#NOTE: This is the default.  This is only being added for completeness/clarity
 local_conf_header:
   toolchain: |
-    TOOLCHAIN = "gcc"
+    PREFERRED_TOOLCHAIN_TARGET = "gcc"
ci/update-repos +0 -1
index c44246cc019c..e70ed0d963c6 100755
@@ -23,7 +23,6 @@ repositories = (
     "https://git.yoctoproject.org/poky",
     "https://git.openembedded.org/meta-openembedded",
     "https://git.yoctoproject.org/meta-virtualization",
-    "https://github.com/kraj/meta-clang",
 )
 
 if __name__ == "__main__":
Signature · 1 line
2.50.1 (Apple Git-155)
author
#1 lore raw

PATCH 2/5 arm/trusted-firmware-a: remove forcing of gcc for qemuarm-secureboot

clang is now working for qemuarm-secureboot. Remove the forcing of gcc and clean-up a white space issue.

---
 .../trusted-firmware-a/trusted-firmware-a_%.bbappend        | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a_%.bbappend +1 -5
index d996d83beb1f..e80279d63bae 100644
@@ -1,10 +1,6 @@
 COMPATIBLE_MACHINE:qemuarm64-secureboot = "qemuarm64-secureboot"
 COMPATIBLE_MACHINE:qemuarm-secureboot = "qemuarm-secureboot"
 
-#FIXME - clang fails to build tfa for qemuarm-secureboot, and possibly other
-# arm/aarch32.  This is a known testing hole in TF-A.
-TOOLCHAIN:qemuarm-secureboot = "gcc"
-
 # Enable passing TOS_FW_CONFIG from FIP package to Trusted OS.
 FILESEXTRAPATHS:prepend:qemuarm64-secureboot := "${THISDIR}/files:"
 SRC_URI:append:qemuarm64-secureboot = " \
@@ -53,7 +49,7 @@ EXTRA_OEMAKE:append:arm:qemuall = " \
 # When using OP-TEE SPMC specify the SPMC manifest file.
 EXTRA_OEMAKE:append:qemuarm64-secureboot = "${@bb.utils.contains('MACHINE_FEATURES', 'arm-ffa', \
     'QEMU_TOS_FW_CONFIG_DTS=${S}/plat/qemu/fdts/optee_spmc_manifest.dts', '', d)}"
-     
+
 do_compile:append:qemuarm64-secureboot() {
     # Create a secure flash image for booting AArch64 Qemu. See:
     # https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git/tree/docs/plat/qemu.rst
Signature · 1 line
2.50.1 (Apple Git-155)
author
#2 lore raw

PATCH 3/5 arm/optee-ftpm: enable clang compilation

In reply to Jon Mason

Remove the forcing of GCC in the recipe, and make the changes necessary to get clang working.

---
 meta-arm/recipes-security/optee-ftpm/optee-ftpm_4.7.0.bb | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
meta-arm/recipes-security/optee-ftpm/optee-ftpm_4.7.0.bb +5 -4
index 756aeec6d6a1..9164f31bbc91 100644
@@ -8,16 +8,14 @@ COMPATIBLE_MACHINE:qemuarm64 = "qemuarm64"
 COMPATIBLE_MACHINE:qemuarm64-secureboot = "qemuarm64"
 COMPATIBLE_MACHINE:qemuarm-secureboot = "qemuarm"
 
-#FIXME - doesn't currently work with clang
-TOOLCHAIN = "gcc"
-
 inherit deploy python3native
 
 LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=5a3925ece0806073ae9ebbb08ff6f11e"
 LIC_FILES_CHKSUM += "file://optee-ta/LICENSE;md5=5a3925ece0806073ae9ebbb08ff6f11e"
 
-DEPENDS = "python3-pyelftools-native optee-os-tadevkit python3-cryptography-native "
+DEPENDS = "python3-pyelftools-native optee-os-tadevkit python3-cryptography-native"
+DEPENDS:append:toolchain-clang = " lld-native"
 
 FTPM_UUID = "bc50d971-d4c9-42c4-82cb-343fb7f37896"
 
@@ -49,6 +47,7 @@ TEEC_EXPORT = "${STAGING_DIR_HOST}${prefix}"
 TA_DEV_KIT_DIR = "${STAGING_INCDIR}/optee/export-user_ta"
 
 EXTRA_OEMAKE += '\
+    COMPILER=${TOOLCHAIN} \
     TA_DEV_KIT_DIR=${TA_DEV_KIT_DIR} \
     CROSS_COMPILE=${TARGET_PREFIX} \
     CFG_MS_TPM_20_REF="${S}" \
@@ -59,6 +58,8 @@ EXTRA_OEMAKE:append:aarch64:qemuall = "\
     CFG_ARM64_ta_arm64=y \
 "
 
+CFLAGS:append:toolchain-clang = " -Wno-unknown-warning-option"
+
 # 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.50.1 (Apple Git-155)
author
#3 lore raw

PATCH 4/5 arm/edk2-firmware: move the gcc toolchain force to the versioned recipe

In reply to Jon Mason

Hopefully this issue can be fixed in a newer release. Move the toolchain forcing to the versioned so that it can be tracked easier.

---
 meta-arm/recipes-bsp/uefi/edk2-firmware.inc       | 3 ---
 meta-arm/recipes-bsp/uefi/edk2-firmware_202508.bb | 5 ++++-
 2 files changed, 4 insertions(+), 4 deletions(-)
meta-arm/recipes-bsp/uefi/edk2-firmware.inc +0 -3
index a5590d3b7274..8b6f153a836c 100644
@@ -82,9 +82,6 @@ EDK_COMPILER:toolchain-clang = "CLANGDWARF"
 export CLANG38_AARCH64_PREFIX = "${TARGET_PREFIX}"
 export CLANG38_ARM_PREFIX = "${TARGET_PREFIX}"
 
-#FIXME - arm32 doesn't work with clang due to a linker issue
-TOOLCHAIN:arm = "gcc"
-
 do_configure:prepend() {
     sed -i -e "s#-target ${HOST_ARCH}-linux-gnu.*#-target ${HOST_SYS}#" ${S}/BaseTools/Conf/tools_def.template
 }
meta-arm/recipes-bsp/uefi/edk2-firmware_202508.bb +4 -1
index 6a82835f054c..7d766d594d85 100644
@@ -3,4 +3,7 @@ require recipes-bsp/uefi/edk2-firmware.inc
 SRCREV_edk2           ?= "d46aa46c8361194521391aa581593e556c707c6e"
 SRCREV_edk2-platforms ?= "d82aa92c1d360c1b53ccad4dc45bdd8164a560d5"
 
-SRC_URI += " file://edk2_fix_epoch.patch"
+SRC_URI += "file://edk2_fix_epoch.patch"
+
+#FIXME - arm32 doesn't work with clang due to a linker issue
+TOOLCHAIN:arm = "gcc"
Signature · 1 line
2.50.1 (Apple Git-155)
author
#4 lore raw

PATCH 5/5 arm/sgi575: force gcc for tf-a

In reply to Jon Mason

trusted-firmware a has a compile error when building with clang. Since this platform is EOL'ed and we're not currently building this platform with clang in CI, the best option is to force GCC for it.

---
 .../trusted-firmware-a/trusted-firmware-a-sgi575.inc       | 7 +++++++
 1 file changed, 7 insertions(+)
meta-arm-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a-sgi575.inc +7 -0
index 01cc67bb32e3..c1f16d5499e8 100644
@@ -17,3 +17,10 @@ EXTRA_OEMAKE += "TRUSTED_BOARD_BOOT=1 GENERATE_COT=1 ARM_ROTPK_LOCATION=devel_rs
 # the provided cot-dt2c.
 EXTRA_OEMAKE += "POETRY=''"
 DEPENDS += "cot-dt2c-native"
+
+# When compiling tf-a with clang, multiple errors are being seen in the
+# ASM files:
+#   error: instruction requires: fp-armv8
+# Given that this is platform is EOLed, forcing it to use GCC and not
+# reporting upstream
+TOOLCHAIN = "gcc"
Signature · 1 line
2.50.1 (Apple Git-155)
Applied
#5 lore raw
In reply to Jon Mason
Quoted 4 lines · Jon Mason

Now that clang is in core, we don't need to use meta-clang anymore. Also, use PREFERRED_TOOLCHAIN_TARGET to specify the toolchain to use.

Applied, thanks!

[1/5] CI: remove meta-clang

      commit: 31455d75d1d91755bfc6481d18e8dc6b379d21c3
[2/5] arm/trusted-firmware-a: remove forcing of gcc for qemuarm-secureboot
      commit: 29bbc0bbf70e32b7f95a7755a4ede8d6ef28d4e7
[3/5] arm/optee-ftpm: enable clang compilation
      commit: b0325ba0f0874c79961c371f9df78e35a577a9a5
[4/5] arm/edk2-firmware: move the gcc toolchain force to the versioned recipe
      commit: 4d980ba25bceb1b872ae41d3399d1bc4dd2ace96
[5/5] arm/sgi575: force gcc for tf-a
      commit: 4300ff31a76c72833a5acb663fae5078dafdf005

Best regards,

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