Message ID | 20211203132607.2648640-1-ross.burton@arm.com |
---|---|
State | New |
Headers | show |
Series | [v2,1/3] arm/edk2-firmware: correctly set the target prefix in Clang builds | expand |
On Fri, 3 Dec 2021 13:26:05 +0000, Ross Burton wrote: > We set GCC5_AARCH64_PREFIX so the tools are prefixed correctly in GCC > builds, but didn't set CLANG38_AARCH64_PREFIX. This meant the clang build > used the host objcopy, which may not know about the target architecture. > > Also these can just be the prefix and not a full path, as the binaries > are on $PATH. > > [...] Applied, thanks! [1/3] arm/edk2-firmware: correctly set the target prefix in Clang builds commit: fb9232c4e16c96808bf69579098063b0a900066a [2/3] arm/edk2-firmware: force debug builds when using Clang commit: a0296bf8a0966585db72a8c6dd5fdc67ecf8e088 [3/3] CI: also build qemu-generic-arm64 for clang commit: e329253758bc0f9ad4be3c78810e5d3ab0f01e2b Best regards,
diff --git a/meta-arm/recipes-bsp/uefi/edk2-firmware.inc b/meta-arm/recipes-bsp/uefi/edk2-firmware.inc index 7072d1b4..cfe30652 100644 --- a/meta-arm/recipes-bsp/uefi/edk2-firmware.inc +++ b/meta-arm/recipes-bsp/uefi/edk2-firmware.inc @@ -58,7 +58,6 @@ LDFLAGS[unexport] = "1" do_configure[cleandirs] += "${B}" # Set variables as per envsetup -export GCC5_AARCH64_PREFIX = "${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}" export PACKAGES_PATH = "${S}:${S}/edk2-platforms" export WORKSPACE = "${B}" export EDK_TOOLS_PATH = "${S}/BaseTools" @@ -68,7 +67,10 @@ export CONF_PATH = "${S}/Conf" export BTOOLS_PATH = "${EDK_TOOLS_PATH}/BinWrappers/PosixLike" EDK_COMPILER ?= "GCC5" +export GCC5_AARCH64_PREFIX = "${TARGET_PREFIX}" + EDK_COMPILER:toolchain-clang = "CLANG38" +export CLANG38_AARCH64_PREFIX = "${TARGET_PREFIX}" do_configure:prepend() { sed -i -e "s#-target ${HOST_ARCH}-linux-gnu*#-target ${HOST_SYS}#" ${S}/BaseTools/Conf/tools_def.template
We set GCC5_AARCH64_PREFIX so the tools are prefixed correctly in GCC builds, but didn't set CLANG38_AARCH64_PREFIX. This meant the clang build used the host objcopy, which may not know about the target architecture. Also these can just be the prefix and not a full path, as the binaries are on $PATH. Signed-off-by: Ross Burton <ross.burton@arm.com> --- meta-arm/recipes-bsp/uefi/edk2-firmware.inc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)