direct-io.hg

changeset 15497:8528da5be577

Specify -fno-strict-aliasing in root build config file.

Fixes correctness issues with xenstored and gcc-4.2.

Original patch by Charles Coffing <ccoffing@novell.com>

Signed-off-by: Keir Fraser <keir@xensource.com>
author Keir Fraser <keir@xensource.com>
date Sat Jul 07 10:31:15 2007 +0100 (2007-07-07)
parents 15fe623c3421
children 41c8284cfc0c
files Config.mk tools/blktap/drivers/Makefile tools/blktap/lib/Makefile tools/libxc/Makefile tools/xcutils/Makefile xen/arch/ia64/Rules.mk xen/arch/powerpc/Rules.mk xen/arch/x86/Rules.mk
line diff
     1.1 --- a/Config.mk	Sat Jul 07 10:09:51 2007 +0100
     1.2 +++ b/Config.mk	Sat Jul 07 10:31:15 2007 +0100
     1.3 @@ -17,8 +17,9 @@ CONFIG_$(XEN_OS) := y
     1.4  SHELL     ?= /bin/sh
     1.5  
     1.6  # Tools to run on system hosting the build
     1.7 -HOSTCC     = gcc
     1.8 -HOSTCFLAGS = -Wall -Werror -Wstrict-prototypes -O2 -fomit-frame-pointer
     1.9 +HOSTCC      = gcc
    1.10 +HOSTCFLAGS  = -Wall -Werror -Wstrict-prototypes -O2 -fomit-frame-pointer
    1.11 +HOSTCFLAGS += -fno-strict-aliasing
    1.12  
    1.13  DISTDIR     ?= $(XEN_ROOT)/dist
    1.14  DESTDIR     ?= /
    1.15 @@ -58,6 +59,8 @@ else
    1.16  CFLAGS += -g
    1.17  endif
    1.18  
    1.19 +CFLAGS += -fno-strict-aliasing
    1.20 +
    1.21  CFLAGS += -std=gnu99
    1.22  
    1.23  CFLAGS += -Wall -Wstrict-prototypes
     2.1 --- a/tools/blktap/drivers/Makefile	Sat Jul 07 10:09:51 2007 +0100
     2.2 +++ b/tools/blktap/drivers/Makefile	Sat Jul 07 10:31:15 2007 +0100
     2.3 @@ -10,7 +10,6 @@ LIBAIO_DIR   = ../../libaio/src
     2.4  
     2.5  CFLAGS   += -Werror
     2.6  CFLAGS   += -Wno-unused
     2.7 -CFLAGS   += -fno-strict-aliasing
     2.8  CFLAGS   += -I $(XEN_LIBXC) -I $(LIBAIO_DIR)
     2.9  CFLAGS   += $(INCLUDES) -I. -I../../xenstore 
    2.10  CFLAGS   += -D_GNU_SOURCE
     3.1 --- a/tools/blktap/lib/Makefile	Sat Jul 07 10:09:51 2007 +0100
     3.2 +++ b/tools/blktap/lib/Makefile	Sat Jul 07 10:31:15 2007 +0100
     3.3 @@ -16,7 +16,7 @@ SRCS     += xenbus.c blkif.c xs_api.c
     3.4  
     3.5  CFLAGS   += -Werror
     3.6  CFLAGS   += -Wno-unused
     3.7 -CFLAGS   += -fno-strict-aliasing -fPIC
     3.8 +CFLAGS   += -fPIC
     3.9  # get asprintf():
    3.10  CFLAGS   += -D _GNU_SOURCE
    3.11  
     4.1 --- a/tools/libxc/Makefile	Sat Jul 07 10:09:51 2007 +0100
     4.2 +++ b/tools/libxc/Makefile	Sat Jul 07 10:31:15 2007 +0100
     4.3 @@ -57,7 +57,6 @@ GUEST_SRCS-$(CONFIG_POWERPC) += xc_dom_p
     4.4  -include $(XEN_TARGET_ARCH)/Makefile
     4.5  
     4.6  CFLAGS   += -Werror -Wmissing-prototypes
     4.7 -CFLAGS   += -fno-strict-aliasing
     4.8  CFLAGS   += $(INCLUDES) -I. -I../xenstore
     4.9  
    4.10  # Needed for posix_fadvise64() in xc_linux.c
     5.1 --- a/tools/xcutils/Makefile	Sat Jul 07 10:09:51 2007 +0100
     5.2 +++ b/tools/xcutils/Makefile	Sat Jul 07 10:31:15 2007 +0100
     5.3 @@ -15,7 +15,7 @@ PROGRAMS_INSTALL_DIR = /usr/$(LIBDIR)/xe
     5.4  
     5.5  INCLUDES += -I $(XEN_LIBXC) -I $(XEN_XENSTORE)
     5.6  
     5.7 -CFLAGS += -Werror -fno-strict-aliasing
     5.8 +CFLAGS += -Werror
     5.9  CFLAGS += $(INCLUDES)
    5.10  
    5.11  # Make gcc generate dependencies.
     6.1 --- a/xen/arch/ia64/Rules.mk	Sat Jul 07 10:09:51 2007 +0100
     6.2 +++ b/xen/arch/ia64/Rules.mk	Sat Jul 07 10:31:15 2007 +0100
     6.3 @@ -18,7 +18,7 @@ endif
     6.4  # Used only by linux/Makefile.
     6.5  AFLAGS_KERNEL  += -mconstant-gp -nostdinc $(CPPFLAGS)
     6.6  
     6.7 -CFLAGS	+= -nostdinc -fno-builtin -fno-common -fno-strict-aliasing
     6.8 +CFLAGS	+= -nostdinc -fno-builtin -fno-common
     6.9  CFLAGS	+= -mconstant-gp
    6.10  #CFLAGS  += -O3		# -O3 over-inlines making debugging tough!
    6.11  CFLAGS	+= -O2		# but no optimization causes compile errors!
     7.1 --- a/xen/arch/powerpc/Rules.mk	Sat Jul 07 10:09:51 2007 +0100
     7.2 +++ b/xen/arch/powerpc/Rules.mk	Sat Jul 07 10:31:15 2007 +0100
     7.3 @@ -9,7 +9,7 @@ C_WARNINGS := -Wredundant-decls
     7.4  # _no_ common code can have packed data structures or we are in touble.
     7.5  C_WARNINGS += -Wpacked
     7.6  
     7.7 -CFLAGS := -m64 -ffreestanding -fno-builtin -fno-common -fno-strict-aliasing
     7.8 +CFLAGS := -m64 -ffreestanding -fno-builtin -fno-common
     7.9  CFLAGS += -iwithprefix include -Wall -Werror -pipe
    7.10  CFLAGS += -I$(BASEDIR)/include
    7.11  CFLAGS += -I$(BASEDIR)/include/asm-powerpc/mach-generic
     8.1 --- a/xen/arch/x86/Rules.mk	Sat Jul 07 10:09:51 2007 +0100
     8.2 +++ b/xen/arch/x86/Rules.mk	Sat Jul 07 10:31:15 2007 +0100
     8.3 @@ -17,7 +17,7 @@ ifneq ($(XEN_OS),SunOS)
     8.4  CFLAGS += -nostdinc
     8.5  endif
     8.6  
     8.7 -CFLAGS += -fno-builtin -fno-common -fno-strict-aliasing
     8.8 +CFLAGS += -fno-builtin -fno-common
     8.9  CFLAGS += -iwithprefix include -Werror -Wno-pointer-arith -pipe
    8.10  CFLAGS += -I$(BASEDIR)/include 
    8.11  CFLAGS += -I$(BASEDIR)/include/asm-x86/mach-generic