On Tue, Feb 15, 2000 at 12:36:26PM +0300, 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 can't offer an elegenat solution to resolve this problem. Basically, I
> see three choices:
> 1. Move logic that sets CC from arch/mips/Makefile to the main Makefile
> (Nightmare for Ralf who have to either feed it to Linus or add this
> logic in the main Makefile every merge, I think.)
This is a generic problem which affects all architectures so there is no
reason why to put it to somewhere else than into the main Makefile.
> 2. Filter CFLAGS to remove -fno-strict-aliasing in arch/mips/Makefile
> 3. Fix the mips compiler :-)
Don't fix what isn't broken.
> (Looks good for me despite the fact I don't understand exctly how
> much work it costs, but can imagine...)
The fix is trivial, move the offending lines:
# 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)
down below the ``include arch/$(ARCH)/Makefile'' statement and you're
set. I'll send this to CVS.