public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo-x86 commit in sys-freebsd/freebsd-sources/files: freebsd-sources-9.0-gcc-disable-optimization.patch
@ 2012-05-27  8:42 Richard Yao (ryao)
  0 siblings, 0 replies; only message in thread
From: Richard Yao (ryao) @ 2012-05-27  8:42 UTC (permalink / raw
  To: gentoo-commits

ryao        12/05/27 08:42:25

  Added:                freebsd-sources-9.0-gcc-disable-optimization.patch
  Log:
  Revise solution to bug #410945 to only apply to GCC.
  
  (Portage version: 2.1.10.49/cvs/Linux x86_64)

Revision  Changes    Path
1.1                  sys-freebsd/freebsd-sources/files/freebsd-sources-9.0-gcc-disable-optimization.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-freebsd/freebsd-sources/files/freebsd-sources-9.0-gcc-disable-optimization.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-freebsd/freebsd-sources/files/freebsd-sources-9.0-gcc-disable-optimization.patch?rev=1.1&content-type=text/plain

Index: freebsd-sources-9.0-gcc-disable-optimization.patch
===================================================================
Taken from debian GNU/kFreeBSD.

Regretably, with GCC 4.4 or later this is the only flag combination
I could find that doesn't cause kernel panics CPU triple-faults or
other kind of severe breakage. This is Gentoo Bug #410945.

We restrict this to GCC so that Clang can use -O2.

--- a/sys/conf/kern.pre.mk
+++ b/sys/conf/kern.pre.mk
@@ -41,6 +41,9 @@
 .if !empty(COPTFLAGS:M-O[23s]) && empty(COPTFLAGS:M-fno-strict-aliasing)
 COPTFLAGS+= -fno-strict-aliasing
 .endif
+.if ${CC:T:Mgcc} == "gcc" && !empty(COPTFLAGS:M-O[23s])
+COPTFLAGS+= -O1
+.endif
 .if !defined(NO_CPU_COPTFLAGS)
 COPTFLAGS+= ${_CPUCFLAGS}
 .endif
--- a/sys/conf/kmod.mk
+++ b/sys/conf/kmod.mk
@@ -91,6 +91,9 @@
 .if !empty(CFLAGS:M-O[23s]) && empty(CFLAGS:M-fno-strict-aliasing)
 CFLAGS+=	-fno-strict-aliasing
 .endif
+.if ${CC:T:Mgcc} == "gcc" && !empty(CFLAGS:M-O[23s])
+CFLAGS+=	-O1
+.endif
 WERROR?=	-Werror
 CFLAGS+=	${WERROR}
 CFLAGS+=	-D_KERNEL






^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-05-27  8:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-27  8:42 [gentoo-commits] gentoo-x86 commit in sys-freebsd/freebsd-sources/files: freebsd-sources-9.0-gcc-disable-optimization.patch Richard Yao (ryao)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox