From 7e1889ba5b75cb2b2aa81aee62a7bb78a76eeafa Mon Sep 17 00:00:00 2001 From: kan Date: Fri, 7 Apr 2017 22:58:25 +0000 Subject: [PATCH] Do not use -msoft-float with intention of disabling FP on aarch64 GNU GCC does does recognise it as a valid option and we already use -mgeneral-regs-only that has the desired effect. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D10306 --- share/mk/bsd.stand.mk | 2 +- sys/boot/efi/Makefile.inc | 6 +++++- sys/boot/efi/boot1/Makefile | 2 +- sys/boot/efi/fdt/Makefile | 4 +++- sys/boot/efi/libefi/Makefile | 2 +- sys/boot/efi/loader/arch/arm64/Makefile.inc | 2 +- 6 files changed, 12 insertions(+), 6 deletions(-) diff --git a/share/mk/bsd.stand.mk b/share/mk/bsd.stand.mk index b18fd35e78de..43dd8ce55901 100644 --- a/share/mk/bsd.stand.mk +++ b/share/mk/bsd.stand.mk @@ -8,7 +8,7 @@ CFLAGS+= -ffreestanding -Wformat CFLAGS+= ${CFLAGS_NO_SIMD} -D_STANDALONE .if ${MACHINE_CPUARCH} == "riscv" CFLAGS+= -mno-float -.else +.elif ${MACHINE_CPUARCH} != "aarch64" CFLAGS+= -msoft-float .endif diff --git a/sys/boot/efi/Makefile.inc b/sys/boot/efi/Makefile.inc index eac5992a4c40..405f4cd76018 100644 --- a/sys/boot/efi/Makefile.inc +++ b/sys/boot/efi/Makefile.inc @@ -9,9 +9,13 @@ CFLAGS+= -mno-aes # Options used when building app-specific efi components # See conf/kern.mk for the correct set of these -CFLAGS+= -ffreestanding -Wformat -msoft-float ${CFLAGS_NO_SIMD} +CFLAGS+= -ffreestanding -Wformat ${CFLAGS_NO_SIMD} LDFLAGS+= -nostdlib +.if ${MACHINE_CPUARCH} != "aarch64" +CFLAGS+= -msoft-float +.endif + .if ${MACHINE_CPUARCH} == "amd64" CFLAGS+= -fshort-wchar CFLAGS+= -mno-red-zone diff --git a/sys/boot/efi/boot1/Makefile b/sys/boot/efi/boot1/Makefile index 4e25f5169b56..567263bc3ae5 100644 --- a/sys/boot/efi/boot1/Makefile +++ b/sys/boot/efi/boot1/Makefile @@ -71,7 +71,7 @@ LDSCRIPT= ${.CURDIR}/../loader/arch/${MACHINE}/ldscript.${MACHINE} LDFLAGS+= -Wl,-T${LDSCRIPT} -Wl,-Bsymbolic -shared .if ${MACHINE_CPUARCH} == "aarch64" -CFLAGS+= -msoft-float -mgeneral-regs-only +CFLAGS+= -mgeneral-regs-only .endif .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" CFLAGS+= -fPIC diff --git a/sys/boot/efi/fdt/Makefile b/sys/boot/efi/fdt/Makefile index 65f6e6336bab..56fc2997a136 100644 --- a/sys/boot/efi/fdt/Makefile +++ b/sys/boot/efi/fdt/Makefile @@ -10,9 +10,11 @@ WARNS?= 6 SRCS= efi_fdt.c -CFLAGS+= -ffreestanding -msoft-float +CFLAGS+= -ffreestanding .if ${MACHINE_CPUARCH} == "aarch64" CFLAGS+= -mgeneral-regs-only +.else +CFLAGS+= -msoft-float .endif CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ diff --git a/sys/boot/efi/libefi/Makefile b/sys/boot/efi/libefi/Makefile index 33a8f3e7e04e..b10ae64fc708 100644 --- a/sys/boot/efi/libefi/Makefile +++ b/sys/boot/efi/libefi/Makefile @@ -30,7 +30,7 @@ CWARNFLAGS.efipart.c+= -Wno-format CWARNFLAGS.env.c+= -Wno-format .if ${MACHINE_CPUARCH} == "aarch64" -CFLAGS+= -msoft-float -mgeneral-regs-only +CFLAGS+= -mgeneral-regs-only .endif .if ${MACHINE_ARCH} == "amd64" CFLAGS+= -fPIC -mno-red-zone diff --git a/sys/boot/efi/loader/arch/arm64/Makefile.inc b/sys/boot/efi/loader/arch/arm64/Makefile.inc index d263db956a87..fbb75398fe9e 100644 --- a/sys/boot/efi/loader/arch/arm64/Makefile.inc +++ b/sys/boot/efi/loader/arch/arm64/Makefile.inc @@ -8,7 +8,7 @@ SRCS+= exec.c \ CFLAGS+=-I${.CURDIR}/../../arm64/libarm64 SRCS+= cache.c -CFLAGS+= -msoft-float -mgeneral-regs-only +CFLAGS+= -mgeneral-regs-only CLEANFILES+= loader.help