[v2,2/3] arm-toolchain: Support linux-arm64-ack build with Android Clang

Message ID 20220118170350.23361-2-anders.dellien@arm.com
State New
Headers show
Series [v2,1/3] arm-toolchain: Fetch prebuilt Android Clang, version r416183b | expand

Commit Message

Anders Dellien Jan. 18, 2022, 5:03 p.m. UTC
This commit introduces a configuration variable, LINUX_ACK_TOOLCHAIN_CLANG,
that (if set) switches the kernel build to use the Android Clang compiler

Change-Id: Iab362916159bf6e8096061f1b7281a7513001d61
---
 .../recipes-kernel/linux/linux-arm64-ack-clang.inc        | 8 ++++++++
 .../recipes-kernel/linux/linux-arm64-ack_%.bbappend       | 3 +++
 2 files changed, 11 insertions(+)
 create mode 100644 meta-arm-bsp/recipes-kernel/linux/linux-arm64-ack-clang.inc
 create mode 100644 meta-arm-bsp/recipes-kernel/linux/linux-arm64-ack_%.bbappend

Patch

diff --git a/meta-arm-bsp/recipes-kernel/linux/linux-arm64-ack-clang.inc b/meta-arm-bsp/recipes-kernel/linux/linux-arm64-ack-clang.inc
new file mode 100644
index 00000000..c5b74634
--- /dev/null
+++ b/meta-arm-bsp/recipes-kernel/linux/linux-arm64-ack-clang.inc
@@ -0,0 +1,8 @@ 
+# Clang-specific configuration of kernel build
+
+# We need to add this dependency as the kernel configuration depends on the compiler
+do_kernel_configme[depends] += "androidclang-native:do_populate_sysroot"
+
+DEPENDS:append = " androidclang-native"
+
+KERNEL_CC = "${CCACHE}clang ${HOST_CC_KERNEL_ARCH}"
diff --git a/meta-arm-bsp/recipes-kernel/linux/linux-arm64-ack_%.bbappend b/meta-arm-bsp/recipes-kernel/linux/linux-arm64-ack_%.bbappend
new file mode 100644
index 00000000..301041bc
--- /dev/null
+++ b/meta-arm-bsp/recipes-kernel/linux/linux-arm64-ack_%.bbappend
@@ -0,0 +1,3 @@ 
+LINUX_ARM64_ACK_TOOLCHAIN_REQUIRE = "${@oe.utils.ifelse(d.getVar('LINUX_ACK_TOOLCHAIN_CLANG'), 'linux-arm64-ack-clang.inc', '')}"
+
+require ${LINUX_ARM64_ACK_TOOLCHAIN_REQUIRE}