ia64/xen-unstable

changeset 9066:e5aba4f62131

Fix tools Makefiles to respect CFLAGS. Disable stack-smash
protection when building vmxassist/hvmloader.

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Tue Feb 28 11:41:54 2006 +0100 (2006-02-28)
parents e77ea156075c
children 62309ca8b708
files tools/firmware/hvmloader/Makefile tools/firmware/vgabios/Makefile tools/firmware/vmxassist/Makefile tools/ioemu/Makefile tools/ioemu/target-i386-dm/Makefile tools/tests/Makefile
line diff
     1.1 --- a/tools/firmware/hvmloader/Makefile	Tue Feb 28 11:07:18 2006 +0100
     1.2 +++ b/tools/firmware/hvmloader/Makefile	Tue Feb 28 11:41:54 2006 +0100
     1.3 @@ -19,7 +19,7 @@
     1.4  #
     1.5  
     1.6  XEN_ROOT = ../../..
     1.7 -include $(XEN_ROOT)/tools/Rules.mk
     1.8 +include $(XEN_ROOT)/Config.mk
     1.9  
    1.10  # The HVM loader is started in 32-bit mode at the address below:
    1.11  LOADADDR = 0x100000
    1.12 @@ -29,9 +29,13 @@ XENINC   =-I$(XEN_ROOT)/tools/libxc
    1.13  
    1.14  OBJECTS	 = hvmloader.o acpi_madt.o 
    1.15  
    1.16 -CC       = gcc
    1.17 +# Disable PIE/SSP if GCC supports them. They can break us.
    1.18 +CFLAGS  += $(call test-gcc-flag,$(CC),-nopie)
    1.19 +CFLAGS  += $(call test-gcc-flag,$(CC),-fno-stack-protector)
    1.20 +CFLAGS  += $(call test-gcc-flag,$(CC),-fno-stack-protector-all)
    1.21 +
    1.22  OBJCOPY  = objcopy
    1.23 -CFLAGS   = $(DEFINES) -I. $(XENINC) -Wall -fno-builtin -O2 -msoft-float
    1.24 +CFLAGS  += $(DEFINES) -I. $(XENINC) -Wall -fno-builtin -O2 -msoft-float
    1.25  CFLAGS  += -m32 -march=i686
    1.26  LDFLAGS  = -m32 -nostdlib -Wl,-N -Wl,-Ttext -Wl,$(LOADADDR)
    1.27  
     2.1 --- a/tools/firmware/vgabios/Makefile	Tue Feb 28 11:07:18 2006 +0100
     2.2 +++ b/tools/firmware/vgabios/Makefile	Tue Feb 28 11:41:54 2006 +0100
     2.3 @@ -1,6 +1,4 @@
     2.4  CC      = gcc
     2.5 -CFLAGS  = -g -O2 -Wall -Wstrict-prototypes
     2.6 -LDFLAGS = 
     2.7  
     2.8  GCC = gcc
     2.9  BCC = bcc
     3.1 --- a/tools/firmware/vmxassist/Makefile	Tue Feb 28 11:07:18 2006 +0100
     3.2 +++ b/tools/firmware/vmxassist/Makefile	Tue Feb 28 11:41:54 2006 +0100
     3.3 @@ -19,7 +19,7 @@
     3.4  #
     3.5  
     3.6  XEN_ROOT = ../../..
     3.7 -include $(XEN_ROOT)/tools/Rules.mk
     3.8 +include $(XEN_ROOT)/Config.mk
     3.9  
    3.10  # The emulator code lives in ROM space
    3.11  TEXTADDR=0x000D0000
    3.12 @@ -27,11 +27,14 @@ TEXTADDR=0x000D0000
    3.13  DEFINES=-DDEBUG -DTEXTADDR=$(TEXTADDR)
    3.14  XENINC=-I$(XEN_ROOT)/tools/libxc
    3.15  
    3.16 -LD       = ld
    3.17 -CC       = gcc
    3.18 +# Disable PIE/SSP if GCC supports them. They can break us.
    3.19 +CFLAGS  += $(call test-gcc-flag,$(CC),-nopie)
    3.20 +CFLAGS  += $(call test-gcc-flag,$(CC),-fno-stack-protector)
    3.21 +CFLAGS  += $(call test-gcc-flag,$(CC),-fno-stack-protector-all)
    3.22 +
    3.23  CPP      = cpp -P
    3.24  OBJCOPY  = objcopy -p -O binary -R .note -R .comment -R .bss -S --gap-fill=0
    3.25 -CFLAGS   = $(DEFINES) -I. $(XENINC) -Wall -fno-builtin -O2 -msoft-float
    3.26 +CFLAGS  += $(DEFINES) -I. $(XENINC) -Wall -fno-builtin -O2 -msoft-float
    3.27  CFLAGS  += -m32 -march=i686
    3.28  LDFLAGS  = -m elf_i386
    3.29  
     4.1 --- a/tools/ioemu/Makefile	Tue Feb 28 11:07:18 2006 +0100
     4.2 +++ b/tools/ioemu/Makefile	Tue Feb 28 11:41:54 2006 +0100
     4.3 @@ -1,6 +1,9 @@
     4.4 +XEN_ROOT=../..
     4.5 +include $(XEN_ROOT)/tools/Rules.mk
     4.6 +
     4.7  -include config-host.mak
     4.8  
     4.9 -CFLAGS=-Wall -O2 -g -fno-strict-aliasing 
    4.10 +CFLAGS+=-Wall -O2 -g -fno-strict-aliasing 
    4.11  ifdef CONFIG_DARWIN
    4.12  CFLAGS+= -mdynamic-no-pic
    4.13  endif
     5.1 --- a/tools/ioemu/target-i386-dm/Makefile	Tue Feb 28 11:07:18 2006 +0100
     5.2 +++ b/tools/ioemu/target-i386-dm/Makefile	Tue Feb 28 11:41:54 2006 +0100
     5.3 @@ -1,7 +1,8 @@
     5.4 +include config.mak
     5.5 +override TARGET_ARCH=i386
     5.6 +
     5.7  XEN_ROOT=../../..
     5.8  include $(XEN_ROOT)/tools/Rules.mk
     5.9 -include config.mak
    5.10 -override TARGET_ARCH=i386
    5.11  
    5.12  INSTALL_DIR := $(DESTDIR)/usr/$(LIBDIR)/xen/bin
    5.13  TARGET_PATH=$(SRC_PATH)/target-$(TARGET_ARCH)
    5.14 @@ -12,7 +13,7 @@ ifdef CONFIG_USER_ONLY
    5.15  VPATH+=:$(SRC_PATH)/linux-user
    5.16  DEFINES+=-I$(SRC_PATH)/linux-user -I$(SRC_PATH)/linux-user/$(TARGET_ARCH)
    5.17  endif
    5.18 -CFLAGS=-Wall -O2 -g -fno-strict-aliasing
    5.19 +CFLAGS+=-Wall -O2 -g -fno-strict-aliasing
    5.20  LDFLAGS=-g
    5.21  LIBS=
    5.22  HELPER_CFLAGS=$(CFLAGS)
     6.1 --- a/tools/tests/Makefile	Tue Feb 28 11:07:18 2006 +0100
     6.2 +++ b/tools/tests/Makefile	Tue Feb 28 11:41:54 2006 +0100
     6.3 @@ -4,13 +4,12 @@ include $(XEN_ROOT)/tools/Rules.mk
     6.4  
     6.5  TARGET := test_x86_emulator
     6.6  
     6.7 -CC     := gcc
     6.8 -CFLAGS := -O2 -Wall -Werror -D__TEST_HARNESS__
     6.9 +HOSTCFLAGS += -D__TEST_HARNESS__
    6.10  
    6.11  all: $(TARGET)
    6.12  
    6.13  $(TARGET): x86_emulate.o test_x86_emulator.o
    6.14 -	$(CC) -o $@ $^
    6.15 +	$(HOSTCC) -o $@ $^
    6.16  
    6.17  clean:
    6.18  	rm -rf $(TARGET) *.o *~ core
    6.19 @@ -18,7 +17,7 @@ clean:
    6.20  install:
    6.21  
    6.22  x86_emulate.o: $(XEN_ROOT)/xen/arch/x86/x86_emulate.c
    6.23 -	$(CC) $(CFLAGS) -I$(XEN_ROOT)/xen/include -c -o $@ $<
    6.24 +	$(HOSTCC) $(HOSTCFLAGS) -I$(XEN_ROOT)/xen/include -c -o $@ $<
    6.25  
    6.26  %.o: %.c
    6.27 -	$(CC) $(CFLAGS) -I$(XEN_ROOT)/xen/include -c -o $@ $<
    6.28 +	$(HOSTCC) $(HOSTCFLAGS) -I$(XEN_ROOT)/xen/include -c -o $@ $<