summaryrefslogtreecommitdiffstats
path: root/share/mk/bsd.kern.mk
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>1999-11-17 07:30:35 +0000
committerobrien <obrien@FreeBSD.org>1999-11-17 07:30:35 +0000
commit65e383d031b6ae53df5fb1705a211706a2758a56 (patch)
treef3ebb34b1eae9ea29ec061ab6df5b9b858386289 /share/mk/bsd.kern.mk
parent4a93879dcf8e554e6e42bea6ecf463c9fb9c6b8b (diff)
downloadFreeBSD-src-65e383d031b6ae53df5fb1705a211706a2758a56.zip
FreeBSD-src-65e383d031b6ae53df5fb1705a211706a2758a56.tar.gz
Make "-mpreferred-stack-boundary=2" the default on the i386.
This reduces the size of the kernel and modules when compiled with GCC 2.95.
Diffstat (limited to 'share/mk/bsd.kern.mk')
-rw-r--r--share/mk/bsd.kern.mk13
1 files changed, 13 insertions, 0 deletions
diff --git a/share/mk/bsd.kern.mk b/share/mk/bsd.kern.mk
index b4bd9de..595bc2e 100644
--- a/share/mk/bsd.kern.mk
+++ b/share/mk/bsd.kern.mk
@@ -19,6 +19,19 @@ CWARNFLAGS?= -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes \
#
#
+# On the i386, do not align the stack to 16-byte boundaries. Otherwise GCC
+# 2.95 adds code to the entry and exit point of every function to align the
+# stack to 16-byte boundaries -- thus wasting approximately 12 bytes of stack
+# per function call. While the 16-byte alignment may benefit micro benchmarks,
+# it is probably an overall loose as it makes the code bigger (less efficient
+# use of code cache tag lines) and uses more stack (less efficient use of data
+# cache tag lines)
+#
+.if ${MACHINE_ARCH} == "i386"
+CFLAGS+= -mpreferred-stack-boundary=2
+.endif
+
+#
# On the alpha, make sure that we don't use floating-point registers and
# allow the use of EV56 instructions (only needed for low-level i/o).
#
OpenPOWER on IntegriCloud