From 148f1d563c69fe66adcaf0fbc6ac1675ee3fcef1 Mon Sep 17 00:00:00 2001 From: Ian Leonard Date: Tue, 28 Jul 2020 02:52:07 +0000 Subject: [PATCH] arch.aarch64: don't attempt to use the LSE cpu feature ARMv8.0-A cpus have an optional LSE feature. This is mandatory in ARMv8.1-A. By default, gcc will attempt to build support for runtime detection of the LSE feature on ARMv8.0-A. This causes build failures when attempting to create a 64-bit userland. Test packages for this failure include gdb and mesa. Errors manifest as undefined references to "__aarch64_cas4_acq_rel" or "__aarch64_swp4_acq_rel" at compile time. Disable runtime detection to always use its fallback by adding -mno-outline-atomics to cflags. Signed-off-by: Ian Leonard --- config/arch.aarch64 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config/arch.aarch64 b/config/arch.aarch64 index f9b1ea70a1..f77ae507ea 100644 --- a/config/arch.aarch64 +++ b/config/arch.aarch64 @@ -23,5 +23,7 @@ # setup ARCH specific *FLAGS TARGET_CFLAGS="-march=${TARGET_VARIANT}${TARGET_CPU_FLAGS} -mabi=lp64 -Wno-psabi -mtune=$TARGET_CPU" +# Disable runtime checking support of ARMv8.0's optional LSE feature. Breaks gdb and mesa compile. + TARGET_CFLAGS="${TARGET_CFLAGS} -mno-outline-atomics" TARGET_LDFLAGS="-march=${TARGET_VARIANT}${TARGET_CPU_FLAGS} -mtune=$TARGET_CPU" GCC_OPTS="--with-abi=lp64 --with-arch=$TARGET_VARIANT"