From 7eca6a5e56f468a58e1ef1feb8bd8705b6273e9d Mon Sep 17 00:00:00 2001 From: Nikunj A Dadhania Date: Thu, 22 Aug 2013 10:40:46 +0530 Subject: Add -fno-strict-aliasing in global CFLAGS This solves the bad checksum issue in udp header. The fill_udp_checksum() function suffers from "strict aliasing" problem as it is doing quite a bit of pointer casting. Signed-off-by: Avik Sil Signed-off-by: Nikunj A Dadhania --- drivers/bcm57xx/Makefile | 2 +- drivers/common/Makefile | 2 +- make.rules | 2 +- slof/Makefile.inc | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/bcm57xx/Makefile b/drivers/bcm57xx/Makefile index 87bb3bf..41babcb 100644 --- a/drivers/bcm57xx/Makefile +++ b/drivers/bcm57xx/Makefile @@ -16,7 +16,7 @@ ifndef TOP endif include $(TOP)/make.rules -CFLAGS = -O2 -I. -I../common -I$(TOP)/clients/net-snk/include -I$(TOP)/lib/libc/include -fno-builtin -ffreestanding -msoft-float -Wall -nostdinc +CFLAGS += -O2 -I. -I../common -I$(TOP)/clients/net-snk/include -I$(TOP)/lib/libc/include -fno-builtin -ffreestanding -msoft-float -Wall -nostdinc SRCS = bcm57xx.c diff --git a/drivers/common/Makefile b/drivers/common/Makefile index 8b3ebe1..dc5fd86 100644 --- a/drivers/common/Makefile +++ b/drivers/common/Makefile @@ -16,7 +16,7 @@ ifndef TOP endif include $(TOP)/make.rules -CFLAGS = -O2 -I./ -I$(TOP)/clients/net-snk/include/ -I$(TOP)/lib/libc/include/ -fno-builtin -ffreestanding -msoft-float -nostdinc -Wall +CFLAGS += -O2 -I./ -I$(TOP)/clients/net-snk/include/ -I$(TOP)/lib/libc/include/ -fno-builtin -ffreestanding -msoft-float -nostdinc -Wall SRCS = module_entry.c diff --git a/make.rules b/make.rules index 867245d..dae1572 100644 --- a/make.rules +++ b/make.rules @@ -62,7 +62,7 @@ RANLIB ?= $(CROSS)ranlib CPP ?= $(CROSS)cpp WARNFLAGS = -Wall -Wmissing-prototypes -Wstrict-prototypes -CFLAGS ?= -g -O2 -fno-builtin -ffreestanding -nostdinc -msoft-float \ +CFLAGS ?= -g -O2 -fno-builtin -ffreestanding -nostdinc -msoft-float -fno-strict-aliasing \ -mno-altivec -mabi=no-altivec -fno-stack-protector $(WARNFLAGS) export CC AS LD CLEAN OBJCOPY OBJDUMP STRIP AR RANLIB CFLAGS diff --git a/slof/Makefile.inc b/slof/Makefile.inc index e08491f..d5878a3 100644 --- a/slof/Makefile.inc +++ b/slof/Makefile.inc @@ -29,7 +29,7 @@ INCLBRDDIR ?= $(TOPBRDDIR)/include CPPFLAGS += -I. -I$(INCLCMNDIR) -I$(INCLBRDDIR) -I$(INCLCMNDIR)/$(CPUARCH) CFLAGS = -DTARG=$(TARG) -static -Wall -W -std=gnu99 \ -O2 -fomit-frame-pointer -msoft-float $(FLAG) $(CPUARCHDEF) \ - -fno-stack-protector + -fno-stack-protector -fno-strict-aliasing ASFLAGS = -Wa,-mpower4 -Wa,-mregnames $(FLAG) $(CPUARCHDEF) LDFLAGS += -static -nostdlib -Wl,-q,-n -- cgit v1.1