WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] Fix tools Makefiles to respect CFLAGS. Disable stack-sma

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Fix tools Makefiles to respect CFLAGS. Disable stack-smash
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 28 Feb 2006 12:34:07 +0000
Delivery-date: Tue, 28 Feb 2006 12:34:27 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID e5aba4f62131528f7f5526f7807784439aa2b8e2
# Parent  e77ea156075cd9c8eeb942efbf5a8cdb1c33eb09
Fix tools Makefiles to respect CFLAGS. Disable stack-smash
protection when building vmxassist/hvmloader.

Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>

diff -r e77ea156075c -r e5aba4f62131 tools/firmware/hvmloader/Makefile
--- a/tools/firmware/hvmloader/Makefile Tue Feb 28 10:07:18 2006
+++ b/tools/firmware/hvmloader/Makefile Tue Feb 28 10:41:54 2006
@@ -19,7 +19,7 @@
 #
 
 XEN_ROOT = ../../..
-include $(XEN_ROOT)/tools/Rules.mk
+include $(XEN_ROOT)/Config.mk
 
 # The HVM loader is started in 32-bit mode at the address below:
 LOADADDR = 0x100000
@@ -29,9 +29,13 @@
 
 OBJECTS         = hvmloader.o acpi_madt.o 
 
-CC       = gcc
+# Disable PIE/SSP if GCC supports them. They can break us.
+CFLAGS  += $(call test-gcc-flag,$(CC),-nopie)
+CFLAGS  += $(call test-gcc-flag,$(CC),-fno-stack-protector)
+CFLAGS  += $(call test-gcc-flag,$(CC),-fno-stack-protector-all)
+
 OBJCOPY  = objcopy
-CFLAGS   = $(DEFINES) -I. $(XENINC) -Wall -fno-builtin -O2 -msoft-float
+CFLAGS  += $(DEFINES) -I. $(XENINC) -Wall -fno-builtin -O2 -msoft-float
 CFLAGS  += -m32 -march=i686
 LDFLAGS  = -m32 -nostdlib -Wl,-N -Wl,-Ttext -Wl,$(LOADADDR)
 
diff -r e77ea156075c -r e5aba4f62131 tools/firmware/vgabios/Makefile
--- a/tools/firmware/vgabios/Makefile   Tue Feb 28 10:07:18 2006
+++ b/tools/firmware/vgabios/Makefile   Tue Feb 28 10:41:54 2006
@@ -1,6 +1,4 @@
 CC      = gcc
-CFLAGS  = -g -O2 -Wall -Wstrict-prototypes
-LDFLAGS = 
 
 GCC = gcc
 BCC = bcc
diff -r e77ea156075c -r e5aba4f62131 tools/firmware/vmxassist/Makefile
--- a/tools/firmware/vmxassist/Makefile Tue Feb 28 10:07:18 2006
+++ b/tools/firmware/vmxassist/Makefile Tue Feb 28 10:41:54 2006
@@ -19,7 +19,7 @@
 #
 
 XEN_ROOT = ../../..
-include $(XEN_ROOT)/tools/Rules.mk
+include $(XEN_ROOT)/Config.mk
 
 # The emulator code lives in ROM space
 TEXTADDR=0x000D0000
@@ -27,11 +27,14 @@
 DEFINES=-DDEBUG -DTEXTADDR=$(TEXTADDR)
 XENINC=-I$(XEN_ROOT)/tools/libxc
 
-LD       = ld
-CC       = gcc
+# Disable PIE/SSP if GCC supports them. They can break us.
+CFLAGS  += $(call test-gcc-flag,$(CC),-nopie)
+CFLAGS  += $(call test-gcc-flag,$(CC),-fno-stack-protector)
+CFLAGS  += $(call test-gcc-flag,$(CC),-fno-stack-protector-all)
+
 CPP      = cpp -P
 OBJCOPY  = objcopy -p -O binary -R .note -R .comment -R .bss -S --gap-fill=0
-CFLAGS   = $(DEFINES) -I. $(XENINC) -Wall -fno-builtin -O2 -msoft-float
+CFLAGS  += $(DEFINES) -I. $(XENINC) -Wall -fno-builtin -O2 -msoft-float
 CFLAGS  += -m32 -march=i686
 LDFLAGS  = -m elf_i386
 
diff -r e77ea156075c -r e5aba4f62131 tools/ioemu/Makefile
--- a/tools/ioemu/Makefile      Tue Feb 28 10:07:18 2006
+++ b/tools/ioemu/Makefile      Tue Feb 28 10:41:54 2006
@@ -1,6 +1,9 @@
+XEN_ROOT=../..
+include $(XEN_ROOT)/tools/Rules.mk
+
 -include config-host.mak
 
-CFLAGS=-Wall -O2 -g -fno-strict-aliasing 
+CFLAGS+=-Wall -O2 -g -fno-strict-aliasing 
 ifdef CONFIG_DARWIN
 CFLAGS+= -mdynamic-no-pic
 endif
diff -r e77ea156075c -r e5aba4f62131 tools/ioemu/target-i386-dm/Makefile
--- a/tools/ioemu/target-i386-dm/Makefile       Tue Feb 28 10:07:18 2006
+++ b/tools/ioemu/target-i386-dm/Makefile       Tue Feb 28 10:41:54 2006
@@ -1,7 +1,8 @@
+include config.mak
+override TARGET_ARCH=i386
+
 XEN_ROOT=../../..
 include $(XEN_ROOT)/tools/Rules.mk
-include config.mak
-override TARGET_ARCH=i386
 
 INSTALL_DIR := $(DESTDIR)/usr/$(LIBDIR)/xen/bin
 TARGET_PATH=$(SRC_PATH)/target-$(TARGET_ARCH)
@@ -12,7 +13,7 @@
 VPATH+=:$(SRC_PATH)/linux-user
 DEFINES+=-I$(SRC_PATH)/linux-user -I$(SRC_PATH)/linux-user/$(TARGET_ARCH)
 endif
-CFLAGS=-Wall -O2 -g -fno-strict-aliasing
+CFLAGS+=-Wall -O2 -g -fno-strict-aliasing
 LDFLAGS=-g
 LIBS=
 HELPER_CFLAGS=$(CFLAGS)
diff -r e77ea156075c -r e5aba4f62131 tools/tests/Makefile
--- a/tools/tests/Makefile      Tue Feb 28 10:07:18 2006
+++ b/tools/tests/Makefile      Tue Feb 28 10:41:54 2006
@@ -4,13 +4,12 @@
 
 TARGET := test_x86_emulator
 
-CC     := gcc
-CFLAGS := -O2 -Wall -Werror -D__TEST_HARNESS__
+HOSTCFLAGS += -D__TEST_HARNESS__
 
 all: $(TARGET)
 
 $(TARGET): x86_emulate.o test_x86_emulator.o
-       $(CC) -o $@ $^
+       $(HOSTCC) -o $@ $^
 
 clean:
        rm -rf $(TARGET) *.o *~ core
@@ -18,7 +17,7 @@
 install:
 
 x86_emulate.o: $(XEN_ROOT)/xen/arch/x86/x86_emulate.c
-       $(CC) $(CFLAGS) -I$(XEN_ROOT)/xen/include -c -o $@ $<
+       $(HOSTCC) $(HOSTCFLAGS) -I$(XEN_ROOT)/xen/include -c -o $@ $<
 
 %.o: %.c
-       $(CC) $(CFLAGS) -I$(XEN_ROOT)/xen/include -c -o $@ $<
+       $(HOSTCC) $(HOSTCFLAGS) -I$(XEN_ROOT)/xen/include -c -o $@ $<

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Fix tools Makefiles to respect CFLAGS. Disable stack-smash, Xen patchbot -unstable <=