From 98edce75fa65ba2d562aad1c4000d30e323e69b1 Mon Sep 17 00:00:00 2001 From: Rebecca Cran Date: Mon, 1 May 2023 07:44:50 -0600 Subject: BaseTools: Add ARM and AARCH64 CLANGDWARF support in tools_def.template Add ARM and AARCH64 support to CLANGDWARF in tools_def.template, copying the CLANG38 definitions. Signed-off-by: Rebecca Cran Reviewed-by: Michael D Kinney Tested-by: Michael D Kinney --- BaseTools/Conf/tools_def.template | 90 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) (limited to 'BaseTools') diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template index c32c64f5ce..7f44e10a42 100755 --- a/BaseTools/Conf/tools_def.template +++ b/BaseTools/Conf/tools_def.template @@ -2205,6 +2205,96 @@ NOOPT_CLANGDWARF_X64_CC_FLAGS = DEF(CLANG38_ALL_CC_FLAGS) -m64 "-DEFIAPI NOOPT_CLANGDWARF_X64_DLINK_FLAGS = DEF(CLANGDWARF_IA32_X64_DLINK_FLAGS) -Wl,-O0 -Wl,-melf_x86_64 -Wl,--oformat,elf64-x86-64 -Wl,-pie -mcmodel=small -Wl,--apply-dynamic-relocs NOOPT_CLANGDWARF_X64_DLINK2_FLAGS = DEF(CLANGDWARF_X64_DLINK2_FLAGS) -O0 -fuse-ld=lld +################## +# CLANGDWARF ARM definitions +################## +DEFINE CLANGDWARF_ARM_TARGET = -target arm-linux-gnueabi +DEFINE CLANGDWARF_ARM_CC_FLAGS = DEF(GCC_ARM_CC_FLAGS) DEF(CLANGDWARF_ARM_TARGET) DEF(CLANGDWARF_WARNING_OVERRIDES) -mno-movt +DEFINE CLANGDWARF_ARM_DLINK_FLAGS = DEF(CLANGDWARF_ARM_TARGET) DEF(GCC_ARM_DLINK_FLAGS) + +*_CLANGDWARF_ARM_PP_FLAGS = DEF(GCC_PP_FLAGS) +*_CLANGDWARF_ARM_ASLCC_FLAGS = DEF(GCC_ASLCC_FLAGS) +*_CLANGDWARF_ARM_APP_FLAGS = +*_CLANGDWARF_ARM_ASL_FLAGS = DEF(IASL_FLAGS) +*_CLANGDWARF_ARM_ASL_OUTFLAGS = DEF(IASL_OUTFLAGS) +*_CLANGDWARF_ARM_DTCPP_FLAGS = DEF(GCC_DTCPP_FLAGS) + +*_CLANGDWARF_ARM_CC_PATH = ENV(CLANGDWARF_BIN)clang +*_CLANGDWARF_ARM_ASM_PATH = ENV(CLANGDWARF_BIN)clang +*_CLANGDWARF_ARM_PP_PATH = ENV(CLANGDWARF_BIN)clang +*_CLANGDWARF_ARM_VFRPP_PATH = ENV(CLANGDWARF_BIN)clang +*_CLANGDWARF_ARM_ASLCC_PATH = ENV(CLANGDWARF_BIN)clang +*_CLANGDWARF_ARM_ASLPP_PATH = ENV(CLANGDWARF_BIN)clang +*_CLANGDWARF_ARM_DLINK_PATH = ENV(CLANGDWARF_BIN)clang +*_CLANGDWARF_ARM_ASLDLINK_PATH = ENV(CLANGDWARF_BIN)clang + +*_CLANGDWARF_ARM_SLINK_PATH = ENV(CLANGDWARF_BIN)llvm-ar +*_CLANGDWARF_ARM_RC_PATH = ENV(CLANGDWARF_ARM_PREFIX)objcopy + +*_CLANGDWARF_ARM_ASLCC_FLAGS = DEF(GCC_ASLCC_FLAGS) -fno-lto +*_CLANGDWARF_ARM_ASLDLINK_FLAGS = DEF(CLANGDWARF_ARM_TARGET) DEF(GCC_ARM_ASLDLINK_FLAGS) +*_CLANGDWARF_ARM_ASM_FLAGS = DEF(GCC_ASM_FLAGS) DEF(CLANGDWARF_ARM_TARGET) $(PLATFORM_FLAGS) -Qunused-arguments +*_CLANGDWARF_ARM_DLINK2_FLAGS = DEF(GCC_DLINK2_FLAGS_COMMON) -Wl,--defsym=PECOFF_HEADER_SIZE=0x220 +*_CLANGDWARF_ARM_PLATFORM_FLAGS = -march=armv7-a +*_CLANGDWARF_ARM_PP_FLAGS = DEF(GCC_PP_FLAGS) DEF(CLANGDWARF_ARM_TARGET) $(PLATFORM_FLAGS) +*_CLANGDWARF_ARM_RC_FLAGS = DEF(GCC_ARM_RC_FLAGS) +*_CLANGDWARF_ARM_VFRPP_FLAGS = DEF(GCC_VFRPP_FLAGS) DEF(CLANGDWARF_ARM_TARGET) $(PLATFORM_FLAGS) +*_CLANGDWARF_ARM_ASLPP_FLAGS = DEF(GCC_ASLPP_FLAGS) DEF(CLANGDWARF_ARM_TARGET) +*_CLANGDWARF_ARM_CC_XIPFLAGS = DEF(GCC_ARM_CC_XIPFLAGS) + + DEBUG_CLANGDWARF_ARM_CC_FLAGS = DEF(CLANGDWARF_ARM_CC_FLAGS) $(PLATFORM_FLAGS) -flto -O1 + DEBUG_CLANGDWARF_ARM_DLINK_FLAGS = DEF(CLANGDWARF_ARM_DLINK_FLAGS) -flto -Wl,-O1 -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-arm -Wl,-plugin-opt=-pass-through=-llto-arm + NOOPT_CLANGDWARF_ARM_CC_FLAGS = DEF(CLANGDWARF_ARM_CC_FLAGS) $(PLATFORM_FLAGS) -O0 + NOOPT_CLANGDWARF_ARM_DLINK_FLAGS = DEF(CLANGDWARF_ARM_DLINK_FLAGS) +RELEASE_CLANGDWARF_ARM_CC_FLAGS = DEF(CLANGDWARF_ARM_CC_FLAGS) $(PLATFORM_FLAGS) -flto -O3 +RELEASE_CLANGDWARF_ARM_DLINK_FLAGS = DEF(CLANGDWARF_ARM_DLINK_FLAGS) -flto -Wl,-O3 -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-arm -Wl,-plugin-opt=-pass-through=-llto-arm + +################## +# CLANGDWARF AARCH64 definitions +################## +DEFINE CLANGDWARF_AARCH64_TARGET = -target aarch64-linux-gnu +DEFINE CLANGDWARF_AARCH64_CC_FLAGS = DEF(GCC_AARCH64_CC_FLAGS) DEF(CLANGDWARF_AARCH64_TARGET) -mcmodel=small DEF(CLANGDWARF_WARNING_OVERRIDES) +DEFINE CLANGDWARF_AARCH64_DLINK_FLAGS = DEF(CLANGDWARF_AARCH64_TARGET) DEF(GCC_AARCH64_DLINK_FLAGS) -z common-page-size=0x1000 + +*_CLANGDWARF_AARCH64_PP_FLAGS = DEF(GCC_PP_FLAGS) +*_CLANGDWARF_AARCH64_ASLCC_FLAGS = DEF(GCC_ASLCC_FLAGS) +*_CLANGDWARF_AARCH64_APP_FLAGS = +*_CLANGDWARF_AARCH64_ASL_FLAGS = DEF(IASL_FLAGS) +*_CLANGDWARF_AARCH64_ASL_OUTFLAGS = DEF(IASL_OUTFLAGS) +*_CLANGDWARF_AARCH64_DTCPP_FLAGS = DEF(GCC_DTCPP_FLAGS) + +*_CLANGDWARF_AARCH64_CC_PATH = ENV(CLANGDWARF_BIN)clang +*_CLANGDWARF_AARCH64_ASM_PATH = ENV(CLANGDWARF_BIN)clang +*_CLANGDWARF_AARCH64_PP_PATH = ENV(CLANGDWARF_BIN)clang +*_CLANGDWARF_AARCH64_VFRPP_PATH = ENV(CLANGDWARF_BIN)clang +*_CLANGDWARF_AARCH64_ASLCC_PATH = ENV(CLANGDWARF_BIN)clang +*_CLANGDWARF_AARCH64_ASLPP_PATH = ENV(CLANGDWARF_BIN)clang +*_CLANGDWARF_AARCH64_DLINK_PATH = ENV(CLANGDWARF_BIN)clang +*_CLANGDWARF_AARCH64_ASLDLINK_PATH = ENV(CLANGDWARF_BIN)clang + +*_CLANGDWARF_AARCH64_SLINK_PATH = ENV(CLANGDWARF_BIN)llvm-ar +*_CLANGDWARF_AARCH64_RC_PATH = ENV(CLANGDWARF_AARCH64_PREFIX)objcopy + +*_CLANGDWARF_AARCH64_ASLCC_FLAGS = DEF(GCC_ASLCC_FLAGS) -fno-lto +*_CLANGDWARF_AARCH64_ASLDLINK_FLAGS = DEF(CLANGDWARF_AARCH64_TARGET) DEF(GCC_AARCH64_ASLDLINK_FLAGS) +*_CLANGDWARF_AARCH64_ASM_FLAGS = DEF(GCC_ASM_FLAGS) DEF(CLANGDWARF_AARCH64_TARGET) $(PLATFORM_FLAGS) -Qunused-arguments +*_CLANGDWARF_AARCH64_DLINK_FLAGS = DEF(CLANGDWARF_AARCH64_TARGET) DEF(GCC_AARCH64_DLINK_FLAGS) -z common-page-size=0x1000 +*_CLANGDWARF_AARCH64_DLINK_XIPFLAGS = -z common-page-size=0x20 +*_CLANGDWARF_AARCH64_DLINK2_FLAGS = DEF(GCC_DLINK2_FLAGS_COMMON) -Wl,--defsym=PECOFF_HEADER_SIZE=0x228 +*_CLANGDWARF_AARCH64_PLATFORM_FLAGS = +*_CLANGDWARF_AARCH64_PP_FLAGS = DEF(GCC_PP_FLAGS) DEF(CLANGDWARF_AARCH64_TARGET) $(PLATFORM_FLAGS) +*_CLANGDWARF_AARCH64_RC_FLAGS = DEF(GCC_AARCH64_RC_FLAGS) DEF(GCC_AARCH64_RC_BTI_FLAGS) +*_CLANGDWARF_AARCH64_VFRPP_FLAGS = DEF(GCC_VFRPP_FLAGS) DEF(CLANGDWARF_AARCH64_TARGET) $(PLATFORM_FLAGS) +*_CLANGDWARF_AARCH64_ASLPP_FLAGS = DEF(GCC_ASLPP_FLAGS) DEF(CLANGDWARF_AARCH64_TARGET) +*_CLANGDWARF_AARCH64_CC_XIPFLAGS = DEF(GCC_AARCH64_CC_XIPFLAGS) + + DEBUG_CLANGDWARF_AARCH64_CC_FLAGS = DEF(CLANGDWARF_AARCH64_CC_FLAGS) $(PLATFORM_FLAGS) -flto -O1 + DEBUG_CLANGDWARF_AARCH64_DLINK_FLAGS = DEF(CLANGDWARF_AARCH64_DLINK_FLAGS) -flto -Wl,-O1 -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-aarch64 -Wl,-plugin-opt=-pass-through=-llto-aarch64 + NOOPT_CLANGDWARF_AARCH64_CC_FLAGS = DEF(CLANGDWARF_AARCH64_CC_FLAGS) $(PLATFORM_FLAGS) -O0 + NOOPT_CLANGDWARF_AARCH64_DLINK_FLAGS = DEF(CLANGDWARF_AARCH64_DLINK_FLAGS) +RELEASE_CLANGDWARF_AARCH64_CC_FLAGS = DEF(CLANGDWARF_AARCH64_CC_FLAGS) $(PLATFORM_FLAGS) -flto -O3 +RELEASE_CLANGDWARF_AARCH64_DLINK_FLAGS = DEF(CLANGDWARF_AARCH64_DLINK_FLAGS) -flto -Wl,-O3 -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-aarch64 -Wl,-plugin-opt=-pass-through=-llto-aarch64 + # # # XCODE5 support -- cgit v1.2.3