Skip to contentSkip to conversation

-fno-strict-aliasing problem in the latest 2.3

DISCUSSION Harald Koerfgen 2 participants 2 messages Feb 16, 2000 – Feb 17, 2000 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive

Hi,

Quoted 7 lines · 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

Makefile renamed from nfs/cvs/linux-2.3/linux/Makefile +0 -2
@@ -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 $<

#2 lore raw
Quoted 9 lines · Harald Koerfgen
Quoted 7 lines · 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.

Quoted 4 lines

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?

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

Ralf