Arthur Heymans has submitted this change. ( https://review.coreboot.org/c/coreboot/+/81658?usp=email )
Change subject: arch/arm64: Use -mno-implicit-float with clang ......................................................................
arch/arm64: Use -mno-implicit-float with clang
This fixes building inline assembly that uses SIMD registers. This is for instance the case in the vboot library.
Change-Id: I24fa9d9f81430ea3ecd40de4304a10c6e235fece Signed-off-by: Arthur Heymans arthur@aheymans.xyz Reviewed-on: https://review.coreboot.org/c/coreboot/+/81658 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Julius Werner jwerner@chromium.org --- M toolchain.mk M util/xcompile/xcompile 2 files changed, 6 insertions(+), 1 deletion(-)
Approvals: Julius Werner: Looks good to me, approved build bot (Jenkins): Verified
diff --git a/toolchain.mk b/toolchain.mk index f985e88..77fb46e 100644 --- a/toolchain.mk +++ b/toolchain.mk @@ -60,7 +60,7 @@ ARCHDIR-ppc64 := ppc64
CFLAGS_arm += -CFLAGS_arm64 += -mgeneral-regs-only +CFLAGS_arm64 += CFLAGS_riscv += CFLAGS_x86_32 += CFLAGS_x86_64 += -mcmodel=large -mno-red-zone diff --git a/util/xcompile/xcompile b/util/xcompile/xcompile index 13ed48b..3fb0cb7 100755 --- a/util/xcompile/xcompile +++ b/util/xcompile/xcompile @@ -256,6 +256,11 @@ testld "$GCC" "$FLAGS_GCC" "${GCCPREFIX}ld${LINKER_SUFFIX}" \ "$LDFLAGS --fix-cortex-a53-843419" && \ LDFLAGS_ARM64_A53_ERRATUM_843419+=" --fix-cortex-a53-843419" + # https://bugs.llvm.org/show_bug.cgi?id=30792 + # LLVM/clang runs into problems when encountering SIMD registers in assembly + # with -mgeneral-regs-only. -mno-implicit-float achieves the same though. + CFLAGS_GCC="$CFLAGS_GCC -mgeneral-regs-only" && + CFLAGS_CLANG="$CFLAGS_CLANG -mno-implicit-float" ;; riscv) testcc "$GCC" "$FLAGS_GCC -march=rv64iadc_zicsr_zifencei" &&