[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Minios-devel] [UNIKRAFT PATCH v2 4/6] build: Introduce COMPFLAGS(-y) and ARCHFLAGS(-y)



Move language-independent and target-independent compiler flags to
COMPFLAGS(-y) and target-specific (but still language-independent)
flags to ARCHFLAGS(-y). Having these as single points make it easier
to maintain these types of compiler flags across the supported
languages.

Signed-off-by: Simon Kuenzer <simon.kuenzer@xxxxxxxxx>
---
 Makefile                     |  4 ++
 Makefile.uk                  | 75 ++++++++++++------------------------
 arch/arm/arm/Makefile.uk     | 41 +++++++-------------
 arch/arm/arm64/Makefile.uk   | 28 +++++---------
 arch/x86/x86_64/Makefile.uk  | 68 ++++++++------------------------
 support/build/Makefile.rules | 23 ++++++++---
 6 files changed, 86 insertions(+), 153 deletions(-)

diff --git a/Makefile b/Makefile
index 81a07a29..6c965a15 100644
--- a/Makefile
+++ b/Makefile
@@ -262,6 +262,10 @@ UK_IMAGES:=
 UK_IMAGES-y:=
 UK_CLEAN :=
 UK_CLEAN-y :=
+ARCHFLAGS :=
+ARCHFLAGS-y :=
+COMPFLAGS :=
+COMPFLAGS-y :=
 ASFLAGS :=
 ASFLAGS-y :=
 ASINCLUDES :=
diff --git a/Makefile.uk b/Makefile.uk
index 3f01a251..c9e3220c 100644
--- a/Makefile.uk
+++ b/Makefile.uk
@@ -4,23 +4,19 @@
 #
 
################################################################################
 
-ASFLAGS     += -U __linux__ -U __FreeBSD__ -U __sun__ -D__ASSEMBLY__
-ASINCLUDES  += -nostdinc -nostdlib -I$(CONFIG_UK_BASE)/include
+COMPFLAGS    += -nostdinc -nostdlib
+COMPFLAGS    += -U __linux__ -U __FreeBSD__ -U __sun__
+COMPFLAGS    += -fno-stack-protector -fno-omit-frame-pointer -fno-tree-sra
+COMPFLAGS    += -Wall -Wextra
 
-CFLAGS      += -U __linux__ -U __FreeBSD__ -U __sun__
-CFLAGS      += -fno-stack-protector -fno-omit-frame-pointer -fno-tree-sra
-CFLAGS      += -Wall -Wextra
-CINCLUDES   += -nostdinc -nostdlib -I$(CONFIG_UK_BASE)/include
+# TODO: Remove -fms-extensions if not needed for our code (it was moved from 
Arm64 arch)
+CFLAGS       += -fms-extensions
+ASFLAGS      += -D__ASSEMBLY__
 
-CXXFLAGS    += -U __linux__ -U __FreeBSD__ -U __sun__
-CXXFLAGS    += -fno-stack-protector -fno-omit-frame-pointer -fno-tree-sra
-CXXFLAGS    += -Wall -Wextra
-CXXINCLUDES += -nostdinc -nostdlib -I$(CONFIG_UK_BASE)/include
-
-GOCFLAGS    += -U __linux__ -U __FreeBSD__ -U __sun__
-GOCFLAGS    += -fno-stack-protector -fno-omit-frame-pointer -fno-tree-sra
-GOCFLAGS    += -fno-split-stack -Wall -Wextra
-GOCINCLUDES += -nostdinc -nostdlib -I$(CONFIG_UK_BASE)/include
+ASINCLUDES   += -I$(CONFIG_UK_BASE)/include
+CINCLUDES    += -I$(CONFIG_UK_BASE)/include
+CXXINCLUDES  += -I$(CONFIG_UK_BASE)/include
+GOCINCLUDES  += -I$(CONFIG_UK_BASE)/include
 
 # Set the text and data sections to be readable and writable. Also,
 # do not page-align the data segment. If the output format supports
@@ -28,54 +24,33 @@ GOCINCLUDES += -nostdinc -nostdlib 
-I$(CONFIG_UK_BASE)/include
 LIBLDFLAGS  += -nostdinc -nostdlib -Wl,--omagic -Wl,-r -Wl,-d 
-Wl,--build-id=none
 LDFLAGS     += -nostdinc -nostdlib -Wl,--omagic -Wl,--build-id=none
 
-CFLAGS-$(CONFIG_OPTIMIZE_NONE)            += -O0 -fno-optimize-sibling-calls 
-fno-tree-vectorize
-CXXFLAGS-$(CONFIG_OPTIMIZE_NONE)          += -O0 -fno-optimize-sibling-calls 
-fno-tree-vectorize
-GOCFLAGS-$(CONFIG_OPTIMIZE_NONE)          += -O0 -fno-optimize-sibling-calls 
-fno-tree-vectorize
-CFLAGS-$(CONFIG_OPTIMIZE_PERF)            += -O2
-CXXFLAGS-$(CONFIG_OPTIMIZE_PERF)          += -O2
-GOCFLAGS-$(CONFIG_OPTIMIZE_PERF)          += -O2
-CFLAGS-$(CONFIG_OPTIMIZE_SIZE)            += -Os
-CXXFLAGS-$(CONFIG_OPTIMIZE_SIZE)          += -Os
-GOCFLAGS-$(CONFIG_OPTIMIZE_SIZE)          += -Os
+COMPFLAGS-$(CONFIG_OPTIMIZE_NONE)         += -O0 -fno-optimize-sibling-calls 
-fno-tree-vectorize
+COMPFLAGS-$(CONFIG_OPTIMIZE_SIZE)         += -Os
+COMPFLAGS-$(CONFIG_OPTIMIZE_PERF)         += -O2
 
-CFLAGS-$(CONFIG_OPTIMIZE_DEADELIM)        += -fdata-sections 
-ffunction-sections
-CXXFLAGS-$(CONFIG_OPTIMIZE_DEADELIM)      += -fdata-sections 
-ffunction-sections
-GOCFLAGS-$(CONFIG_OPTIMIZE_DEADELIM)      += -fdata-sections 
-ffunction-sections
+COMPFLAGS-$(CONFIG_OPTIMIZE_DEADELIM)     += -fdata-sections 
-ffunction-sections
 LDFLAGS-$(CONFIG_OPTIMIZE_DEADELIM)       += -Wl,--gc-sections
 
 # LTO requires the compiler flags to be handed over also for linking
-CFLAGS-$(CONFIG_OPTIMIZE_LTO)             += -flto
-CXXFLAGS-$(CONFIG_OPTIMIZE_LTO)           += -flto
-GOCFLAGS-$(CONFIG_OPTIMIZE_LTO)           += -flto
-LIBLDFLAGS-$(CONFIG_OPTIMIZE_LTO)         += $(CFLAGS) $(CFLAGS-y)
-LDFLAGS-$(CONFIG_OPTIMIZE_LTO)            += $(CFLAGS) $(CFLAGS-y)
+COMPFLAGS-$(CONFIG_OPTIMIZE_LTO)          += -flto
+LIBLDFLAGS-$(CONFIG_OPTIMIZE_LTO)         += $(COMPFLAGS) $(COMPFLAGS-y) 
$(ARCHFLAGS) $(ARCHFLAGS-y)
+LDFLAGS-$(CONFIG_OPTIMIZE_LTO)            += $(COMPFLAGS) $(COMPFLAGS-y) 
$(ARCHFLAGS) $(ARCHFLAGS-y)
 
 DBGFLAGS-$(CONFIG_DEBUG_SYMBOLS_LVL0)     += -g0
 DBGFLAGS-$(CONFIG_DEBUG_SYMBOLS_LVL1)     += -g1
 DBGFLAGS-$(CONFIG_DEBUG_SYMBOLS_LVL2)     += -g2
 DBGFLAGS-$(CONFIG_DEBUG_SYMBOLS_LVL3)     += -g3
 
-ASFLAGS  += -D __Unikraft__ -DUK_CODENAME="$(UK_CODENAME)"
-ASFLAGS  += -DUK_VERSION=$(UK_VERSION).$(UK_SUBVERSION)
-ASFLAGS  += -DUK_FULLVERSION=$(UK_FULLVERSION)
-CFLAGS   += -D __Unikraft__ -DUK_CODENAME="$(UK_CODENAME)"
-CFLAGS   += -DUK_VERSION=$(UK_VERSION).$(UK_SUBVERSION)
-CFLAGS   += -DUK_FULLVERSION=$(UK_FULLVERSION)
-CXXFLAGS += -D __Unikraft__ -DUK_CODENAME="$(UK_CODENAME)"
-CXXFLAGS += -DUK_VERSION=$(UK_VERSION).$(UK_SUBVERSION)
-CXXFLAGS += -DUK_FULLVERSION=$(UK_FULLVERSION)
-GOCFLAGS += -D __Unikraft__ -DUK_CODENAME="$(UK_CODENAME)"
-GOCFLAGS += -DUK_VERSION=$(UK_VERSION).$(UK_SUBVERSION)
-GOCFLAGS += -DUK_FULLVERSION=$(UK_FULLVERSION)
-M4FLAGS  += -D __Unikraft__ -DUK_CODENAME="$(UK_CODENAME)"
-M4FLAGS  += -DUK_VERSION=$(UK_VERSION).$(UK_SUBVERSION)
+COMPFLAGS     += -D __Unikraft__ -DUK_CODENAME="$(UK_CODENAME)"
+COMPFLAGS     += -DUK_VERSION=$(UK_VERSION).$(UK_SUBVERSION)
+COMPFLAGS     += -DUK_FULLVERSION=$(UK_FULLVERSION)
+
+M4FLAGS      += -D __Unikraft__ -DUK_CODENAME="$(UK_CODENAME)"
+M4FLAGS      += -DUK_VERSION=$(UK_VERSION).$(UK_SUBVERSION)
 
 # If GCC supports "-no-pie" flag, we will add this flag to link flags to
 # override "pie" option, because some distributions will set
 # "--enable-default-pie" by default.
-ASFLAGS-$(call gcc_version_ge,6,1)     += -no-pie
-CFLAGS-$(call gcc_version_ge,6,1)      += -no-pie
-CXXFLAGS-$(call gcc_version_ge,6,1)    += -no-pie
-GOFLAGS-$(call gcc_version_ge,6,1)     += -no-pie
+COMPFLAGS-$(call gcc_version_ge,6,1)   += -no-pie
 LIBLDFLAGS-$(call gcc_version_ge,6,1)  += -no-pie
 LDFLAGS-$(call gcc_version_ge,6,1)     += -no-pie
diff --git a/arch/arm/arm/Makefile.uk b/arch/arm/arm/Makefile.uk
index 28e33197..6bb3ca8b 100644
--- a/arch/arm/arm/Makefile.uk
+++ b/arch/arm/arm/Makefile.uk
@@ -1,9 +1,5 @@
-ASFLAGS  += -D__ARM_32__
-ASFLAGS  += -marm
-CFLAGS   += -D__ARM_32__
-CFLAGS   += -marm -fms-extensions
-CXXFLAGS += -D__ARM_32__
-CXXFLAGS += -marm -fms-extensions
+ARCHFLAGS     += -D__ARM_32__
+ARCHFLAGS     += -marm
 
 CINCLUDES   += -I$(CONFIG_UK_BASE)/arch/arm/arm/include
 ASINCLUDES  += -I$(CONFIG_UK_BASE)/arch/arm/arm/include
@@ -12,78 +8,67 @@ CXXINCLUDES += -I$(CONFIG_UK_BASE)/arch/arm/arm/include
 # Set GCC flags for MARCH_ARM32_GENERICV7. GCC supports -mtune=generic-armv7-a 
from 4.7
 ifeq ($(CONFIG_MARCH_ARM32_GENERICV7),y)
 $(call error_if_gcc_version_lt,4,7)
-CFLAGS-$(call gcc_version_ge,4,7)      += -march=armv7-a -mtune=generic-armv7-a
-CXXFLAGS-$(call gcc_version_ge,4,7)    += -march=armv7-a -mtune=generic-armv7-a
+ARCHFLAGS-$(call gcc_version_ge,4,7)     += -march=armv7-a 
-mtune=generic-armv7-a
 endif
 
 # Set GCC flags for MARCH_ARM32_CORTEXA5. GCC supports -mcpu=cortex-a5 from 4.5
 ifeq ($(CONFIG_MARCH_ARM32_CORTEXA5),y)
 $(call error_if_gcc_version_lt,4,5)
-CFLAGS-$(call gcc_version_ge,4,5)      += -mcpu=cortex-a5 -mtune=cortex-a5
-CXXFLAGS-$(call gcc_version_ge,4,5)    += -mcpu=cortex-a5 -mtune=cortex-a5
+ARCHFLAGS-$(call gcc_version_ge,4,5)     += -mcpu=cortex-a5 -mtune=cortex-a5
 endif
 
 # Set GCC flags for MARCH_ARM32_CORTEXA7. GCC supports -mcpu=cortex-a7 from 4.7
 ifeq ($(CONFIG_MARCH_ARM32_CORTEXA7),y)
 $(call error_if_gcc_version_lt,4,7)
-CFLAGS-$(call gcc_version_ge,4,7)      += -mcpu=cortex-a7 -mtune=cortex-a7
-CXXFLAGS-$(call gcc_version_ge,4,7)    += -mcpu=cortex-a7 -mtune=cortex-a7
+ARCHFLAGS-$(call gcc_version_ge,4,7)     += -mcpu=cortex-a7 -mtune=cortex-a7
 endif
 
 # Set GCC flags for MARCH_ARM32_CORTEXA8. GCC supports -mcpu=cortex-a8 from 4.3
 ifeq ($(CONFIG_MARCH_ARM32_CORTEXA8),y)
 $(call error_if_gcc_version_lt,4,3)
-CFLAGS-$(call gcc_version_ge,4,3)      += -mcpu=cortex-a8 -mtune=cortex-a8
-CXXFLAGS-$(call gcc_version_ge,4,3)    += -mcpu=cortex-a8 -mtune=cortex-a8
+ARCHFLAGS-$(call gcc_version_ge,4,3)     += -mcpu=cortex-a8 -mtune=cortex-a8
 endif
 
 # Set GCC flags for MARCH_ARM32_CORTEXA9. GCC supports -mcpu=cortex-a9 from 4.4
 ifeq ($(CONFIG_MARCH_ARM32_CORTEXA9),y)
 $(call error_if_gcc_version_lt,4,4)
-CFLAGS-$(call gcc_version_ge,4,4)      += -mcpu=cortex-a9 -mtune=cortex-a9
-CXXFLAGS-$(call gcc_version_ge,4,4)    += -mcpu=cortex-a9 -mtune=cortex-a9
+ARCHFLAGS-$(call gcc_version_ge,4,4)     += -mcpu=cortex-a9 -mtune=cortex-a9
 endif
 
 # Set GCC flags for MARCH_ARM32_CORTEXA12. GCC supports -mcpu=cortex-a12 from 
4.9
 ifeq ($(CONFIG_MARCH_ARM32_CORTEXA12),y)
 $(call error_if_gcc_version_lt,4,9)
-CFLAGS-$(call gcc_version_ge,4,9)      += -mcpu=cortex-a12 -mtune=cortex-a12
-CXXFLAGS-$(call gcc_version_ge,4,9)    += -mcpu=cortex-a12 -mtune=cortex-a12
+ARCHFLAGS-$(call gcc_version_ge,4,9)     += -mcpu=cortex-a12 -mtune=cortex-a12
 endif
 
 # Set GCC flags for MARCH_ARM32_CORTEXA15. GCC supports -mcpu=cortex-a15 from 
4.6
 ifeq ($(CONFIG_MARCH_ARM32_CORTEXA15),y)
 $(call error_if_gcc_version_lt,4,6)
-CFLAGS-$(call gcc_version_ge,4,6)      += -mcpu=cortex-a15 -mtune=cortex-a15
-CXXFLAGS-$(call gcc_version_ge,4,6)    += -mcpu=cortex-a15 -mtune=cortex-a15
+ARCHFLAGS-$(call gcc_version_ge,4,6)     += -mcpu=cortex-a15 -mtune=cortex-a15
 endif
 
 # Set GCC flags for MARCH_ARM32_CORTEXA17. GCC supports -mcpu=cortex-a17 from 
6.1
 ifeq ($(CONFIG_MARCH_ARM32_CORTEXA17),y)
 $(call error_if_gcc_version_lt,6,1)
-CFLAGS-$(call gcc_version_ge,6,1)      += -mcpu=cortex-a17 -mtune=cortex-a17
-CXXFLAGS-$(call gcc_version_ge,6,1)    += -mcpu=cortex-a17 -mtune=cortex-a17
+ARCHFLAGS-$(call gcc_version_ge,6,1)     += -mcpu=cortex-a17 -mtune=cortex-a17
 endif
 
 # Set GCC flags for MARCH_ARM32_CORTEXA32. GCC supports -mcpu=cortex-a32 from 
6.1
 ifeq ($(CONFIG_MARCH_ARM32_CORTEXA32),y)
 $(call error_if_gcc_version_lt,6,1)
-CFLAGS-$(call gcc_version_ge,6,1)      += -mcpu=cortex-a32 -mtune=cortex-a32
-CXXFLAGS-$(call gcc_version_ge,6,1)    += -mcpu=cortex-a32 -mtune=cortex-a32
+ARCHFLAGS-$(call gcc_version_ge,6,1)     += -mcpu=cortex-a32 -mtune=cortex-a32
 endif
 
 # Set GCC flags for MARCH_ARM32_CORTEXA35. GCC supports -mcpu=cortex-a35 from 
6.1
 ifeq ($(CONFIG_MARCH_ARM32_CORTEXA35),y)
 $(call error_if_gcc_version_lt,6,1)
-CFLAGS-$(call gcc_version_ge,6,1)      += -mcpu=cortex-a35 -mtune=cortex-a35
-CXXFLAGS-$(call gcc_version_ge,6,1)    += -mcpu=cortex-a35 -mtune=cortex-a35
+ARCHFLAGS-$(call gcc_version_ge,6,1)     += -mcpu=cortex-a35 -mtune=cortex-a35
 endif
 
 # Set GCC flags for MARCH_ARM32_A20NEON. GCC supports -mcpu=cortex-a7 from 4.7
 ifeq ($(CONFIG_MARCH_ARM32_A20NEON),y)
 $(call error_if_gcc_version_lt,4,7)
-CFLAGS-$(call gcc_version_ge,4,7)      += -mcpu=cortex-a7 -mtune=cortex-a7 
-mfpu=vfpv4-d16 -mfpu=neon-vfpv4 -funsafe-math-optimizations
-CXXFLAGS-$(call gcc_version_ge,4,7)    += -mcpu=cortex-a7 -mtune=cortex-a7 
-mfpu=vfpv4-d16 -mfpu=neon-vfpv4 -funsafe-math-optimizations
+ARCHFLAGS-$(call gcc_version_ge,4,7)     += -mcpu=cortex-a7 -mtune=cortex-a7 
-mfpu=vfpv4-d16 -mfpu=neon-vfpv4 -funsafe-math-optimizations
 endif
 
 $(eval $(call addlib,libarmmath))
diff --git a/arch/arm/arm64/Makefile.uk b/arch/arm/arm64/Makefile.uk
index eb73cace..9f0ab529 100644
--- a/arch/arm/arm64/Makefile.uk
+++ b/arch/arm/arm64/Makefile.uk
@@ -3,9 +3,7 @@
 # we should not enable the FP & SIMD access for kernel. As GCC will
 # the FP & SIMD registers to pass parameters, we use -mgeneral-regs-only
 # flag to force GCC to use generic registers
-ASFLAGS  += -D__ARM_64__ -mgeneral-regs-only
-CFLAGS   += -D__ARM_64__ -fms-extensions -mgeneral-regs-only
-CXXFLAGS += -D__ARM_64__ -fms-extensions -mgeneral-regs-only
+ARCHFLAGS     += -D__ARM_64__ -mgeneral-regs-only
 
 CINCLUDES   += -I$(CONFIG_UK_BASE)/arch/arm/arm64/include
 ASINCLUDES  += -I$(CONFIG_UK_BASE)/arch/arm/arm64/include
@@ -14,55 +12,47 @@ CXXINCLUDES += -I$(CONFIG_UK_BASE)/arch/arm/arm64/include
 # GCC support -mcpu=native for arm64 from 6.0
 ifeq ($(CONFIG_MARCH_ARM64_NATIVE),y)
 $(call error_if_gcc_version_lt,6,0)
-CFLAGS-$(call gcc_version_ge,6,0)      += -mcpu=native
-CXXFLAGS-$(call gcc_version_ge,6,0)    += -mcpu=native
+ARCHFLAGS-$(call gcc_version_ge,6,0)     += -mcpu=native
 endif
 
 # GCC support -mcpu=generic for arm64 from 4.8
 ifeq ($(CONFIG_MARCH_ARM64_GENERIC),y)
 $(call error_if_gcc_version_lt,4,8)
-CFLAGS-$(call gcc_version_ge,4,8)      += -march=armv8-a -mcpu=generic 
-mtune=generic
-CXXFLAGS-$(call gcc_version_ge,4,8)    += -march=armv8-a -mcpu=generic 
-mtune=generic
+ARCHFLAGS-$(call gcc_version_ge,4,8)     += -march=armv8-a -mcpu=generic 
-mtune=generic
 endif
 
 # GCC support -mcpu=cortex-a53 for arm64 from 4.9
 ifeq ($(CONFIG_MARCH_ARM64_CORTEXA53),y)
 $(call error_if_gcc_version_lt,4,9)
-CFLAGS-$(call gcc_version_ge,4,9)      += -march=armv8-a -mcpu=cortex-a53 
-mtune=cortex-a53
-CXXFLAGS-$(call gcc_version_ge,4,9)    += -march=armv8-a -mcpu=cortex-a53 
-mtune=cortex-a53
+ARCHFLAGS-$(call gcc_version_ge,4,9)     += -march=armv8-a -mcpu=cortex-a53 
-mtune=cortex-a53
 endif
 
 # GCC support -mcpu=cortex-a57 for arm64 from 4.9
 ifeq ($(CONFIG_MARCH_ARM64_CORTEXA57),y)
 $(call error_if_gcc_version_lt,4,9)
-CFLAGS-$(call gcc_version_ge,4,9)      += -march=armv8-a -mcpu=cortex-a57 
-mtune=cortex-a57
-CXXFLAGS-$(call gcc_version_ge,4,9)    += -march=armv8-a -mcpu=cortex-a57 
-mtune=cortex-a57
+ARCHFLAGS-$(call gcc_version_ge,4,9)     += -march=armv8-a -mcpu=cortex-a57 
-mtune=cortex-a57
 endif
 
 # GCC support -mcpu=cortex-a72 for arm64 from 5.0
 ifeq ($(CONFIG_MARCH_ARM64_CORTEXA72),y)
 $(call error_if_gcc_version_lt,5,0)
-CFLAGS-$(call gcc_version_ge,5,0)      += -march=armv8-a -mcpu=cortex-a72 
-mtune=cortex-a72
-CXXFLAGS-$(call gcc_version_ge,5,0)    += -march=armv8-a -mcpu=cortex-a72 
-mtune=cortex-a72
+ARCHFLAGS-$(call gcc_version_ge,5,0)     += -march=armv8-a -mcpu=cortex-a72 
-mtune=cortex-a72
 endif
 
 # GCC support -mcpu=cortex-a73 for arm64 from 7.0
 ifeq ($(CONFIG_MARCH_ARM64_CORTEXA73),y)
 $(call error_if_gcc_version_lt,7,0)
-CFLAGS-$(call gcc_version_ge,7,0)      += -march=armv8-a -mcpu=cortex-a73 
-mtune=cortex-a73
-CXXFLAGS-$(call gcc_version_ge,7,0)    += -march=armv8-a -mcpu=cortex-a73 
-mtune=cortex-a73
+ARCHFLAGS-$(call gcc_version_ge,7,0)     += -march=armv8-a -mcpu=cortex-a73 
-mtune=cortex-a73
 endif
 
 # GCC support -mcpu=cortex-a55 for arm64 from 8.0
 ifeq ($(CONFIG_MARCH_ARM64_CORTEXA55),y)
 $(call error_if_gcc_version_lt,8,0)
-CFLAGS-$(call gcc_version_ge,8,0)      += -march=armv8.2-a -mcpu=cortex-a55 
-mtune=cortex-a55
-CXXFLAGS-$(call gcc_version_ge,8,0)    += -march=armv8.2-a -mcpu=cortex-a55 
-mtune=cortex-a55
+ARCHFLAGS-$(call gcc_version_ge,8,0)     += -march=armv8.2-a -mcpu=cortex-a55 
-mtune=cortex-a55
 endif
 
 # GCC support -mcpu=cortex-a75 for arm64 from 8.0
 ifeq ($(CONFIG_MARCH_ARM64_CORTEXA75),y)
 $(call error_if_gcc_version_lt,8,0)
-CFLAGS-$(call gcc_version_ge,8,0)      += -march=armv8.2-a -mcpu=cortex-a75 
-mtune=cortex-a75
-CXXFLAGS-$(call gcc_version_ge,8,0)    += -march=armv8.2-a -mcpu=cortex-a75 
-mtune=cortex-a75
+ARCHFLAGS-$(call gcc_version_ge,8,0)     += -march=armv8.2-a -mcpu=cortex-a75 
-mtune=cortex-a75
 endif
diff --git a/arch/x86/x86_64/Makefile.uk b/arch/x86/x86_64/Makefile.uk
index 8ec7d6b9..0c90a865 100644
--- a/arch/x86/x86_64/Makefile.uk
+++ b/arch/x86/x86_64/Makefile.uk
@@ -1,9 +1,5 @@
-ASFLAGS  += -D__X86_64__
-ASFLAGS  += -m64
-CFLAGS   += -D__X86_64__
-CFLAGS   += -m64 -mno-red-zone -fno-reorder-blocks 
-fno-asynchronous-unwind-tables
-CXXFLAGS += -D__X86_64__
-CXXFLAGS += -m64 -mno-red-zone -fno-reorder-blocks 
-fno-asynchronous-unwind-tables
+ARCHFLAGS     += -D__X86_64__
+ARCHFLAGS     += -m64 -mno-red-zone -fno-reorder-blocks 
-fno-asynchronous-unwind-tables
 
 CINCLUDES   += -I$(CONFIG_UK_BASE)/arch/x86/x86_64/include
 ASINCLUDES  += -I$(CONFIG_UK_BASE)/arch/x86/x86_64/include
@@ -13,48 +9,18 @@ CXXINCLUDES += -I$(CONFIG_UK_BASE)/arch/x86/x86_64/include
 # This is for files that contain trap/exception/interrupt handlers
 NO_X86_EXTREGS_FLAGS := -mno-80387 -mno-fp-ret-in-387 -mno-mmx -mno-sse 
-mno-avx
 
-ASFLAGS-$(CONFIG_MARCH_X86_64_GENERIC)     += -mtune=generic
-CFLAGS-$(CONFIG_MARCH_X86_64_GENERIC)      += -mtune=generic
-CXXFLAGS-$(CONFIG_MARCH_X86_64_GENERIC)    += -mtune=generic
-ASFLAGS-$(CONFIG_MARCH_X86_64_NOCONA)      += -march=nocona
-CFLAGS-$(CONFIG_MARCH_X86_64_NOCONA)       += -march=nocona
-CXXFLAGS-$(CONFIG_MARCH_X86_64_NOCONA)     += -march=nocona
-ASFLAGS-$(CONFIG_MARCH_X86_64_CORE2)       += -march=core2
-CFLAGS-$(CONFIG_MARCH_X86_64_CORE2)        += -march=core2
-CXXFLAGS-$(CONFIG_MARCH_X86_64_CORE2)      += -march=core2
-ASFLAGS-$(CONFIG_MARCH_X86_64_COREI7)      += -march=corei7
-CFLAGS-$(CONFIG_MARCH_X86_64_COREI7)       += -march=corei7
-CXXFLAGS-$(CONFIG_MARCH_X86_64_COREI7)     += -march=corei7
-ASFLAGS-$(CONFIG_MARCH_X86_64_COREI7AVX)   += -march=corei7-avx
-CFLAGS-$(CONFIG_MARCH_X86_64_COREI7AVX)    += -march=corei7-avx
-CXXFLAGS-$(CONFIG_MARCH_X86_64_COREI7AVX)  += -march=corei7-avx
-ASFLAGS-$(CONFIG_MARCH_X86_64_COREI7AVXI)  += -march=core-avx-i
-CFLAGS-$(CONFIG_MARCH_X86_64_COREI7AVXI)   += -march=core-avx-i
-CXXFLAGS-$(CONFIG_MARCH_X86_64_COREI7AVXI) += -march=core-avx-i
-ASFLAGS-$(CONFIG_MARCH_X86_64_ATOM)        += -march=atom
-CFLAGS-$(CONFIG_MARCH_X86_64_ATOM)         += -march=atom
-CXXFLAGS-$(CONFIG_MARCH_X86_64_ATOM)       += -march=atom
-ASFLAGS-$(CONFIG_MARCH_X86_64_K8)          += -march=k8
-CFLAGS-$(CONFIG_MARCH_X86_64_K8)           += -march=k8
-CXXFLAGS-$(CONFIG_MARCH_X86_64_K8)         += -march=k8
-ASFLAGS-$(CONFIG_MARCH_X86_64_K8SSE3)      += -march=k8-sse3
-CFLAGS-$(CONFIG_MARCH_X86_64_K8SSE3)       += -march=k8-sse3
-CXXFLAGS-$(CONFIG_MARCH_X86_64_K8SSE3)     += -march=k8-sse3
-ASFLAGS-$(CONFIG_MARCH_X86_64_AMDFAM10)    += -march=amdfam10
-CFLAGS-$(CONFIG_MARCH_X86_64_AMDFAM10)     += -march=amdfam10
-CXXFLAGS-$(CONFIG_MARCH_X86_64_AMDFAM10)   += -march=amdfam10
-ASFLAGS-$(CONFIG_MARCH_X86_64_BDVER1)      += -march=bdver1
-CFLAGS-$(CONFIG_MARCH_X86_64_BDVER1)       += -march=bdver1
-CXXFLAGS-$(CONFIG_MARCH_X86_64_BDVER1)     += -march=bdver1
-ASFLAGS-$(CONFIG_MARCH_X86_64_BDVER2)      += -march=bdver2
-CFLAGS-$(CONFIG_MARCH_X86_64_BDVER2)       += -march=bdver2
-CXXFLAGS-$(CONFIG_MARCH_X86_64_BDVER2)     += -march=bdver2
-ASFLAGS-$(CONFIG_MARCH_X86_64_BDVER3)      += -march=bdver3
-CFLAGS-$(CONFIG_MARCH_X86_64_BDVER3)       += -march=bdver3
-CXXFLAGS-$(CONFIG_MARCH_X86_64_BDVER3)     += -march=bdver3
-ASFLAGS-$(CONFIG_MARCH_X86_64_BTVER1)      += -march=btver1
-CFLAGS-$(CONFIG_MARCH_X86_64_BTVER1)       += -march=btver1
-CXXFLAGS-$(CONFIG_MARCH_X86_64_BTVER1)     += -march=btver1
-ASFLAGS-$(CONFIG_MARCH_X86_64_BTVER2)      += -march=btver2
-CFLAGS-$(CONFIG_MARCH_X86_64_BTVER2)       += -march=btver2
-CXXFLAGS-$(CONFIG_MARCH_X86_64_BTVER2)     += -march=btver2
+ARCHFLAGS-$(CONFIG_MARCH_X86_64_GENERIC)        += -mtune=generic
+ARCHFLAGS-$(CONFIG_MARCH_X86_64_NOCONA)         += -march=nocona
+ARCHFLAGS-$(CONFIG_MARCH_X86_64_CORE2)          += -march=core2
+ARCHFLAGS-$(CONFIG_MARCH_X86_64_COREI7)         += -march=corei7
+ARCHFLAGS-$(CONFIG_MARCH_X86_64_COREI7AVX)      += -march=corei7-avx
+ARCHFLAGS-$(CONFIG_MARCH_X86_64_COREI7AVXI)     += -march=core-avx-i
+ARCHFLAGS-$(CONFIG_MARCH_X86_64_ATOM)           += -march=atom
+ARCHFLAGS-$(CONFIG_MARCH_X86_64_K8)             += -march=k8
+ARCHFLAGS-$(CONFIG_MARCH_X86_64_K8SSE3)         += -march=k8-sse3
+ARCHFLAGS-$(CONFIG_MARCH_X86_64_AMDFAM10)       += -march=amdfam10
+ARCHFLAGS-$(CONFIG_MARCH_X86_64_BDVER1)         += -march=bdver1
+ARCHFLAGS-$(CONFIG_MARCH_X86_64_BDVER2)         += -march=bdver2
+ARCHFLAGS-$(CONFIG_MARCH_X86_64_BDVER3)         += -march=bdver3
+ARCHFLAGS-$(CONFIG_MARCH_X86_64_BTVER1)         += -march=btver1
+ARCHFLAGS-$(CONFIG_MARCH_X86_64_BTVER2)         += -march=btver2
diff --git a/support/build/Makefile.rules b/support/build/Makefile.rules
index c4eb86ee..8a481e45 100644
--- a/support/build/Makefile.rules
+++ b/support/build/Makefile.rules
@@ -383,9 +383,12 @@ endef
 define buildrule_S_ =
 $(4): $(2) | prepare
        $(call build_cmd_fixdep,AS,$(1),$(4),\
-               $(AS)  $(ASINCLUDES) $(ASINCLUDES-y) \
+               $(AS)  $(COMPFLAGS) $(COMPFLAGS-y) \
+                      $($(call vprefix_lib,$(1),COMPFLAGS)) $($(call 
vprefix_lib,$(1),COMPFLAGS-y)) \
+                      $(ASINCLUDES) $(ASINCLUDES-y) \
                       $($(call vprefix_lib,$(1),ASINCLUDES)) $($(call 
vprefix_lib,$(1),ASINCLUDES-y)) \
                       $($(call vprefix_src,$(1),$(2),$(3),INCLUDES)) $($(call 
vprefix_src,$(1),$(2),$(3),INCLUDES-y)) \
+                      $(ARCHFLAGS) $(ARCHFLAGS-y) \
                       $(ASFLAGS) $(ASFLAGS-y) \
                       $($(call vprefix_lib,$(1),ASFLAGS)) $($(call 
vprefix_lib,$(1),ASFLAGS-y)) \
                       $($(call vprefix_src,$(1),$(2),$(3),FLAGS)) $($(call 
vprefix_src,$(1),$(2),$(3),FLAGS-y)) \
@@ -407,9 +410,12 @@ buildrule_sx = $(call buildrule_S_,$(1),$(2),$(3),$(4))
 define buildrule_s =
 $(4): $(2) | prepare
        $(call build_cmd,AS,$(1),$(4),\
-               $(AS)  $(ASINCLUDES) $(ASINCLUDES-y) \
+               $(AS)  $(COMPFLAGS) $(COMPFLAGS-y) \
+                      $($(call vprefix_lib,$(1),COMPFLAGS)) $($(call 
vprefix_lib,$(1),COMPFLAGS-y)) \
+                      $(ASINCLUDES) $(ASINCLUDES-y) \
                       $($(call vprefix_lib,$(1),ASINCLUDES)) $($(call 
vprefix_lib,$(1),ASINCLUDES-y)) \
                       $($(call vprefix_src,$(1),$(2),$(3),INCLUDES)) $($(call 
vprefix_src,$(1),$(2),$(3),INCLUDES-y)) \
+                      $(ARCHFLAGS) $(ARCHFLAGS-y) \
                       $(ASFLAGS) $(ASFLAGS-y) \
                       $($(call vprefix_lib,$(1),ASFLAGS)) $($(call 
vprefix_lib,$(1),ASFLAGS-y)) \
                       $($(call vprefix_src,$(1),$(2),$(3),FLAGS)) $($(call 
vprefix_src,$(1),$(2),$(3),FLAGS-y)) \
@@ -429,9 +435,12 @@ endef
 define buildrule_c =
 $(4): $(2) | prepare
        $(call build_cmd_fixdep,CC,$(1),$(4),\
-               $(CC)  $(CINCLUDES) $(CINCLUDES-y) \
+               $(CC)  $(COMPFLAGS) $(COMPFLAGS-y) \
+                      $($(call vprefix_lib,$(1),COMPFLAGS)) $($(call 
vprefix_lib,$(1),COMPFLAGS-y)) \
+                      $(CINCLUDES) $(CINCLUDES-y) \
                       $($(call vprefix_lib,$(1),CINCLUDES)) $($(call 
vprefix_lib,$(1),CINCLUDES-y)) \
                       $($(call vprefix_src,$(1),$(2),$(3),INCLUDES)) $($(call 
vprefix_src,$(1),$(2),$(3),INCLUDES-y)) \
+                      $(ARCHFLAGS) $(ARCHFLAGS-y) \
                       $(CFLAGS) $(CFLAGS-y) \
                       $($(call vprefix_lib,$(1),CFLAGS)) $($(call 
vprefix_lib,$(1),CFLAGS-y)) \
                       $($(call vprefix_src,$(1),$(2),$(3),FLAGS)) $($(call 
vprefix_src,$(1),$(2),$(3),FLAGS-y)) \
@@ -451,9 +460,11 @@ endef
 define buildrule_cxx =
 $(4): $(2) | prepare
        $(call build_cmd_fixdep,CXX,$(1),$(4),\
-               $(CXX) $(CXXINCLUDES) $(CXXINCLUDES-y) \
+               $(CXX) $(COMPFLAGS) $(COMPFLAGS-y) \
+                      $(CXXINCLUDES) $(CXXINCLUDES-y) \
                       $($(call vprefix_lib,$(1),CXXINCLUDES)) $($(call 
vprefix_lib,$(1),CXXINCLUDES-y)) \
                       $($(call vprefix_src,$(1),$(2),$(3),INCLUDES)) $($(call 
vprefix_src,$(1),$(2),$(3),INCLUDES-y)) \
+                      $(ARCHFLAGS) $(ARCHFLAGS-y) \
                       $(CXXFLAGS) $(CXXFLAGS-y) \
                       $($(call vprefix_lib,$(1),CXXFLAGS)) $($(call 
vprefix_lib,$(1),CXXFLAGS-y)) \
                       $($(call vprefix_src,$(1),$(2),$(3),FLAGS)) $($(call 
vprefix_src,$(1),$(2),$(3),FLAGS-y)) \
@@ -481,9 +492,11 @@ buildrule_c$(plus)$(plus) = $(call 
buildrule_cxx,$(1),$(2),$(3),$(4))
 define buildrule_go =
 $(4): $(2) | prepare
        $(call build_cmd,GOC,$(1),$(4),\
-               $(GOC) $(GOCINCLUDES) $(GOCINCLUDES-y) \
+               $(GOC) $(COMPFLAGS) $(COMPFLAGS-y) \
+                      $(GOCINCLUDES) $(GOCINCLUDES-y) \
                       $($(call vprefix_lib,$(1),GOCINCLUDES)) $($(call 
vprefix_lib,$(1),GOCINCLUDES-y)) \
                       $($(call vprefix_src,$(1),$(2),$(3),INCLUDES)) $($(call 
vprefix_src,$(1),$(2),$(3),INCLUDES-y)) \
+                      $(ARCHFLAGS) $(ARCHFLAGS-y) \
                       $(GOCFLAGS) $(GOCFLAGS-y) \
                       $($(call vprefix_lib,$(1),GOCFLAGS)) $($(call 
vprefix_lib,$(1),GOCFLAGS-y)) \
                       $($(call vprefix_src,$(1),$(2),$(3),FLAGS)) $($(call 
vprefix_src,$(1),$(2),$(3),FLAGS-y)) \
-- 
2.20.1


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.