diff options
author | kevans <kevans@FreeBSD.org> | 2018-04-06 19:01:08 +0000 |
---|---|---|
committer | kevans <kevans@FreeBSD.org> | 2018-04-06 19:01:08 +0000 |
commit | 660b51ddbee4bccb20dbf57995aa949e45f1bbf7 (patch) | |
tree | 9b27cab7ba4c40c5ca5c294c20fde05b748a8064 /stand | |
parent | ea18f85c351efd32ae9a7fb85a37327f26c9eb32 (diff) | |
download | FreeBSD-src-660b51ddbee4bccb20dbf57995aa949e45f1bbf7.zip FreeBSD-src-660b51ddbee4bccb20dbf57995aa949e45f1bbf7.tar.gz |
MFC r329345: Eliminate bsd.stand.mk and -fPIC 32-bit intel builds
OK. We don't really need a bsd.stand.mk, and it was causing a -fPIC
for the toolchain to be added (bogusly) when building on amd64. Pull
all relevant defs back into defs.mk and delete bsd.stand.mk.
This saves about 15-20k on i386 loader and zfsloader which when
combined with Lua give us a lot more stack space in those constrained
environments.
Diffstat (limited to 'stand')
-rw-r--r-- | stand/defs.mk | 15 | ||||
-rw-r--r-- | stand/fdt/Makefile | 1 | ||||
-rw-r--r-- | stand/ficl/Makefile | 1 | ||||
-rw-r--r-- | stand/geli/Makefile | 1 | ||||
-rw-r--r-- | stand/libsa/Makefile | 1 | ||||
-rw-r--r-- | stand/mips/uboot/Makefile | 1 | ||||
-rw-r--r-- | stand/uboot/fdt/Makefile | 1 | ||||
-rw-r--r-- | stand/uboot/lib/Makefile | 1 | ||||
-rw-r--r-- | stand/zfs/Makefile | 1 |
9 files changed, 12 insertions, 11 deletions
diff --git a/stand/defs.mk b/stand/defs.mk index 809d995..392d66d 100644 --- a/stand/defs.mk +++ b/stand/defs.mk @@ -99,8 +99,10 @@ SSP_CFLAGS= # 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+= -mgeneral-regs-only -fPIC +.elif ${MACHINE_CPUARCH} == "riscv" +CFLAGS+= -march=rv64imac -mabi=lp64 +.else CFLAGS+= -msoft-float .endif @@ -108,7 +110,9 @@ CFLAGS+= -msoft-float CFLAGS+= -march=i386 CFLAGS.gcc+= -mpreferred-stack-boundary=2 .endif - +.if ${MACHINE_CPUARCH} == "amd64" && ${DO32:U0} == 0 +CFLAGS+= -fPIC -mno-red-zone +.endif .if ${MACHINE_CPUARCH} == "arm" # Do not generate movt/movw, because the relocation fixup for them does not @@ -120,6 +124,7 @@ CFLAGS.clang+= -mllvm -arm-use-movt=0 CFLAGS.clang+= -mno-movt .endif CFLAGS.clang+= -mfpu=none +CFLAGS+= -fPIC .endif # The boot loader build uses dd status=none, where possible, for reproducible @@ -129,6 +134,10 @@ CFLAGS.clang+= -mfpu=none DD_NOSTATUS!=(dd status=none count=0 2> /dev/null && echo status=none) || true DD=dd ${DD_NOSTATUS} +.if ${MACHINE_CPUARCH} == "mips" +CFLAGS+= -G0 -fno-pic -mno-abicalls +.endif + .if ${MK_LOADER_FORCE_LE} != "no" .if ${MACHINE_ARCH} == "powerpc64" CFLAGS+= -mlittle-endian diff --git a/stand/fdt/Makefile b/stand/fdt/Makefile index b4767ed..3eee143 100644 --- a/stand/fdt/Makefile +++ b/stand/fdt/Makefile @@ -17,5 +17,4 @@ CFLAGS+= -I${SYSDIR}/contrib/libfdt/ -I${LDRSRC} CFLAGS+= -Wformat -Wall -.include <bsd.stand.mk> .include <bsd.lib.mk> diff --git a/stand/ficl/Makefile b/stand/ficl/Makefile index 1f1576b..3573085 100644 --- a/stand/ficl/Makefile +++ b/stand/ficl/Makefile @@ -12,7 +12,6 @@ BASE_SRCS= dict.c ficl.c fileaccess.c float.c loader.c math64.c \ SRCS= ${BASE_SRCS} sysdep.c softcore.c CLEANFILES+= softcore.c testmain testmain.o -.include <bsd.stand.mk> .ifmake testmain CFLAGS= -DTESTMAIN -D_TESTMAIN CFLAGS+= -I${FICLSRC} -I${FICLSRC}/${FICL_CPUARCH} -I${LDRSRC} diff --git a/stand/geli/Makefile b/stand/geli/Makefile index 24faf12..fa77b19 100644 --- a/stand/geli/Makefile +++ b/stand/geli/Makefile @@ -34,5 +34,4 @@ SRCS+= geliboot_crypto.c g_eli_hmac.c g_eli_key.c g_eli_key_cache.c pkcs5v2.c .PATH: ${SYSDIR}/opencrypto SRCS+= xform_aes_xts.c -.include <bsd.stand.mk> .include <bsd.lib.mk> diff --git a/stand/libsa/Makefile b/stand/libsa/Makefile index 988ac30..9daa7e7 100644 --- a/stand/libsa/Makefile +++ b/stand/libsa/Makefile @@ -147,5 +147,4 @@ CFLAGS.bzipfs.c+= -I${SRCTOP}/contrib/bzip2 .PATH: ${SYSDIR}/libkern SRCS+= explicit_bzero.c -.include <bsd.stand.mk> .include <bsd.lib.mk> diff --git a/stand/mips/uboot/Makefile b/stand/mips/uboot/Makefile index 4323f45..1751bcb 100644 --- a/stand/mips/uboot/Makefile +++ b/stand/mips/uboot/Makefile @@ -53,5 +53,4 @@ ubldr: ${OBJS} ldscript.abs ${.CURDIR}/ldscript.${MACHINE_CPUARCH} ${DPADD} CLEANFILES+= ldscript.abs ldscript.pie ubldr ubldr.pie ubldr.bin -.include <bsd.stand.mk> .include <bsd.prog.mk> diff --git a/stand/uboot/fdt/Makefile b/stand/uboot/fdt/Makefile index b1e9f8e..ef60f8b 100644 --- a/stand/uboot/fdt/Makefile +++ b/stand/uboot/fdt/Makefile @@ -18,5 +18,4 @@ CFLAGS+= -I${FDTSRC} # Pick up the bootstrap header for some interface items CFLAGS+= -I${LDRSRC} -.include <bsd.stand.mk> .include <bsd.lib.mk> diff --git a/stand/uboot/lib/Makefile b/stand/uboot/lib/Makefile index 19e4d3a..1964484 100644 --- a/stand/uboot/lib/Makefile +++ b/stand/uboot/lib/Makefile @@ -24,5 +24,4 @@ CFLAGS+= -I${LDRSRC} CFLAGS+= -DDISK_DEBUG .endif -.include <bsd.stand.mk> .include <bsd.lib.mk> diff --git a/stand/zfs/Makefile b/stand/zfs/Makefile index 3116b32..89c1bfd 100644 --- a/stand/zfs/Makefile +++ b/stand/zfs/Makefile @@ -17,5 +17,4 @@ CFLAGS+= -I${SYSDIR}/crypto/skein CFLAGS+= -Wformat -Wall -.include <bsd.stand.mk> .include <bsd.lib.mk> |