Subject: RE: -fno-strict-aliasing problem in the latest 2.3

From: Harald Koerfgen <[email-masked]>
Date: Wed, 16 Feb 2000 19:03:19 +0100 (MET)

Hi,

On 15-Feb-00 Gleb O. Raiko wrote:
> There is a problem with the way main Makefile determines whether the
> compiler suports -fno-strict-aliasing. Namely, Makefile blindly gets $CC
> and tries to feed this option to it. Unfortunately, we set CC to proper
> mips[el]-linux-gcc later in arch/mips/Makefile, so the main Makefile
> just checks against native gcc. On RH6.1 with latest cross tool rpms
> installed, I get cc1: Invalid option `-fno-strict-aliasing' during
> comppilation, obviously.

I am not exactly shure if it has ill side effects or if this may not be wanted
for some reason, but the attached patch fixes that for me.

OK to commit?
---
Regards,
Harald
--- /nfs/cvs/linux-2.3/linux/Makefile	Wed Feb 16 18:40:57 2000
+++ Makefile	Wed Feb 16 18:53:13 2000
@@ -96,9 +96,6 @@
 CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
 AFLAGS := $(CPPFLAGS)
 
-# 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)
-
 #
 # if you want the RAM disk device, define this to be the
 # size in blocks.
@@ -252,6 +249,9 @@
 endif
 
 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)
 
 .S.s:
 	$(CC) -D__ASSEMBLY__ $(AFLAGS) -traditional -E -o $*.s $<

---

From: Ralf Baechle <[email-masked]>
Date: Thu, 17 Feb 2000 14:25:29 +0100

> for some reason, but the attached patch fixes that for me.

Yes, my solution is identical, so who commits first commits first :)

  Ralf