PATCH 2.4.0.10.6: always no-strict-aliasing

Message ID 39F93E20.EC1C2D9@mandrakesoft.com
State New, archived
Headers show
Series
  • PATCH 2.4.0.10.6: always no-strict-aliasing
Related show

Commit Message

Jeff Garzik Oct. 27, 2000, 8:34 a.m. UTC
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?

Patch

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