From 8c82df1430dd52be28c491abd43f805e24be4e6d Mon Sep 17 00:00:00 2001 From: dsl Date: Wed, 5 Feb 2014 18:52:22 +0000 Subject: [PATCH] Change the compiler options to explicitly specify: -mno-mmx -mno-sse -mno-avx -mno-80387 -mno-fp-ret-in-387 Since no-sse implies no-sse2 that should ensure that the compiler really doesn't emit any instructions that might trap trying to use the FPU. On amd64 at least some of those are needed to stop the compiler saving the registers to stack on every varargs function. It might be that -mno-sse did that before. --- sys/arch/amd64/conf/Makefile.amd64 | 7 +++++-- sys/arch/i386/conf/Makefile.i386 | 6 ++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/sys/arch/amd64/conf/Makefile.amd64 b/sys/arch/amd64/conf/Makefile.amd64 index eaa328bb5a74..493f767d8df6 100644 --- a/sys/arch/amd64/conf/Makefile.amd64 +++ b/sys/arch/amd64/conf/Makefile.amd64 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.amd64,v 1.42 2014/01/15 22:25:22 joerg Exp $ +# $NetBSD: Makefile.amd64,v 1.43 2014/02/05 18:52:22 dsl Exp $ # Makefile for NetBSD # @@ -36,7 +36,10 @@ GENASSYM_CONF= ${AMD64}/amd64/genassym.cf DEFCOPTS= -O2 CPPFLAGS+= -Damd64 -Dx86_64 CFLAGS+= -mcmodel=kernel -CFLAGS+= -mno-red-zone -mno-sse -mno-sse2 -mno-sse3 +# -mno-sse implies -mno-sse2 (etc) but doesn't stop avx. +CFLAGS+= -mno-red-zone -mno-mmx -mno-sse -mno-avx +# make absolutely sure we don't get x87 registers used as well +CFLAGS+= -mno-80387 -mno-fp-ret-in-387 ## ## (3) libkern and compat diff --git a/sys/arch/i386/conf/Makefile.i386 b/sys/arch/i386/conf/Makefile.i386 index 6e846619a32e..a1457dbf2003 100644 --- a/sys/arch/i386/conf/Makefile.i386 +++ b/sys/arch/i386/conf/Makefile.i386 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.i386,v 1.179 2014/01/15 22:25:22 joerg Exp $ +# $NetBSD: Makefile.i386,v 1.180 2014/02/05 18:52:22 dsl Exp $ # Makefile for NetBSD # @@ -34,7 +34,9 @@ GENASSYM_CONF= ${I386}/i386/genassym.cf ## (2) compile settings ## CPPFLAGS+= -Di386 -CFLAGS+= -mno-sse -mno-sse2 -mno-sse3 +CFLAGS+= -mno-80387 -mno-fp-ret-in-387 +## no-sse implies no-sse2 but not no-avx +CFLAGS+= -mno-mmx -mno-sse -mno-avx ## ## (3) libkern and compat