From owner-freebsd-current@FreeBSD.ORG Thu Jun 10 18:40:04 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F37BB106574D for ; Thu, 10 Jun 2010 18:40:03 +0000 (UTC) (envelope-from mj@feral.com) Received: from ns1.feral.com (ns1.feral.com [192.67.166.1]) by mx1.freebsd.org (Postfix) with ESMTP id ABE0D8FC1B for ; Thu, 10 Jun 2010 18:40:03 +0000 (UTC) Received: from [192.168.221.2] (remotevpn [192.168.221.2]) by ns1.feral.com (8.14.3/8.14.3) with ESMTP id o5AIdd8r095701 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO) for ; Thu, 10 Jun 2010 11:40:02 -0700 (PDT) (envelope-from mj@feral.com) Message-ID: <4C113167.8040205@feral.com> Date: Thu, 10 Jun 2010 11:39:35 -0700 From: Matthew Jacob Organization: Feral Software User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.9) Gecko/20100317 Thunderbird/3.0.4 MIME-Version: 1.0 To: freebsd-current@freebsd.org Content-Type: multipart/mixed; boundary="------------050008000309090800070900" X-Greylist: Sender DNS name whitelisted, not delayed by milter-greylist-4.2.3 (ns1.feral.com [192.168.221.1]); Thu, 10 Jun 2010 11:40:03 -0700 (PDT) Subject: kernel make noise with clang suppression X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2010 18:40:04 -0000 This is a multi-part message in MIME format. --------------050008000309090800070900 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Comments? (yes, I know -fformat-extensions have just been added...) --------------050008000309090800070900 Content-Type: text/plain; name="kmknoise.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="kmknoise.patch" diff -r ea5e09d013e7 sys/conf/kern.mk --- a/sys/conf/kern.mk Thu Jun 10 07:40:51 2010 -0700 +++ b/sys/conf/kern.mk Thu Jun 10 11:35:50 2010 -0700 @@ -9,6 +9,10 @@ .if ${CC} == "icc" #CWARNFLAGS= -w2 # use this if you are terribly bored CWARNFLAGS= +.elif ${CC} == "clang" +CWARNFLAGS?= -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes \ + -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual \ + -Wundef -Wno-pointer-sign .else CWARNFLAGS?= -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes \ -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual \ @@ -63,9 +67,15 @@ # reserved for user applications. # .if ${MACHINE_ARCH} == "amd64" +.if ${CC} == "clang" +CFLAGS+= -mcmodel=kernel -mno-red-zone \ + -mno-sse -mno-sse2 -mno-sse3 -mno-mmx -mno-3dnow \ + -msoft-float -fno-asynchronous-unwind-tables +.else CFLAGS+= -mcmodel=kernel -mno-red-zone \ -mfpmath=387 -mno-sse -mno-sse2 -mno-sse3 -mno-mmx -mno-3dnow \ -msoft-float -fno-asynchronous-unwind-tables +.endif INLINE_LIMIT?= 8000 .endif diff -r ea5e09d013e7 sys/conf/kern.pre.mk --- a/sys/conf/kern.pre.mk Thu Jun 10 07:40:51 2010 -0700 +++ b/sys/conf/kern.pre.mk Thu Jun 10 11:35:50 2010 -0700 @@ -30,7 +30,11 @@ _MINUS_O= -O2 . endif . if ${MACHINE_ARCH} == "amd64" +. if ${CC} == "clang" +COPTFLAGS?=-O2 -pipe +. else COPTFLAGS?=-O2 -frename-registers -pipe +. endif . else COPTFLAGS?=${_MINUS_O} -pipe . endif @@ -89,7 +93,7 @@ CFLAGS= ${COPTFLAGS} ${C_DIALECT} ${DEBUG} ${CWARNFLAGS} CFLAGS+= ${INCLUDES} -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -.if ${CC} != "icc" +.if ${CC} != "icc" && ${CC} != "clang" CFLAGS+= -fno-common -finline-limit=${INLINE_LIMIT} CFLAGS+= --param inline-unit-growth=100 CFLAGS+= --param large-function-growth=1000 diff -r ea5e09d013e7 sys/conf/kmod.mk --- a/sys/conf/kmod.mk Thu Jun 10 07:40:51 2010 -0700 +++ b/sys/conf/kmod.mk Thu Jun 10 11:35:50 2010 -0700 @@ -111,7 +111,7 @@ # for example. CFLAGS+= -I@/contrib/altq -.if ${CC} != "icc" +.if ${CC} != "icc" && ${CC} != "clang" CFLAGS+= -finline-limit=${INLINE_LIMIT} CFLAGS+= --param inline-unit-growth=100 CFLAGS+= --param large-function-growth=1000 --------------050008000309090800070900--