summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkevans <kevans@FreeBSD.org>2018-02-12 01:17:06 +0000
committerkevans <kevans@FreeBSD.org>2018-02-12 01:17:06 +0000
commit10d0cc49e4d903a7f94a1693ad0c34defaf4360d (patch)
treeed1376e4fc03f8b50aaf18c2139787ae27947448
parent7d97ee5b28b409c00bfaf12daf5ab497a6038b9d (diff)
downloadFreeBSD-src-10d0cc49e4d903a7f94a1693ad0c34defaf4360d.zip
FreeBSD-src-10d0cc49e4d903a7f94a1693ad0c34defaf4360d.tar.gz
MFC r326038,r326069,r326072: More stand simplification and fixes
r326038: Move some more common stuff up to Makefile.inc. r326069: Fix gptzfsboot for cases with GELI. r326072: Unbreak riscv build in universe.
-rw-r--r--stand/Makefile.inc16
-rw-r--r--stand/arm/uboot/Makefile2
-rw-r--r--stand/efi/Makefile.inc12
-rw-r--r--stand/efi/fdt/Makefile7
-rw-r--r--stand/fdt/Makefile6
-rw-r--r--stand/i386/Makefile.inc3
-rw-r--r--stand/i386/gptzfsboot/Makefile6
-rw-r--r--stand/i386/libi386/Makefile1
-rw-r--r--stand/mips/beri/Makefile.inc1
-rw-r--r--stand/mips/beri/boot2/Makefile4
-rw-r--r--stand/mips/beri/loader/Makefile1
-rw-r--r--stand/mips/uboot/Makefile2
-rw-r--r--stand/ofw/libofw/Makefile2
-rw-r--r--stand/powerpc/boot1.chrp/Makefile4
-rw-r--r--stand/powerpc/kboot/Makefile2
-rw-r--r--stand/powerpc/ofw/Makefile1
-rw-r--r--stand/powerpc/ps3/Makefile2
-rw-r--r--stand/powerpc/uboot/Makefile2
-rw-r--r--stand/sparc64/Makefile.inc1
-rw-r--r--stand/uboot/fdt/Makefile2
-rw-r--r--stand/uboot/lib/Makefile2
-rw-r--r--stand/usb/Makefile5
-rw-r--r--stand/usb/Makefile.test4
-rw-r--r--stand/userboot/userboot/Makefile1
24 files changed, 25 insertions, 64 deletions
diff --git a/stand/Makefile.inc b/stand/Makefile.inc
index cf833d9..610acfa 100644
--- a/stand/Makefile.inc
+++ b/stand/Makefile.inc
@@ -9,6 +9,22 @@ CFLAGS+=-I${SASRC}
SSP_CFLAGS=
+# Add in the no float / no SIMD stuff and announce we're freestanding
+# aarch64 and riscv don't have -msoft-float, but all others do. riscv
+# currently has no /boot/loader, but may soon.
+CFLAGS+= -ffreestanding ${CFLAGS_NO_SIMD}
+.if ${MACHINE_CPUARCH} == "aarch64"
+CFLAGS+= -mgeneral-regs-only
+.elif ${MACHINE_CPUARCH} != "riscv"
+CFLAGS+= -msoft-float
+.endif
+
+.if ${MACHINE_CPUARCH} == "i386" || (${MACHINE_CPUARCH} == "amd64" && ${DO32:U0} == 1)
+CFLAGS+= -march=i386
+CFLAGS.gcc+= -mpreferred-stack-boundary=2
+.endif
+
+
.if ${MACHINE_CPUARCH} == "arm"
# Do not generate movt/movw, because the relocation fixup for them does not
# translate to the -Bsymbolic -pie format required by self_reloc() in loader(8).
diff --git a/stand/arm/uboot/Makefile b/stand/arm/uboot/Makefile
index 5bf7d53..2070d8a 100644
--- a/stand/arm/uboot/Makefile
+++ b/stand/arm/uboot/Makefile
@@ -33,8 +33,6 @@ HELP_FILES+= help.uboot ${BOOTSRC}/fdt/help.fdt
# Always add MI sources
.include "${BOOTSRC}/loader.mk"
-CFLAGS+= -ffreestanding -msoft-float
-
LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.${MACHINE_CPUARCH}
LDFLAGS+= -Wl,-znotext
diff --git a/stand/efi/Makefile.inc b/stand/efi/Makefile.inc
index 4fd8762..704a77c 100644
--- a/stand/efi/Makefile.inc
+++ b/stand/efi/Makefile.inc
@@ -1,23 +1,13 @@
# $FreeBSD$
-.if ${MACHINE_CPUARCH} == "i386"
-CFLAGS+= -march=i386
-CFLAGS+= -mno-aes
-.endif
-
# Options used when building app-specific efi components
# See conf/kern.mk for the correct set of these
-CFLAGS+= -ffreestanding -Wformat ${CFLAGS_NO_SIMD}
+CFLAGS+= -Wformat
LDFLAGS+= -nostdlib
-.if ${MACHINE_CPUARCH} != "aarch64"
-CFLAGS+= -msoft-float
-.endif
-
.if ${MACHINE_CPUARCH} == "amd64"
CFLAGS+= -fshort-wchar
CFLAGS+= -mno-red-zone
-CFLAGS+= -mno-aes
.endif
.if ${MACHINE_CPUARCH} == "aarch64"
diff --git a/stand/efi/fdt/Makefile b/stand/efi/fdt/Makefile
index 7308ce9..6bae439 100644
--- a/stand/efi/fdt/Makefile
+++ b/stand/efi/fdt/Makefile
@@ -10,13 +10,6 @@ WARNS?= 6
SRCS= efi_fdt.c
-CFLAGS+= -ffreestanding
-.if ${MACHINE_CPUARCH} == "aarch64"
-CFLAGS+= -mgeneral-regs-only
-.else
-CFLAGS+= -msoft-float
-.endif
-
# EFI library headers
CFLAGS+= -I${EFISRC}/include
CFLAGS+= -I${EFISRC}/include/${MACHINE}
diff --git a/stand/fdt/Makefile b/stand/fdt/Makefile
index dd31aac..3e13441 100644
--- a/stand/fdt/Makefile
+++ b/stand/fdt/Makefile
@@ -16,12 +16,6 @@ SRCS+= fdt_loader_cmd.c
CFLAGS+= -I${SYSDIR}/contrib/libfdt/ -I${LDRSRC}
-CFLAGS+= -ffreestanding
-
-.if ${MACHINE_CPUARCH} == "powerpc" || ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "mips"
-CFLAGS+= -msoft-float
-.endif
-
CFLAGS+= -Wformat -Wall
.include <bsd.stand.mk>
diff --git a/stand/i386/Makefile.inc b/stand/i386/Makefile.inc
index 6a4bea7..724e176 100644
--- a/stand/i386/Makefile.inc
+++ b/stand/i386/Makefile.inc
@@ -3,9 +3,6 @@
# $FreeBSD$
LOADER_ADDRESS?=0x200000
-CFLAGS+= -march=i386 -ffreestanding
-CFLAGS.gcc+= -mpreferred-stack-boundary=2
-CFLAGS+= ${CFLAGS_NO_SIMD} -msoft-float
LDFLAGS+= -nostdlib
# BTX components
diff --git a/stand/i386/gptzfsboot/Makefile b/stand/i386/gptzfsboot/Makefile
index 97f1954..d4e06ec 100644
--- a/stand/i386/gptzfsboot/Makefile
+++ b/stand/i386/gptzfsboot/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-HAVE_GPT= yes
+HAVE_GELI= yes
.include <bsd.init.mk>
@@ -70,12 +70,12 @@ gptldr.out: gptldr.o
${LD} ${LD_FLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} gptldr.o
CLEANFILES+= gptzfsboot.bin gptzfsboot.out zfsboot.o sio.o cons.o \
- drv.o gpt.o util.o ${OPENCRYPTO_XTS}
+ drv.o gpt.o ${OPENCRYPTO_XTS}
gptzfsboot.bin: gptzfsboot.out
${OBJCOPY} -S -O binary gptzfsboot.out ${.TARGET}
-gptzfsboot.out: ${BTXCRT} zfsboot.o sio.o gpt.o drv.o cons.o util.o \
+gptzfsboot.out: ${BTXCRT} zfsboot.o sio.o gpt.o drv.o cons.o \
${OPENCRYPTO_XTS}
${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBGELIBOOT} ${LIBZFSBOOT} ${LIBSA32}
diff --git a/stand/i386/libi386/Makefile b/stand/i386/libi386/Makefile
index 8d65513..f058521 100644
--- a/stand/i386/libi386/Makefile
+++ b/stand/i386/libi386/Makefile
@@ -1,6 +1,5 @@
# $FreeBSD$
-HAVE_GPT= yes
HAVE_GELI= yes
.include <bsd.init.mk>
diff --git a/stand/mips/beri/Makefile.inc b/stand/mips/beri/Makefile.inc
index a12699c..5a7b18e 100644
--- a/stand/mips/beri/Makefile.inc
+++ b/stand/mips/beri/Makefile.inc
@@ -1,6 +1,5 @@
# $FreeBSD$
-CFLAGS+= -ffreestanding
LDFLAGS+= -nostdlib
.include "../Makefile.inc"
diff --git a/stand/mips/beri/boot2/Makefile b/stand/mips/beri/boot2/Makefile
index d369340..c46a157 100644
--- a/stand/mips/beri/boot2/Makefile
+++ b/stand/mips/beri/boot2/Makefile
@@ -47,15 +47,13 @@ MAN=
AFLAGS= -G0
-CFLAGS= -ffreestanding \
- -I${.CURDIR} \
+CFLAGS+= -I${.CURDIR} \
-I${SASRC} \
-I${LDRSRC} \
-D_KERNEL \
-Wall \
-G0 \
-fno-pic -mno-abicalls \
- -msoft-float \
-g
LDFLAGS= -nostdlib \
diff --git a/stand/mips/beri/loader/Makefile b/stand/mips/beri/loader/Makefile
index 763b3b3..f232489 100644
--- a/stand/mips/beri/loader/Makefile
+++ b/stand/mips/beri/loader/Makefile
@@ -83,7 +83,6 @@ CFLAGS+= -I${.CURDIR}
CFLAGS+= -G0 \
-fno-pic \
-mno-abicalls \
- -msoft-float \
-g
LDFLAGS= -nostdlib \
diff --git a/stand/mips/uboot/Makefile b/stand/mips/uboot/Makefile
index b941ba3..c605af1 100644
--- a/stand/mips/uboot/Makefile
+++ b/stand/mips/uboot/Makefile
@@ -29,7 +29,7 @@ HELP_FILES+= help.uboot ${BOOTSRC}/fdt/help.fdt
# Always add MI sources
.include "${BOOTSRC}/loader.mk"
-CFLAGS+= -ffreestanding -msoft-float -g
+CFLAGS+= -g
LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.${MACHINE_CPUARCH}
diff --git a/stand/ofw/libofw/Makefile b/stand/ofw/libofw/Makefile
index 8e9ac80..6818e27 100644
--- a/stand/ofw/libofw/Makefile
+++ b/stand/ofw/libofw/Makefile
@@ -14,9 +14,7 @@ SRCS+= devicename_stubs.c
# Pick up the bootstrap header for some interface items
CFLAGS+= -I${LDRSRC}
-CFLAGS+= -ffreestanding
.if ${MACHINE_CPUARCH} == "powerpc"
-CFLAGS+= -msoft-float
SRCS+= ppc64_elf_freebsd.c
.endif
diff --git a/stand/powerpc/boot1.chrp/Makefile b/stand/powerpc/boot1.chrp/Makefile
index 384d0ab..ee32ff5 100644
--- a/stand/powerpc/boot1.chrp/Makefile
+++ b/stand/powerpc/boot1.chrp/Makefile
@@ -13,9 +13,7 @@ SRCS= boot1.c ashldi3.c syncicache.c
MAN=
-CFLAGS= -ffreestanding -msoft-float \
- -I${LDRSRC} -I${SYSDIR} -I${SASRC} \
- -D_STANDALONE
+CFLAGS= -I${LDRSRC} -I${SYSDIR} -I${SASRC} -D_STANDALONE
LDFLAGS=-nostdlib -static -Wl,-N
.PATH: ${SYSDIR}/libkern ${SRCTOP}/lib/libc/powerpc/gen ${.CURDIR}
diff --git a/stand/powerpc/kboot/Makefile b/stand/powerpc/kboot/Makefile
index bed586e..b51a068 100644
--- a/stand/powerpc/kboot/Makefile
+++ b/stand/powerpc/kboot/Makefile
@@ -32,7 +32,7 @@ HELP_FILES= # Disable
.include "${BOOTSRC}/loader.mk"
.PATH: ${SYSDIR}/libkern
-CFLAGS+= -Wall -ffreestanding -msoft-float -DAIM
+CFLAGS+= -Wall -DAIM
# load address. set in linker script
RELOC?= 0x0
CFLAGS+= -DRELOC=${RELOC}
diff --git a/stand/powerpc/ofw/Makefile b/stand/powerpc/ofw/Makefile
index 1853b25..b28665d 100644
--- a/stand/powerpc/ofw/Makefile
+++ b/stand/powerpc/ofw/Makefile
@@ -34,7 +34,6 @@ HELP_FILES+= ${FDTSRC}/help.fdt
.PATH: ${SYSDIR}/libkern
-CFLAGS+= -ffreestanding -msoft-float
# load address. set in linker script
RELOC?= 0x1C00000
CFLAGS+= -DRELOC=${RELOC}
diff --git a/stand/powerpc/ps3/Makefile b/stand/powerpc/ps3/Makefile
index 07ad135..fc6ec9c 100644
--- a/stand/powerpc/ps3/Makefile
+++ b/stand/powerpc/ps3/Makefile
@@ -30,7 +30,7 @@ HELP_FILES= # Disable
.include "${BOOTSRC}/loader.mk"
.PATH: ${SYSDIR}/libkern
-CFLAGS+= -Wall -ffreestanding -msoft-float -DAIM
+CFLAGS+= -Wall -DAIM
# load address. set in linker script
RELOC?= 0x0
CFLAGS+= -DRELOC=${RELOC}
diff --git a/stand/powerpc/uboot/Makefile b/stand/powerpc/uboot/Makefile
index d543ace..6622cf1 100644
--- a/stand/powerpc/uboot/Makefile
+++ b/stand/powerpc/uboot/Makefile
@@ -25,8 +25,6 @@ HELP_FILES= # Disable
.include "${BOOTSRC}/loader.mk"
.PATH: ${SYSDIR}/libkern
-CFLAGS+= -ffreestanding
-
LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.powerpc
.include "${BOOTSRC}/uboot.mk"
diff --git a/stand/sparc64/Makefile.inc b/stand/sparc64/Makefile.inc
index a12699c..5a7b18e 100644
--- a/stand/sparc64/Makefile.inc
+++ b/stand/sparc64/Makefile.inc
@@ -1,6 +1,5 @@
# $FreeBSD$
-CFLAGS+= -ffreestanding
LDFLAGS+= -nostdlib
.include "../Makefile.inc"
diff --git a/stand/uboot/fdt/Makefile b/stand/uboot/fdt/Makefile
index 4bc38ec..d88789d 100644
--- a/stand/uboot/fdt/Makefile
+++ b/stand/uboot/fdt/Makefile
@@ -10,8 +10,6 @@ WARNS?= 2
SRCS= uboot_fdt.c
-CFLAGS+= -ffreestanding -msoft-float
-
# U-Boot library headers
CFLAGS+= -I${UBOOTSRC}/lib
diff --git a/stand/uboot/lib/Makefile b/stand/uboot/lib/Makefile
index d12d48c..5e8a5f4 100644
--- a/stand/uboot/lib/Makefile
+++ b/stand/uboot/lib/Makefile
@@ -11,8 +11,6 @@ WARNS?= 2
SRCS= console.c copy.c devicename.c elf_freebsd.c glue.c
SRCS+= module.c net.c reboot.c time.c
-CFLAGS+= -ffreestanding -msoft-float
-
.if ${LOADER_DISK_SUPPORT:Uyes} == "yes"
SRCS+= disk.c
.endif
diff --git a/stand/usb/Makefile b/stand/usb/Makefile
index 1b94b3d..ab14a6d 100644
--- a/stand/usb/Makefile
+++ b/stand/usb/Makefile
@@ -36,15 +36,10 @@ INTERNALLIB=
CFLAGS+= -DBOOTPROG=\"usbloader\"
CFLAGS+= -ffunction-sections -fdata-sections
-CFLAGS+= -ffreestanding
CFLAGS+= -Wformat -Wall
CFLAGS+= -g
CFLAGS+= -fno-pic
-.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
-CFLAGS+= -march=i386
-CFLAGS.gcc+= -mpreferred-stack-boundary=2
-.endif
.if ${MACHINE_CPUARCH} == "amd64"
CFLAGS+= -m32
.endif
diff --git a/stand/usb/Makefile.test b/stand/usb/Makefile.test
index 7c6a66d1..decee69 100644
--- a/stand/usb/Makefile.test
+++ b/stand/usb/Makefile.test
@@ -38,10 +38,6 @@ SRCS=
CFLAGS+= -Wall
CFLAGS+= -g
-.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
-CFLAGS+= -march=i386
-CFLAGS.gcc+= -mpreferred-stack-boundary=2
-.endif
.if ${MACHINE_CPUARCH} == "amd64"
CFLAGS+= -m32
.endif
diff --git a/stand/userboot/userboot/Makefile b/stand/userboot/userboot/Makefile
index cbada82..cf235a9 100644
--- a/stand/userboot/userboot/Makefile
+++ b/stand/userboot/userboot/Makefile
@@ -36,7 +36,6 @@ SRCS+= vers.c
CFLAGS+= -Wall
CFLAGS+= -I${BOOTSRC}/userboot
-CFLAGS+= -ffreestanding
CWARNFLAGS.main.c += -Wno-implicit-function-declaration
OpenPOWER on IntegriCloud