From owner-freebsd-toolchain@FreeBSD.ORG Thu Oct 13 20:27:59 2011 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id 721F1106566B; Thu, 13 Oct 2011 20:27:59 +0000 (UTC) Date: Thu, 13 Oct 2011 20:27:59 +0000 From: Alexander Best To: freebsd-toolchain@freebsd.org Message-ID: <20111013202759.GA11993@freebsd.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="rwEMma7ioTxnRzrJ" Content-Disposition: inline Subject: small patch to get rid of -frename-registers when using clang X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Oct 2011 20:27:59 -0000 --rwEMma7ioTxnRzrJ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline hi there, any thoughts regarding this patch? it makes sure -frename-registers doesn't get used, when the compiler is clang. nothing spectacular, but it cleans up stdout a bit. it also makes sure that when debugging was enabled, amd64 gets compiled with -O instead of -O2, just like all the other archs. i'm not sure, if this is really the right thing to do, but i don't really understand the current behavior. why should -O2 be set, when the users indicated that he wants to compile a kernel for debugging? sure amd64 supports debugging with -O2, as noted in the svn history of kern.pre.mk. however even on amd64 a -O2 kernel and a -O kernel aren't the same when it comes to debugging capabilities. however, i'm not really sure about this. bde@ probably has an opinion regarding this matter. cheers. alex --rwEMma7ioTxnRzrJ Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="kern.pre.mk.diff" diff --git a/sys/conf/kern.pre.mk b/sys/conf/kern.pre.mk index 2320b89..badf7ef 100644 --- a/sys/conf/kern.pre.mk +++ b/sys/conf/kern.pre.mk @@ -33,8 +33,8 @@ _MINUS_O= -O # gcc miscompiles some code at -O2 _MINUS_O= -O2 .endif .endif -.if ${MACHINE_CPUARCH} == "amd64" -COPTFLAGS?=-O2 -frename-registers -pipe +.if ${MACHINE_CPUARCH} == "amd64" && ${CC:T:Mclang} != "clang" +COPTFLAGS?=${_MINUS_O} -frename-registers -pipe .else COPTFLAGS?=${_MINUS_O} -pipe .endif --rwEMma7ioTxnRzrJ--