From f2d8d4c1c1a94709f8219ddaed8dd16142a78098 Mon Sep 17 00:00:00 2001 From: plunky Date: Wed, 31 Aug 2011 20:16:43 +0000 Subject: [PATCH] for multi-cpu machines, cpu_hatch() straddles the init of __stack_chk_guard, so ensure stack protection is disabled on x86 architectures (I don't know about other archs) --- sys/conf/Makefile.kern.inc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sys/conf/Makefile.kern.inc b/sys/conf/Makefile.kern.inc index 76a9623694bd..0989556102fa 100644 --- a/sys/conf/Makefile.kern.inc +++ b/sys/conf/Makefile.kern.inc @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.kern.inc,v 1.147 2011/08/28 23:15:53 jmcneill Exp $ +# $NetBSD: Makefile.kern.inc,v 1.148 2011/08/31 20:16:43 plunky Exp $ # # This file contains common `MI' targets and definitions and it is included # at the bottom of each `MD' ${MACHINE}/conf/Makefile.${MACHINE}. @@ -96,6 +96,12 @@ CFLAGS+= -fno-strict-aliasing COPTS.kern_ssp.c+= -fno-stack-protector -D__SSP__ .endif +# for multi-cpu machines, cpu_hatch() straddles the init of +# __stack_chk_guard, so ensure stack protection is disabled +.if ${MACHINE} == "i386" || ${MACHINE_ARCH} == "x86_64" +COPTS.cpu.c+= -fno-stack-protector +.endif + # If we want the bpendtsleep: label in kern_synch.c, we need to use # -fno-reorder-blocks. Don't make this a config(1) defflag without # making sure this fragment remains valid.