Skip to contentSkip to conversation

sbsa-acs: Adjust target tuple for clang

PATCH Superseded Khem Raj 2 participants 3 messages Jun 10, 2021

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/1 sbsa-acs: Adjust target tuple for clang

Current settings assume glibc tuples and hence when building with musl C library clang can not find correct cross tools and system headers and libraries

Cc Jon Mason <[email protected]>
Cc Ross Burton <[email protected]>
---
 meta-arm/recipes-test/sbsa-acs/sbsa-acs_3.0.bb | 5 +++++
 1 file changed, 5 insertions(+)
meta-arm/recipes-test/sbsa-acs/sbsa-acs_3.0.bb +5 -0
index 173cfa7..20d6534 100644
@@ -24,6 +24,11 @@ EDK2_EXTRA_BUILD = "--module ShellPkg/Application/sbsa-acs/uefi_app/SbsaAvs.inf"
 
 PACKAGES_PATH .= ":${S}/edk2-libc"
 
+do_configure_prepend_libc-musl() {
+    sed -i -e "s/-target arm-linux-gnueabi/-target arm-linux-musleabi/g" ${S}/BaseTools/Conf/tools_def.template
+    sed -i -e "s/-target aarch64-linux-gnu/-target aarch64-linux-musl/g" ${S}/BaseTools/Conf/tools_def.template
+}
+
 do_install() {
     install -d ${D}/firmware
     install ${B}/Build/${EDK2_PLATFORM}/${EDK2_BUILD_MODE}_${EDK_COMPILER}/*/Sbsa.efi ${D}/firmware/
Signature · 1 line
2.32.0
#1 lore raw

As those files are part of EDK2 not ACS, this should be in the edk2-firmware recipe itself.

Which leads to the questions 1) why is this a problem on acs and not edk2-firmware, and 2) how can we fix this upstream?

Ross

Quoted 34 lines · Khem Raj

Current settings assume glibc tuples and hence when building with musl C library clang can not find correct cross tools and system headers and libraries

Cc Jon Mason <[email protected]>
Cc Ross Burton <[email protected]>
---
 meta-arm/recipes-test/sbsa-acs/sbsa-acs_3.0.bb | 5 +++++
 1 file changed, 5 insertions(+)
meta-arm/recipes-test/sbsa-acs/sbsa-acs_3.0.bb +5 -1
index 173cfa7..20d6534 100644
@@ -24,6 +24,11 @@ EDK2_EXTRA_BUILD = "--module ShellPkg/Application/sbsa-acs/uefi_app/SbsaAvs.inf"
 
 PACKAGES_PATH .= ":${S}/edk2-libc"
 
+do_configure_prepend_libc-musl() {
+    sed -i -e "s/-target arm-linux-gnueabi/-target arm-linux-musleabi/g" ${S}/BaseTools/Conf/tools_def.template
+    sed -i -e "s/-target aarch64-linux-gnu/-target aarch64-linux-musl/g" ${S}/BaseTools/Conf/tools_def.template
+}
+
 do_install() {
     install -d ${D}/firmware
     install ${B}/Build/${EDK2_PLATFORM}/${EDK2_BUILD_MODE}_${EDK_COMPILER}/*/Sbsa.efi ${D}/firmware/
--

2.32.0

author
#2 lore raw
Quoted 7 lines · Ross Burton

As those files are part of EDK2 not ACS, this should be in the edk2-firmware recipe itself.

Which leads to the questions 1) why is this a problem on acs and not edk2-firmware, and 2) how can we fix this upstream?

this patch did not fix the issue entirely see
https://errors.yoctoproject.org/Errors/Details/586266/

the issue is that when cross compiling with OE we have to match -target option to
TARGET_SYS variable. So some sed stuff which can insert TARGET_SYS would be required. Upstream assumes cross compile tuples, which is limiting, they could
offer an option to accept it from environment in that case we can set it via recipe.

Quoted 37 lines

Ross

Quoted 34 lines · Khem Raj

Current settings assume glibc tuples and hence when building with musl C library clang can not find correct cross tools and system headers and libraries

Cc Jon Mason <[email protected]>
Cc Ross Burton <[email protected]>
---
 meta-arm/recipes-test/sbsa-acs/sbsa-acs_3.0.bb | 5 +++++
 1 file changed, 5 insertions(+)
meta-arm/recipes-test/sbsa-acs/sbsa-acs_3.0.bb +5 -1
index 173cfa7..20d6534 100644
@@ -24,6 +24,11 @@ EDK2_EXTRA_BUILD = "--module ShellPkg/Application/sbsa-acs/uefi_app/SbsaAvs.inf"
 
 PACKAGES_PATH .= ":${S}/edk2-libc"
 
+do_configure_prepend_libc-musl() {
+    sed -i -e "s/-target arm-linux-gnueabi/-target arm-linux-musleabi/g" ${S}/BaseTools/Conf/tools_def.template
+    sed -i -e "s/-target aarch64-linux-gnu/-target aarch64-linux-musl/g" ${S}/BaseTools/Conf/tools_def.template
+}
+
 do_install() {
     install -d ${D}/firmware
     install ${B}/Build/${EDK2_PLATFORM}/${EDK2_BUILD_MODE}_${EDK_COMPILER}/*/Sbsa.efi ${D}/firmware/
--

2.32.0