ia64/xen-unstable

changeset 17373:fcc4b7c304d9

x86 firmware: Consolidate firmware common build rules.

Also avoid overriding global optimisation default (-O1, -O2, etc.)

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Wed Apr 02 10:42:27 2008 +0100 (2008-04-02)
parents 960c33a6bd59
children c4a47a5657d9
files tools/firmware/Rules.mk tools/firmware/extboot/Makefile tools/firmware/hvmloader/Makefile tools/firmware/hvmloader/acpi/Makefile tools/firmware/rombios/32bit/Makefile tools/firmware/rombios/32bit/tcgbios/Makefile tools/tests/blowfish.mk
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/tools/firmware/Rules.mk	Wed Apr 02 10:42:27 2008 +0100
     1.3 @@ -0,0 +1,15 @@
     1.4 +# Firmware is a 32-bit target
     1.5 +override XEN_TARGET_ARCH = x86_32
     1.6 +
     1.7 +# User-supplied CFLAGS are not useful here.
     1.8 +CFLAGS :=
     1.9 +
    1.10 +include $(XEN_ROOT)/tools/Rules.mk
    1.11 +
    1.12 +# Disable PIE/SSP if GCC supports them. They can break us.
    1.13 +CFLAGS += $(call cc-option,$(CC),-nopie,)
    1.14 +CFLAGS += $(call cc-option,$(CC),-fno-stack-protector,)
    1.15 +CFLAGS += $(call cc-option,$(CC),-fno-stack-protector-all,)
    1.16 +
    1.17 +# Extra CFLAGS suitable for an embedded type of environment.
    1.18 +CFLAGS += -fno-builtin -msoft-float
     2.1 --- a/tools/firmware/extboot/Makefile	Wed Apr 02 10:28:56 2008 +0100
     2.2 +++ b/tools/firmware/extboot/Makefile	Wed Apr 02 10:42:27 2008 +0100
     2.3 @@ -1,15 +1,7 @@
     2.4 -
     2.5 -override XEN_TARGET_ARCH = x86_32
     2.6  XEN_ROOT = ../../..
     2.7 -CFLAGS := -I$(XEN_ROOT)/tools/libxc -I.
     2.8 -include $(XEN_ROOT)/tools/Rules.mk
     2.9 +include $(XEN_ROOT)/tools/firmware/Rules.mk
    2.10  
    2.11 -# Disable PIE/SSP if GCC supports them. They can break us.
    2.12 -CFLAGS  += $(call cc-option,$(CC),-nopie,)
    2.13 -CFLAGS  += $(call cc-option,$(CC),-fno-stack-protector,)
    2.14 -CFLAGS  += $(call cc-option,$(CC),-fno-stack-protector-all,)
    2.15 -
    2.16 -CFLAGS  += -fno-builtin -O2 -msoft-float
    2.17 +CFLAGS += -I$(XEN_ROOT)/tools/libxc -I.
    2.18  
    2.19  .PHONY: all
    2.20  all: extboot.bin
     3.1 --- a/tools/firmware/hvmloader/Makefile	Wed Apr 02 10:28:56 2008 +0100
     3.2 +++ b/tools/firmware/hvmloader/Makefile	Wed Apr 02 10:42:27 2008 +0100
     3.3 @@ -18,23 +18,15 @@
     3.4  # Place - Suite 330, Boston, MA 02111-1307 USA.
     3.5  #
     3.6  
     3.7 -override XEN_TARGET_ARCH = x86_32
     3.8  XEN_ROOT = ../../..
     3.9 -CFLAGS :=
    3.10 -include $(XEN_ROOT)/tools/Rules.mk
    3.11 +include $(XEN_ROOT)/tools/firmware/Rules.mk
    3.12  
    3.13  SUBDIRS := acpi
    3.14  
    3.15  # The HVM loader is started in 32-bit mode at the address below:
    3.16  LOADADDR = 0x100000
    3.17  
    3.18 -# Disable PIE/SSP if GCC supports them. They can break us.
    3.19 -CFLAGS  += $(call cc-option,$(CC),-nopie,)
    3.20 -CFLAGS  += $(call cc-option,$(CC),-fno-stack-protector,)
    3.21 -CFLAGS  += $(call cc-option,$(CC),-fno-stack-protector-all,)
    3.22 -
    3.23 -CFLAGS  += -fno-builtin -O2 -msoft-float
    3.24 -CFLAGS  += $(CFLAGS_include) -I.
    3.25 +CFLAGS += $(CFLAGS_include) -I.
    3.26  
    3.27  SRCS = hvmloader.c mp_tables.c util.c smbios.c 32bitbios_support.c
    3.28  OBJS = $(patsubst %.c,%.o,$(SRCS))
     4.1 --- a/tools/firmware/hvmloader/acpi/Makefile	Wed Apr 02 10:28:56 2008 +0100
     4.2 +++ b/tools/firmware/hvmloader/acpi/Makefile	Wed Apr 02 10:42:27 2008 +0100
     4.3 @@ -15,10 +15,8 @@
     4.4  # Place - Suite 330, Boston, MA 02111-1307 USA.
     4.5  #
     4.6  
     4.7 -override XEN_TARGET_ARCH = x86_32
     4.8  XEN_ROOT = ../../../..
     4.9 -CFLAGS :=
    4.10 -include $(XEN_ROOT)/tools/Rules.mk
    4.11 +include $(XEN_ROOT)/tools/firmware/Rules.mk
    4.12  
    4.13  C_SRC = build.c dsdt.c static_tables.c
    4.14  H_SRC = $(wildcard *.h)
    4.15 @@ -27,13 +25,7 @@ OBJS  = $(patsubst %.c,%.o,$(C_SRC))
    4.16  IASL_VER = acpica-unix-20060707
    4.17  IASL_URL = http://developer.intel.com/technology/iapc/acpi/downloads/$(IASL_VER).tar.gz
    4.18  
    4.19 -# Disable PIE/SSP if GCC supports them. They can break us.
    4.20 -CFLAGS  += $(call cc-option,$(CC),-nopie,)
    4.21 -CFLAGS  += $(call cc-option,$(CC),-fno-stack-protector,)
    4.22 -CFLAGS  += $(call cc-option,$(CC),-fno-stack-protector-all,)
    4.23 -
    4.24 -CFLAGS  += -fno-builtin -O2 -msoft-float
    4.25 -CFLAGS  += -I. -I.. $(CFLAGS_include)
    4.26 +CFLAGS += -I. -I.. $(CFLAGS_include)
    4.27  
    4.28  vpath iasl $(PATH)
    4.29  all: acpi.a
     5.1 --- a/tools/firmware/rombios/32bit/Makefile	Wed Apr 02 10:28:56 2008 +0100
     5.2 +++ b/tools/firmware/rombios/32bit/Makefile	Wed Apr 02 10:42:27 2008 +0100
     5.3 @@ -1,16 +1,10 @@
     5.4 -
     5.5 -override XEN_TARGET_ARCH = x86_32
     5.6  XEN_ROOT = ../../../..
     5.7 -CFLAGS :=
     5.8 -include $(XEN_ROOT)/tools/Rules.mk
     5.9 +include $(XEN_ROOT)/tools/firmware/Rules.mk
    5.10  
    5.11  SOURCES = util.c
    5.12  TARGET = 32bitbios_flat.h
    5.13  
    5.14 -CFLAGS += -fno-builtin -O2 -msoft-float -nostdlib
    5.15  CFLAGS += -I../ -DGCC_PROTOS
    5.16 -CFLAGS += $(call cc-option,$(CC),-fno-stack-protector,)
    5.17 -CFLAGS += $(call cc-option,$(CC),-fno-stack-protector-all,)
    5.18  
    5.19  SUBDIRS = tcgbios
    5.20  
     6.1 --- a/tools/firmware/rombios/32bit/tcgbios/Makefile	Wed Apr 02 10:28:56 2008 +0100
     6.2 +++ b/tools/firmware/rombios/32bit/tcgbios/Makefile	Wed Apr 02 10:42:27 2008 +0100
     6.3 @@ -1,16 +1,10 @@
     6.4 -
     6.5 -override XEN_TARGET_ARCH = x86_32
     6.6  XEN_ROOT = ../../../../..
     6.7 -CFLAGS :=
     6.8 -include $(XEN_ROOT)/tools/Rules.mk
     6.9 +include $(XEN_ROOT)/tools/firmware/Rules.mk
    6.10  
    6.11  TARGET  = tcgbiosext.o
    6.12  FILES   = tcgbios tpm_drivers
    6.13  OBJECTS = $(foreach f,$(FILES),$(f).o)
    6.14  
    6.15 -CFLAGS += -fno-builtin -O2 -msoft-float -nostdlib
    6.16 -CFLAGS += $(call cc-option,$(CC),-fno-stack-protector,)
    6.17 -CFLAGS += $(call cc-option,$(CC),-fno-stack-protector-all,)
    6.18  CFLAGS += -I../ -I../../ -DGCC_PROTOS
    6.19  
    6.20  .PHONY: all clean
     7.1 --- a/tools/tests/blowfish.mk	Wed Apr 02 10:28:56 2008 +0100
     7.2 +++ b/tools/tests/blowfish.mk	Wed Apr 02 10:42:27 2008 +0100
     7.3 @@ -5,11 +5,11 @@ CFLAGS :=
     7.4  include $(XEN_ROOT)/tools/Rules.mk
     7.5  
     7.6  # Disable PIE/SSP if GCC supports them. They can break us.
     7.7 -CFLAGS  += $(call cc-option,$(CC),-nopie,)
     7.8 -CFLAGS  += $(call cc-option,$(CC),-fno-stack-protector,)
     7.9 -CFLAGS  += $(call cc-option,$(CC),-fno-stack-protector-all,)
    7.10 +CFLAGS += $(call cc-option,$(CC),-nopie,)
    7.11 +CFLAGS += $(call cc-option,$(CC),-fno-stack-protector,)
    7.12 +CFLAGS += $(call cc-option,$(CC),-fno-stack-protector-all,)
    7.13  
    7.14 -CFLAGS  += -fno-builtin -O2 -msoft-float
    7.15 +CFLAGS += -fno-builtin -msoft-float
    7.16  
    7.17  .PHONY: all
    7.18  all: blowfish.bin