[meta-arm,4/6] trusted-firmware-a: enable clang support

Submitted by brett.warren@arm.com on Oct. 14, 2020, 11:35 a.m. | Patch ID: 177244

Details

Message ID zqRO.1602675340230154946.JbqS@lists.yoctoproject.org
State New
Headers show

Commit Message

brett.warren@arm.com Oct. 14, 2020, 11:35 a.m.
The CC and LD parameters are used to point make to the currently
used compiler and linkers.

This change enables TFA to be compiled successfully when
TOOLCHAIN=clang.

Change-Id: Ice465318b8c9b2b69c08fe4f48f6d36c610978f0
Signed-off-by: Brett Warren <brett.warren@arm.com>
---
.../trusted-firmware-a/trusted-firmware-a.inc         | 11 +++++++++++
1 file changed, 11 insertions(+)

--
2.17.1
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#1199): https://lists.yoctoproject.org/g/meta-arm/message/1199
Mute This Topic: https://lists.yoctoproject.org/mt/77503227/3617530
Group Owner: meta-arm+owner@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/meta-arm/unsub [oe-patchwork@oe-patch.openembedded.org]
-=-=-=-=-=-=-=-=-=-=-=-

Patch hide | download patch | download mbox

diff --git a/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc b/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc
index 8b19d68..98085d0 100644
--- a/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc
+++ b/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc
@@ -78,6 +78,17 @@  do_configure[noexec] = "1"
DEPENDS_append = " dtc-native openssl-native"
DEPENDS_append_aarch64_qemuall ?= " optee-os"

+# CC and LD introduce arguments which conflict with those otherwise provided by
+# this recipe. The heads of these variables excluding those arguments
+# are therefore used instead.
+def remove_options_tail (in_string):
+    from itertools import takewhile
+    return ' '.join(takewhile(lambda x: not x.startswith('-'), in_string.split(' ')))
+
+EXTRA_OEMAKE += "LD=${@remove_options_tail(d.getVar('LD'))}"
+
+EXTRA_OEMAKE += "CC=${@remove_options_tail(d.getVar('CC'))}"
+
EXTRA_OEMAKE += "V=1"

# Add platform parameter