From fa15de1fb8bd01b7ef0859ed40f79911a54831dd Mon Sep 17 00:00:00 2001 From: maxv Date: Fri, 23 Feb 2018 09:00:55 +0000 Subject: [PATCH] Add -fno-shrink-wrap, to force GCC to push the frames at the very beginning of the functions. Otherwise DDB is unable to display a correct stack trace if a fault occurred in a function before the frame was pushed. Discussed on tech-kern@, flag suggested by Krister Walfridsson. Should fix PR/52560. --- sys/arch/amd64/conf/Makefile.amd64 | 4 ++-- sys/arch/i386/conf/Makefile.i386 | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/arch/amd64/conf/Makefile.amd64 b/sys/arch/amd64/conf/Makefile.amd64 index ddf1bdb64bb7..c6a9fa9e0e28 100644 --- a/sys/arch/amd64/conf/Makefile.amd64 +++ b/sys/arch/amd64/conf/Makefile.amd64 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.amd64,v 1.64 2017/11/15 18:02:37 maxv Exp $ +# $NetBSD: Makefile.amd64,v 1.65 2018/02/23 09:00:56 maxv Exp $ # Makefile for NetBSD # @@ -35,7 +35,7 @@ GENASSYM_CONF= ${AMD64}/amd64/genassym.cf ## DEFCOPTS= -O2 -fno-omit-frame-pointer CPPFLAGS+= -Damd64 -Dx86_64 -CFLAGS+= -mcmodel=kernel +CFLAGS+= -mcmodel=kernel -fno-shrink-wrap # -mno-sse implies -mno-sse2 (etc), explicitly disable avx to be extra sure CFLAGS+= -mno-red-zone -mno-mmx -mno-sse -mno-avx # make absolutely sure we don't get x87 registers used as well diff --git a/sys/arch/i386/conf/Makefile.i386 b/sys/arch/i386/conf/Makefile.i386 index ab0f8cd13656..262bec23dbcf 100644 --- a/sys/arch/i386/conf/Makefile.i386 +++ b/sys/arch/i386/conf/Makefile.i386 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.i386,v 1.187 2017/12/10 14:29:47 christos Exp $ +# $NetBSD: Makefile.i386,v 1.188 2018/02/23 09:00:55 maxv Exp $ # Makefile for NetBSD # @@ -35,7 +35,7 @@ GENASSYM_CONF= ${I386}/i386/genassym.cf ## DEFCOPTS= -O2 -fno-omit-frame-pointer CPPFLAGS+= -Di386 -CFLAGS+= -msoft-float +CFLAGS+= -msoft-float -fno-shrink-wrap ## no-sse implies no-sse2 but not no-avx CFLAGS+= -mno-mmx -mno-sse -mno-avx