PATCH 2.4.0.10.6: always no-strict-aliasing

Jeff Garzik
2000-10-27T08:35:35Z

[-- Attachment #1: Type: text/plain, Size: 775 bytes --]

Linus Torvalds wrote:
> (a) the new compiler requirements (sorry, but it turned out that 2.7.2.3
> really is too subtly broken with named structure initializers that
> are very heavily used these days inside the kernel)
>
> Suggested stable compiler: gcc-2.91.66, aka egcs-1.1.2, which is the
> one most vendors have been shipping for a long time, and while sure
> to be buggy too has not been found to be seriously so at least yet.
>
> Other modern gcc versions may well work too.

Since egcs-1.1.2 supports -fno-strict-aliasing, would the attached patch
against linux/Makefile be appropriate?

--
Jeff Garzik | Raft naked...
Building 1024 | It adds color to your cheeks.
MandrakeSoft |

[-- Attachment #2: makefile.patch --]
[-- Type: text/plain, Size: 1129 bytes --]

Index: Makefile
===================================================================
RCS file: /cvsroot/gkernel/linux_2_4/Makefile,v
retrieving revision 1.1.1.11
diff -u -r1.1.1.11 Makefile
--- Makefile 2000/10/22 23:14:50 1.1.1.11
+++ Makefile 2000/10/27 08:32:28
@@ -16,7 +16,7 @@
FINDHPATH = $(HPATH)/asm $(HPATH)/linux $(HPATH)/scsi $(HPATH)/net

HOSTCC = gcc
-HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
+HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -fno-strict-aliasing

CROSS_COMPILE =

@@ -87,7 +87,7 @@

CPPFLAGS := -D__KERNEL__ -I$(HPATH)

-CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
+CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -fno-strict-aliasing
AFLAGS := -D__ASSEMBLY__ $(CPPFLAGS)

#
@@ -181,9 +181,6 @@
DRIVERS += $(DRIVERS-y)

include arch/$(ARCH)/Makefile
-
-# use '-fno-strict-aliasing', but only if the compiler can take it
-CFLAGS += $(shell if $(CC) -fno-strict-aliasing -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-fno-strict-aliasing"; fi)

export CPPFLAGS CFLAGS AFLAGS