All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/3] arm/edk2-firmware: correctly set the target prefix in Clang builds
@ 2021-12-03 13:26 Ross Burton
  2021-12-03 13:26 ` [PATCH v2 2/3] arm/edk2-firmware: force debug builds when using Clang Ross Burton
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Ross Burton @ 2021-12-03 13:26 UTC (permalink / raw)
  To: meta-arm

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(-)

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
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v2 2/3] arm/edk2-firmware: force debug builds when using Clang
  2021-12-03 13:26 [PATCH v2 1/3] arm/edk2-firmware: correctly set the target prefix in Clang builds Ross Burton
@ 2021-12-03 13:26 ` Ross Burton
  2021-12-03 13:26 ` [PATCH v2 3/3] CI: also build qemu-generic-arm64 for clang Ross Burton
  2021-12-03 18:24 ` [PATCH v2 1/3] arm/edk2-firmware: correctly set the target prefix in Clang builds Jon Mason
  2 siblings, 0 replies; 4+ messages in thread
From: Ross Burton @ 2021-12-03 13:26 UTC (permalink / raw)
  To: meta-arm

edk2-firmware release builds with clang fail:

MdePkg/Library/UefiMemoryAllocationLib/MemoryAllocationLib.c:142:15:
error: variable 'Status' set but not used [-Werror,-Wunused-but-set-variable]

This is upstream as https://bugzilla.tianocore.org/show_bug.cgi?id=3758,
but until that is resolved we can just force debug builds with clang.

Signed-off-by: Ross Burton <ross.burton@arm.com>
---
 meta-arm/recipes-bsp/uefi/edk2-firmware.inc | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/meta-arm/recipes-bsp/uefi/edk2-firmware.inc b/meta-arm/recipes-bsp/uefi/edk2-firmware.inc
index cfe30652..d8c744df 100644
--- a/meta-arm/recipes-bsp/uefi/edk2-firmware.inc
+++ b/meta-arm/recipes-bsp/uefi/edk2-firmware.inc
@@ -26,6 +26,10 @@ COMPATIBLE_MACHINE ?= "invalid"
 PACKAGE_ARCH = "${MACHINE_ARCH}"
 
 EDK2_BUILD_RELEASE = "1"
+# Release builds don't work with clang yet:
+# https://bugzilla.tianocore.org/show_bug.cgi?id=3758
+EDK2_BUILD_RELEASE:toolchain-clang = "0"
+
 EDK2_PLATFORM      = "unset"
 # build --platform
 EDK2_PLATFORM_DSC  = "unset"
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v2 3/3] CI: also build qemu-generic-arm64 for clang
  2021-12-03 13:26 [PATCH v2 1/3] arm/edk2-firmware: correctly set the target prefix in Clang builds Ross Burton
  2021-12-03 13:26 ` [PATCH v2 2/3] arm/edk2-firmware: force debug builds when using Clang Ross Burton
@ 2021-12-03 13:26 ` Ross Burton
  2021-12-03 18:24 ` [PATCH v2 1/3] arm/edk2-firmware: correctly set the target prefix in Clang builds Jon Mason
  2 siblings, 0 replies; 4+ messages in thread
From: Ross Burton @ 2021-12-03 13:26 UTC (permalink / raw)
  To: meta-arm

Signed-off-by: Ross Burton <ross.burton@arm.com>
---
 .gitlab-ci.yml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index be522fc8..b2a4c438 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -177,7 +177,8 @@ qemu-generic-arm64:
   extends: .build
   parallel:
     matrix:
-      - TESTING: testimage
+      - TOOLCHAINS: [gcc, clang]
+        TESTING: testimage
 
 qemuarm64-secureboot:
   extends: .build
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2 1/3] arm/edk2-firmware: correctly set the target prefix in Clang builds
  2021-12-03 13:26 [PATCH v2 1/3] arm/edk2-firmware: correctly set the target prefix in Clang builds Ross Burton
  2021-12-03 13:26 ` [PATCH v2 2/3] arm/edk2-firmware: force debug builds when using Clang Ross Burton
  2021-12-03 13:26 ` [PATCH v2 3/3] CI: also build qemu-generic-arm64 for clang Ross Burton
@ 2021-12-03 18:24 ` Jon Mason
  2 siblings, 0 replies; 4+ messages in thread
From: Jon Mason @ 2021-12-03 18:24 UTC (permalink / raw)
  To: meta-arm, Ross Burton

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,
-- 
Jon Mason <jon.mason@arm.com>


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-12-03 18:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-03 13:26 [PATCH v2 1/3] arm/edk2-firmware: correctly set the target prefix in Clang builds Ross Burton
2021-12-03 13:26 ` [PATCH v2 2/3] arm/edk2-firmware: force debug builds when using Clang Ross Burton
2021-12-03 13:26 ` [PATCH v2 3/3] CI: also build qemu-generic-arm64 for clang Ross Burton
2021-12-03 18:24 ` [PATCH v2 1/3] arm/edk2-firmware: correctly set the target prefix in Clang builds Jon Mason

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.