summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2023-04-16 19:57:02 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2023-04-16 19:57:02 +0000
commit2bed02556d80a01dbfa810a526e8d17b9076bd9f (patch)
tree5da46f1c8f7a1a9ea0727ebfb0164b997c872813 /usr.sbin
parent9cb0de26812ff690fb044304cc52103961957921 (diff)
if (actually... when) the compiler is flipped to do BTI/ENDBR by default,
the install media would grow too much, so use the same strategy as we for stack protector and other things: disable them, just on the install media ok kettenis
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/crunchgen/crunchgen.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/usr.sbin/crunchgen/crunchgen.c b/usr.sbin/crunchgen/crunchgen.c
index 4526290197e..1bb6c30f227 100644
--- a/usr.sbin/crunchgen/crunchgen.c
+++ b/usr.sbin/crunchgen/crunchgen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: crunchgen.c,v 1.25 2021/11/15 15:14:24 millert Exp $ */
+/* $OpenBSD: crunchgen.c,v 1.26 2023/04/16 19:57:01 deraadt Exp $ */
/*
* Copyright (c) 1994 University of Maryland
@@ -895,6 +895,12 @@ top_makefile_rules(FILE * outmk)
fprintf(outmk, "CFLAGS+=-Oz\n");
fprintf(outmk, "CFLAGS+=-fno-stack-protector\n");
fprintf(outmk, "CFLAGS+=-fno-unwind-tables\n");
+ fprintf(outmk, ".if ${MACHINE} == \"amd64\"\n");
+ fprintf(outmk, "CFLAGS+=-fcf-protection=none\n");
+ fprintf(outmk, ".endif\n");
+ fprintf(outmk, ".if ${MACHINE} == \"arm64\"\n");
+ fprintf(outmk, "CFLAGS+=-mbranch-protection=none\n");
+ fprintf(outmk, ".endif\n");
fprintf(outmk, "CFLAGS+=-fno-asynchronous-unwind-tables\n");
fprintf(outmk, "LDFLAGS+=$(NOPIE_LDFLAGS)\n");
fprintf(outmk, "STRIP?=strip\n");