ia64/xen-unstable

changeset 2975:b902d48320c4

bitkeeper revision 1.1159.170.21 (41978006yk1bg04SJNSN2JWccT5adA)

Disable PIE/SSP features when building Xen, if GCC supports them.
author kaf24@freefall.cl.cam.ac.uk
date Sun Nov 14 15:55:50 2004 +0000 (2004-11-14)
parents 3c505be01ff1
children ac9c463cbf78
files xen/Rules.mk xen/arch/x86/Rules.mk
line diff
     1.1 --- a/xen/Rules.mk	Sat Nov 13 17:32:43 2004 +0000
     1.2 +++ b/xen/Rules.mk	Sun Nov 14 15:55:50 2004 +0000
     1.3 @@ -39,6 +39,8 @@ ALL_OBJS += $(BASEDIR)/arch/$(TARGET_ARC
     1.4  HOSTCC     = gcc
     1.5  HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer 
     1.6  
     1.7 +test-gcc-flag = $(shell gcc -v --help 2>&1 | grep -q " $(1) " && echo $(1))
     1.8 +
     1.9  include $(BASEDIR)/arch/$(TARGET_ARCH)/Rules.mk
    1.10  
    1.11  ifneq ($(debug),y)
    1.12 @@ -62,6 +64,8 @@ ifeq ($(trace),y)
    1.13  CFLAGS += -DTRACE_BUFFER
    1.14  endif
    1.15  
    1.16 +CFLAGS := $(strip $(CFLAGS))
    1.17 +
    1.18  %.o: %.c $(HDRS) Makefile
    1.19  	$(CC) $(CFLAGS) -c $< -o $@
    1.20  
     2.1 --- a/xen/arch/x86/Rules.mk	Sat Nov 13 17:32:43 2004 +0000
     2.2 +++ b/xen/arch/x86/Rules.mk	Sun Nov 14 15:55:50 2004 +0000
     2.3 @@ -14,10 +14,14 @@ else
     2.4  x86_32/usercopy.o: CFLAGS += -O1
     2.5  endif
     2.6  
     2.7 -
     2.8  # Prevent floating-point variables from creeping into Xen.
     2.9  CFLAGS  += -msoft-float
    2.10  
    2.11 +# Disable PIE/SSP if GCC supports them. They can break us.
    2.12 +CFLAGS  += $(call test-gcc-flag,-nopie)
    2.13 +CFLAGS  += $(call test-gcc-flag,-fno-stack-protector)
    2.14 +CFLAGS  += $(call test-gcc-flag,-fno-stack-protector-all)
    2.15 +
    2.16  ifeq ($(TARGET_SUBARCH),x86_32)
    2.17  CFLAGS  += -m32 -march=i686
    2.18  LDFLAGS := --oformat elf32-i386