sbsa-acs: Fix build with clang 12
PATCH 1/2 sbsa-acs: Fix build with clang 12
Signed-off-by Khem Raj <[email protected]>
--- .../0001-pal_uefi-Fix-enum-conversion.patch | 31 +++++++++++++++++++ .../recipes-test/sbsa-acs/sbsa-acs_3.0.bb | 3 +- 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 meta-arm/recipes-test/sbsa-acs/sbsa-acs/0001-pal_uefi-Fix-enum-conversion.patch
meta-arm/recipes-test/sbsa-acs/sbsa-acs/0001-pal_uefi-Fix-enum-conversion.patch new file +31 -0
@@ -0,0 +1,31 @@ +From d9101f353b16bf82fb0e8f1dac573aca97a6f3a7 Mon Sep 17 00:00:00 2001 +From: Khem Raj <[email protected]> +Date: Tue, 6 Apr 2021 23:57:19 -0700 +Subject: [PATCH] pal_uefi: Fix enum conversion + +clang complains about enum type mismatches +al_uefi/src/pal_gic.c:224:20: error: implicit conversion from enumeration type 'INTR_TRIGGER_INFO_TYPE_e' to different enumeration type 'EFI_HARDWARE_INTERRUPT2_TRIGGER_TYPE' [-Werror,-Wenum-conversion] + +Upstream-Status: Pending + +Signed-off-by: Khem Raj <[email protected]> +--- + platform/pal_uefi/src/pal_gic.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/ShellPkg/Application/sbsa-acs/platform/pal_uefi/src/pal_gic.c b/ShellPkg/Application/sbsa-acs/platform/pal_uefi/src/pal_gic.c +index 7ce343d..b61aefc 100644 +--- a/ShellPkg/Application/sbsa-acs/platform/pal_uefi/src/pal_gic.c ++++ b/ShellPkg/Application/sbsa-acs/platform/pal_uefi/src/pal_gic.c +@@ -221,7 +221,7 @@ pal_gic_set_intr_trigger(UINT32 int_id, INTR_TRIGGER_INFO_TYPE_e trigger_type) + Status = gInterrupt2->SetTriggerType ( + gInterrupt2, + int_id, +- trigger_type ++ (EFI_HARDWARE_INTERRUPT2_TRIGGER_TYPE)trigger_type + ); + + if (EFI_ERROR(Status)) +-- +2.31.1 +
meta-arm/recipes-test/sbsa-acs/sbsa-acs_3.0.bb +2 -1
@@ -7,7 +7,8 @@ LIC_FILES_CHKSUM += "file://ShellPkg/Application/sbsa-acs/LICENSE.md;md5=2a94494 SRC_URI += "git://github.com/ARM-software/sbsa-acs;destsuffix=edk2/ShellPkg/Application/sbsa-acs;protocol=https;branch=release;name=acs \ git://github.com/tianocore/edk2-libc;destsuffix=edk2/edk2-libc;protocol=https;branch=master;name=libc \ - file://shell.patch" + file://shell.patch \ + file://0001-pal_uefi-Fix-enum-conversion.patch" SRCREV_acs = "1b3a37214fe6809e07e471f79d1ef856461bc803" SRCREV_libc = "61687168fe02ac4d933a36c9145fdd242ac424d1"
Signature · 1 line
2.31.1
PATCH 2/2 sbsa-acs: Always use BFD linker
Signed-off-by Khem Raj <[email protected]>
--- .../sbsa-acs/sbsa-acs/use_bfd_linker.patch | 22 +++++++++++++++++++ .../recipes-test/sbsa-acs/sbsa-acs_3.0.bb | 3 ++- 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 meta-arm/recipes-test/sbsa-acs/sbsa-acs/use_bfd_linker.patch
meta-arm/recipes-test/sbsa-acs/sbsa-acs/use_bfd_linker.patch new file +22 -0
@@ -0,0 +1,22 @@ +Enforce using good old BFD linker + +some distros may use gold as system linker and it crashes while linking the app + +TOPDIR/build/tmpfs/work/qemuarm64-yoe-linux/sbsa-acs/3.0-r0/recipe-sysroot-native/usr/bin/aarch64-yoe-linux/../../libexec/aarch64-yoe-linux/gcc/aarch64-yoe-linux/11.0.1/ld: error: TOPDIR/build/tmpfs/work/qemuarm64-yoe-linux/sbsa-acs/3.0-r0/edk2/BaseTools/Scripts/GccBase.lds:54:10: INFO section type is unsupported +TOPDIR/build/tmpfs/work/qemuarm64-yoe-linux/sbsa-acs/3.0-r0/recipe-sysroot-native/usr/bin/aarch64-yoe-linux/../../libexec/aarch64-yoe-linux/gcc/aarch64-yoe-linux/11.0.1/ld: error: TOPDIR/build/tmpfs/work/qemuarm64-yoe-linux/sbsa-acs/3.0-r0/edk2/BaseTools/Scripts/GccBase.lds:66:14: INFO section type is unsupported +TOPDIR/build/tmpfs/work/qemuarm64-yoe-linux/sbsa-acs/3.0-r0/recipe-sysroot-native/usr/bin/aarch64-yoe-linux/../../libexec/aarch64-yoe-linux/gcc/aarch64-yoe-linux/11.0.1/ld: internal error in do_layout, at ../../gold/object.cc:1939 +collect2: error: ld returned 1 exit status + +Upstream-Status: Pending +Signed-off-by: Khem Raj <[email protected]> +--- a/BaseTools/Conf/tools_def.template ++++ b/BaseTools/Conf/tools_def.template +@@ -1926,7 +1926,7 @@ DEFINE GCC_ARM_CC_XIPFLAGS = -mn + DEFINE GCC_AARCH64_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -mlittle-endian -fno-short-enums -fverbose-asm -funsigned-char -ffunction-sections -fdata-sections -Wno-address -fno-asynchronous-unwind-tables -fno-unwind-tables -fno-pic -fno-pie -ffixed-x18 + DEFINE GCC_AARCH64_CC_XIPFLAGS = -mstrict-align -mgeneral-regs-only + DEFINE GCC_DLINK_FLAGS_COMMON = -nostdlib --pie +-DEFINE GCC_DLINK2_FLAGS_COMMON = -Wl,--script=$(EDK_TOOLS_PATH)/Scripts/GccBase.lds ++DEFINE GCC_DLINK2_FLAGS_COMMON = -fuse-ld=bfd -Wl,--script=$(EDK_TOOLS_PATH)/Scripts/GccBase.lds + DEFINE GCC_IA32_X64_DLINK_COMMON = DEF(GCC_DLINK_FLAGS_COMMON) --gc-sections + DEFINE GCC_ARM_AARCH64_DLINK_COMMON= -Wl,--emit-relocs -nostdlib -Wl,--gc-sections -u $(IMAGE_ENTRY_POINT) -Wl,-e,$(IMAGE_ENTRY_POINT),-Map,$(DEST_DIR_DEBUG)/$(BASE_NAME).map + DEFINE GCC_ARM_DLINK_FLAGS = DEF(GCC_ARM_AARCH64_DLINK_COMMON) -z common-page-size=0x20 -Wl,--pic-veneer
meta-arm/recipes-test/sbsa-acs/sbsa-acs_3.0.bb +2 -1
@@ -8,7 +8,8 @@ LIC_FILES_CHKSUM += "file://ShellPkg/Application/sbsa-acs/LICENSE.md;md5=2a94494 SRC_URI += "git://github.com/ARM-software/sbsa-acs;destsuffix=edk2/ShellPkg/Application/sbsa-acs;protocol=https;branch=release;name=acs \ git://github.com/tianocore/edk2-libc;destsuffix=edk2/edk2-libc;protocol=https;branch=master;name=libc \ file://shell.patch \ - file://0001-pal_uefi-Fix-enum-conversion.patch" + file://0001-pal_uefi-Fix-enum-conversion.patch \ + file://use_bfd_linker.patch" SRCREV_acs = "1b3a37214fe6809e07e471f79d1ef856461bc803" SRCREV_libc = "61687168fe02ac4d933a36c9145fdd242ac424d1"
Signature · 1 line
2.31.1