-fno-strict-aliasing problem in the latest 2.3
Hi,
Quoted 7 lines · On 15-Feb-00 Gleb O. Raiko wrote:
There is a problem with the way main
Makefiledetermines whether the compiler suports -fno-strict-aliasing. Namely,Makefileblindly gets $CC and tries to feed this option to it. Unfortunately, we set CC to proper mips[el]-linux-gcc later inarch/mips/Makefile, so the mainMakefilejust 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 $<
Quoted 9 lines · Harald Koerfgen
Quoted 7 lines · On 15-Feb-00 Gleb O. Raiko wrote:
There is a problem with the way main
Makefiledetermines whether the compiler suports -fno-strict-aliasing. Namely,Makefileblindly gets $CC and tries to feed this option to it. Unfortunately, we set CC to proper mips[el]-linux-gcc later inarch/mips/Makefile, so the mainMakefilejust 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