From d4dcd5542a88eeee5a268284a4dfe026918f1720 Mon Sep 17 00:00:00 2001 From: Ard Biesheuvel Date: Mon, 4 Jan 2016 09:31:33 +0000 Subject: [PATCH] BaseTools CLANG35: use linux-gnu target triplets explicitly Since we are combining Clang with the GNU linker, make that explicit in the target triplet. This affects certain builtin defines and other compiler behavior that may be unspecified otherwise. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel Reviewed-by: Liming Gao Reviewed-by: Leif Lindholm git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19583 6f19259b-4bc3-4df7-8a09-765794883524 --- BaseTools/Conf/tools_def.template | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template index 6e26bbca93..8d3f209993 100644 --- a/BaseTools/Conf/tools_def.template +++ b/BaseTools/Conf/tools_def.template @@ -5183,9 +5183,12 @@ RELEASE_GCC49_AARCH64_CC_FLAGS = DEF(GCC49_AARCH64_CC_FLAGS) -Wno-unused-but-s *_CLANG35_*_ASLCC_PATH = ENV(CLANG35_BIN)clang *_CLANG35_*_ASLPP_PATH = ENV(CLANG35_BIN)clang +DEFINE CLANG35_ARM_TARGET = -target armv7-none-linux-gnueabi +DEFINE CLANG35_AARCH64_TARGET = -target aarch64-none-linux-gnu + DEFINE CLANG35_WARNING_OVERRIDES = -Wno-parentheses-equality -Wno-tautological-compare -Wno-tautological-constant-out-of-range-compare -Wno-empty-body -DEFINE CLANG35_ARM_CC_FLAGS = DEF(GCC_ARM_CC_FLAGS) -target armv7-a -mstrict-align -mllvm -arm-use-movt=0 DEF(CLANG35_WARNING_OVERRIDES) -DEFINE CLANG35_AARCH64_CC_FLAGS = DEF(GCC_AARCH64_CC_FLAGS) -target aarch64 -mcmodel=small -mstrict-align DEF(CLANG35_WARNING_OVERRIDES) +DEFINE CLANG35_ARM_CC_FLAGS = DEF(GCC_ARM_CC_FLAGS) DEF(CLANG35_ARM_TARGET) -mstrict-align -mllvm -arm-use-movt=0 DEF(CLANG35_WARNING_OVERRIDES) +DEFINE CLANG35_AARCH64_CC_FLAGS = DEF(GCC_AARCH64_CC_FLAGS) DEF(CLANG35_AARCH64_TARGET) -mcmodel=small -mstrict-align DEF(CLANG35_WARNING_OVERRIDES) ################## # CLANG35 ARM definitions @@ -5197,7 +5200,7 @@ DEFINE CLANG35_AARCH64_CC_FLAGS = DEF(GCC_AARCH64_CC_FLAGS) -target aarch64 -mc *_CLANG35_ARM_ASLCC_FLAGS = DEF(GCC_ASLCC_FLAGS) *_CLANG35_ARM_ASLDLINK_FLAGS = DEF(GCC_ARM_ASLDLINK_FLAGS) -*_CLANG35_ARM_ASM_FLAGS = DEF(GCC_ASM_FLAGS) $(ARCHASM_FLAGS) $(PLATFORM_FLAGS) -target armv7-a -Qunused-arguments +*_CLANG35_ARM_ASM_FLAGS = DEF(GCC_ASM_FLAGS) DEF(CLANG35_ARM_TARGET) $(ARCHASM_FLAGS) $(PLATFORM_FLAGS) -Qunused-arguments *_CLANG35_ARM_DLINK_FLAGS = DEF(GCC_ARM_DLINK_FLAGS) *_CLANG35_ARM_DLINK2_FLAGS = DEF(GCC_DLINK2_FLAGS_COMMON) --defsym=PECOFF_HEADER_SIZE=0x220 *_CLANG35_ARM_PLATFORM_FLAGS = @@ -5218,7 +5221,7 @@ RELEASE_CLANG35_ARM_CC_FLAGS = DEF(CLANG35_ARM_CC_FLAGS) $(ARCHCC_FLAGS) $(P *_CLANG35_AARCH64_ASLCC_FLAGS = DEF(GCC_ASLCC_FLAGS) *_CLANG35_AARCH64_ASLDLINK_FLAGS = DEF(GCC_AARCH64_ASLDLINK_FLAGS) -*_CLANG35_AARCH64_ASM_FLAGS = DEF(GCC_ASM_FLAGS) $(ARCHASM_FLAGS) $(PLATFORM_FLAGS) -target aarch64 -Qunused-arguments +*_CLANG35_AARCH64_ASM_FLAGS = DEF(GCC_ASM_FLAGS) DEF(CLANG35_AARCH64_TARGET) $(ARCHASM_FLAGS) $(PLATFORM_FLAGS) -Qunused-arguments *_CLANG35_AARCH64_DLINK_FLAGS = DEF(GCC_AARCH64_DLINK_FLAGS) -z common-page-size=0x1000 *_CLANG35_AARCH64_DLINK2_FLAGS = DEF(GCC_DLINK2_FLAGS_COMMON) --defsym=PECOFF_HEADER_SIZE=0x228 *_CLANG35_AARCH64_PLATFORM_FLAGS =