Author: kevans
Date: Fri Apr  6 19:01:08 2018
New Revision: 332131
URL: https://svnweb.freebsd.org/changeset/base/332131

Log:
  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.

Deleted:
  stable/11/share/mk/bsd.stand.mk
Modified:
  stable/11/stand/defs.mk
  stable/11/stand/fdt/Makefile
  stable/11/stand/ficl/Makefile
  stable/11/stand/geli/Makefile
  stable/11/stand/libsa/Makefile
  stable/11/stand/mips/uboot/Makefile
  stable/11/stand/uboot/fdt/Makefile
  stable/11/stand/uboot/lib/Makefile
  stable/11/stand/zfs/Makefile
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/stand/defs.mk
==============================================================================
--- stable/11/stand/defs.mk     Fri Apr  6 18:55:02 2018        (r332130)
+++ stable/11/stand/defs.mk     Fri Apr  6 19:01:08 2018        (r332131)
@@ -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,8 +110,10 @@ 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
 # translate to the -Bsymbolic -pie format required by self_reloc() in 
loader(8).
@@ -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
@@ -128,6 +133,10 @@ CFLAGS.clang+=  -mfpu=none
 # when this test succeeds rather than require dd to be a bootstrap tool.
 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"

Modified: stable/11/stand/fdt/Makefile
==============================================================================
--- stable/11/stand/fdt/Makefile        Fri Apr  6 18:55:02 2018        
(r332130)
+++ stable/11/stand/fdt/Makefile        Fri Apr  6 19:01:08 2018        
(r332131)
@@ -17,5 +17,4 @@ CFLAGS+=      -I${SYSDIR}/contrib/libfdt/ -I${LDRSRC}
 
 CFLAGS+=       -Wformat -Wall
 
-.include <bsd.stand.mk>
 .include <bsd.lib.mk>

Modified: stable/11/stand/ficl/Makefile
==============================================================================
--- stable/11/stand/ficl/Makefile       Fri Apr  6 18:55:02 2018        
(r332130)
+++ stable/11/stand/ficl/Makefile       Fri Apr  6 19:01:08 2018        
(r332131)
@@ -12,7 +12,6 @@ BASE_SRCS=    dict.c ficl.c fileaccess.c float.c loader.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}

Modified: stable/11/stand/geli/Makefile
==============================================================================
--- stable/11/stand/geli/Makefile       Fri Apr  6 18:55:02 2018        
(r332130)
+++ stable/11/stand/geli/Makefile       Fri Apr  6 19:01:08 2018        
(r332131)
@@ -34,5 +34,4 @@ SRCS+=                geliboot_crypto.c g_eli_hmac.c 
g_eli_key.c g_e
 .PATH:         ${SYSDIR}/opencrypto
 SRCS+=         xform_aes_xts.c
 
-.include <bsd.stand.mk>
 .include <bsd.lib.mk>

Modified: stable/11/stand/libsa/Makefile
==============================================================================
--- stable/11/stand/libsa/Makefile      Fri Apr  6 18:55:02 2018        
(r332130)
+++ stable/11/stand/libsa/Makefile      Fri Apr  6 19:01:08 2018        
(r332131)
@@ -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>

Modified: stable/11/stand/mips/uboot/Makefile
==============================================================================
--- stable/11/stand/mips/uboot/Makefile Fri Apr  6 18:55:02 2018        
(r332130)
+++ stable/11/stand/mips/uboot/Makefile Fri Apr  6 19:01:08 2018        
(r332131)
@@ -53,5 +53,4 @@ ubldr: ${OBJS} ldscript.abs ${.CURDIR}/ldscript.${MACH
 
 CLEANFILES+=   ldscript.abs ldscript.pie ubldr ubldr.pie ubldr.bin
 
-.include <bsd.stand.mk>
 .include <bsd.prog.mk>

Modified: stable/11/stand/uboot/fdt/Makefile
==============================================================================
--- stable/11/stand/uboot/fdt/Makefile  Fri Apr  6 18:55:02 2018        
(r332130)
+++ stable/11/stand/uboot/fdt/Makefile  Fri Apr  6 19:01:08 2018        
(r332131)
@@ -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>

Modified: stable/11/stand/uboot/lib/Makefile
==============================================================================
--- stable/11/stand/uboot/lib/Makefile  Fri Apr  6 18:55:02 2018        
(r332130)
+++ stable/11/stand/uboot/lib/Makefile  Fri Apr  6 19:01:08 2018        
(r332131)
@@ -24,5 +24,4 @@ CFLAGS+=      -I${LDRSRC}
 CFLAGS+= -DDISK_DEBUG
 .endif
 
-.include <bsd.stand.mk>
 .include <bsd.lib.mk>

Modified: stable/11/stand/zfs/Makefile
==============================================================================
--- stable/11/stand/zfs/Makefile        Fri Apr  6 18:55:02 2018        
(r332130)
+++ stable/11/stand/zfs/Makefile        Fri Apr  6 19:01:08 2018        
(r332131)
@@ -17,5 +17,4 @@ CFLAGS+=      -I${SYSDIR}/crypto/skein
 
 CFLAGS+=       -Wformat -Wall
 
-.include <bsd.stand.mk>
 .include <bsd.lib.mk>
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to