summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorChristian Weisgerber <naddy@cvs.openbsd.org>2018-10-18 14:25:15 +0000
committerChristian Weisgerber <naddy@cvs.openbsd.org>2018-10-18 14:25:15 +0000
commit9427bcc66f7f9d9c8cd6f5a57b1fc91920d2ba76 (patch)
treef83fad98125433f0ef32dbf7c8277edfa94014e8 /usr.sbin
parent393ea43c4c0bed821b80953f85ea1ba908957a69 (diff)
Ensure that the install media are built with a consistent set of
compiler flags. Pass DIST_CFLAGS from the crunchgen-generated .mk file. Compile the install media with -fno-unwind-tables to avoid emitting .eh_frame sections. This saves substantial space on amd64. with/ok kettenis@
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/crunchgen/crunchgen.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.sbin/crunchgen/crunchgen.c b/usr.sbin/crunchgen/crunchgen.c
index 5e088b9844b..48b5f06784c 100644
--- a/usr.sbin/crunchgen/crunchgen.c
+++ b/usr.sbin/crunchgen/crunchgen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: crunchgen.c,v 1.20 2018/02/06 00:05:24 henning Exp $ */
+/* $OpenBSD: crunchgen.c,v 1.21 2018/10/18 14:25:14 naddy Exp $ */
/*
* Copyright (c) 1994 University of Maryland
@@ -895,6 +895,8 @@ top_makefile_rules(FILE * outmk)
fprintf(outmk, ".include <bsd.own.mk>\n");
fprintf(outmk, "CFLAGS+=$(NOPIE_FLAGS)\n");
fprintf(outmk, "CFLAGS+=-Oz\n");
+ fprintf(outmk, "CFLAGS+=-fno-stack-protector\n");
+ fprintf(outmk, "CFLAGS+=-fno-unwind-tables\n");
fprintf(outmk, "LDFLAGS+=$(NOPIE_LDFLAGS)\n");
fprintf(outmk, "STRIP?=strip\n");
fprintf(outmk, "LINK=$(LD) -dc -r ${LDFLAGS}\n");
@@ -934,7 +936,8 @@ top_makefile_rules(FILE * outmk)
fprintf(outmk, ".olist.a:\n");
fprintf(outmk, "\t@rm -f ${.TARGET}\n");
fprintf(outmk, "\t@cd ${SRCLIBDIR}/${.PREFIX} &&\t\t\t\t\\\n");
- fprintf(outmk, "\t${MAKE} DIST_OBJS=\"`cat ${.OBJDIR}/${.IMPSRC}`\"\t\t\\\n");
+ fprintf(outmk, "\t${MAKE} DIST_CFLAGS=\"${CFLAGS}\"\t\t\t\t\\\n");
+ fprintf(outmk, "\t DIST_OBJS=\"`cat ${.OBJDIR}/${.IMPSRC}`\"\t\t\\\n");
fprintf(outmk, "\t DIST_LIB=${.OBJDIR}/${.TARGET} ${.OBJDIR}/${.TARGET}\n\n");
fprintf(outmk, "%s.map: %s.o $(CRUNCHED_OBJS)\n", execfname, execfname);