aboutsummaryrefslogtreecommitdiff
path: root/stand
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2018-08-15 20:31:11 +0000
committerWarner Losh <imp@FreeBSD.org>2018-08-15 20:31:11 +0000
commitf835d609b76a48fbf8f872d2a21a49fa677c2a0f (patch)
treec97fda51ac2539371276d19cf1c7e27e055ebcce /stand
parent92bceb97565cf284622e595225fd4d0c096bb5dc (diff)
downloadsrc-f835d609b76a48fbf8f872d2a21a49fa677c2a0f.tar.gz
src-f835d609b76a48fbf8f872d2a21a49fa677c2a0f.zip
stand: Use -Oz/-Os for all loader/stand builds.
While we're not super size constrained, the x86 BIOS /boot/loader has to be less than about 520k-530k to be reliable. The LUA loader is at this size today. -Oz saves 15-20% on the size, keeping us safely small enough (comparable to where we were with the 4th loader). This will also help with sjg's work on bringing in bearssl, though we may again be looking for space in the LUA loader. Size table for clang 6.0.0: default -O1 -Os -Oz 4th 442368 417792 389120 376832 lua 524288 479232 446464 430080 Tested by: kevans91@ (ubldr on armv7), dhw@ (loader on amdy64) Differential Revision: https://reviews.freebsd.org/D16724
Notes
Notes: svn path=/head/; revision=337868
Diffstat (limited to 'stand')
-rw-r--r--stand/defs.mk7
1 files changed, 6 insertions, 1 deletions
diff --git a/stand/defs.mk b/stand/defs.mk
index 2f8d97ae0f2c..e446fd0f6c94 100644
--- a/stand/defs.mk
+++ b/stand/defs.mk
@@ -53,7 +53,12 @@ CFLAGS+= -I${SASRC} -D_STANDALONE
CFLAGS+= -I${SYSDIR}
# Spike the floating point interfaces
CFLAGS+= -Ddouble=jagged-little-pill -Dfloat=floaty-mcfloatface
-
+# Slim down the image. This saves about 15% in size with clang 6 on x86
+# Our most constrained /boot/loader env is BIOS booting on x86, where
+# our text + data + BTX have to fit into 640k below the ISA hole.
+# Experience has shown that problems arise between ~520k to ~530k.
+CFLAGS.clang+= -Oz
+CFLAGS.gcc+= -Os
# GELI Support, with backward compat hooks (mostly)
.if defined(LOADER_NO_GELI_SUPPORT)