Re: where to place -fno-strict aliasing

Richard Henderson (rth@twiddle.net)
Sun, 11 Jul 1999 15:45:22 -0700


On Fri, Jul 09, 1999 at 11:30:33PM +0000, Philipp Thomas wrote:
> Now I only ever dealt with the intel side for which the place I'd
> choose would be arch/i386/Makefile for up to 2.2.X and CFLAGS in
> linux/Makefile beginning with 2.3.X. Is this correct ? And where would
> it have to be put for other architectures ?

It's not an architecture specific problem. I suggest the following.

r~

diff -rup 2.2.11-pre1/Makefile 2.2.11-axp/Makefile
--- 2.2.11-pre1/Makefile Tue Jun 29 00:11:25 1999
+++ 2.2.11-axp/Makefile Tue Jun 29 00:13:46 1999
@@ -86,7 +86,13 @@ SVGA_MODE= -DSVGA_MODE=NORMAL_VGA
# standard CFLAGS
#

+# Determine if gcc understands the -fno-strict-aliasing flag
+have_NSA := $(shell if $(CC) -fno-strict-aliasing -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo y; else echo n; fi)
+
CFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
+ifeq ($(have_NSA),y)
+ CFLAGS += -fno-strict-aliasing
+endif

ifdef CONFIG_SMP
CFLAGS += -D__SMP__

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/