From owner-svn-src-head@FreeBSD.ORG Sat May 14 11:26:01 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D1CF106566B; Sat, 14 May 2011 11:26:01 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 22CF58FC08; Sat, 14 May 2011 11:26:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4EBQ1Ih001960; Sat, 14 May 2011 11:26:01 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4EBQ1AQ001958; Sat, 14 May 2011 11:26:01 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201105141126.p4EBQ1AQ001958@svn.freebsd.org> From: Bruce Cran Date: Sat, 14 May 2011 11:26:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221879 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 May 2011 11:26:01 -0000 Author: brucec Date: Sat May 14 11:26:00 2011 New Revision: 221879 URL: http://svn.freebsd.org/changeset/base/221879 Log: gcc and clang semantics imply certain -mno-* flags when other certain -mno-* flags are also specified. This change makes use of this behaviour and removes unneeded -mno-* flags. Note that clang does not yet enable AVX support for any CPU. However at some point in the future it will and since we definitely want to disable it for the kernel, we might as well add the -mno-avx flag now. Submitted by: arundel Modified: head/sys/conf/kern.mk Modified: head/sys/conf/kern.mk ============================================================================== --- head/sys/conf/kern.mk Sat May 14 05:43:33 2011 (r221878) +++ head/sys/conf/kern.mk Sat May 14 11:26:00 2011 (r221879) @@ -25,11 +25,21 @@ CWARNFLAGS?= -Wall -Wredundant-decls -Wn # operations inside the kernel itself. These operations are exclusively # reserved for user applications. # +# gcc: +# Setting -mno-mmx implies -mno-3dnow +# Setting -mno-sse implies -mno-sse2, -mno-sse3 and -mno-ssse3 +# +# clang: +# Setting -mno-mmx implies -mno-3dnow, -mno-3dnowa, -mno-sse, -mno-sse2, +# -mno-sse3, -mno-ssse3, -mno-sse41 and -mno-sse42 +# .if ${MACHINE_CPUARCH} == "i386" .if ${CC:T:Mclang} != "clang" -CFLAGS+= -mno-align-long-strings -mpreferred-stack-boundary=2 +CFLAGS+= -mno-align-long-strings -mpreferred-stack-boundary=2 -mno-sse +.else +CFLAGS+= -mno-aes -mno-avx .endif -CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float +CFLAGS+= -mno-mmx -msoft-float INLINE_LIMIT?= 8000 .endif @@ -61,10 +71,23 @@ INLINE_LIMIT?= 15000 # operations inside the kernel itself. These operations are exclusively # reserved for user applications. # +# gcc: +# Setting -mno-mmx implies -mno-3dnow +# Setting -mno-sse implies -mno-sse2, -mno-sse3, -mno-ssse3 and -mfpmath=387 +# +# clang: +# Setting -mno-mmx implies -mno-3dnow, -mno-3dnowa, -mno-sse, -mno-sse2, +# -mno-sse3, -mno-ssse3, -mno-sse41 and -mno-sse42 +# (-mfpmath= is not supported) +# .if ${MACHINE_CPUARCH} == "amd64" -CFLAGS+= -mcmodel=kernel -mno-red-zone \ - -mfpmath=387 -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 \ - -msoft-float -fno-asynchronous-unwind-tables +.if ${CC:T:Mclang} != "clang" +CFLAGS+= -mno-sse +.else +CFLAGS+= -mno-aes -mno-avx +.endif +CFLAGS+= -mcmodel=kernel -mno-red-zone -mno-mmx -msoft-float \ + -fno-asynchronous-unwind-tables INLINE_LIMIT?= 8000 .endif