From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (using TLSv1 with cipher CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 1DF201A1E31 for ; Tue, 4 Oct 2016 18:30:32 -0700 (PDT) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga103.fm.intel.com with ESMTP; 04 Oct 2016 18:30:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,446,1473145200"; d="scan'208";a="16283750" Received: from shwdeopenpsi168.ccr.corp.intel.com ([10.239.158.144]) by fmsmga005.fm.intel.com with ESMTP; 04 Oct 2016 18:30:30 -0700 From: Yonghong Zhu To: edk2-devel@lists.01.org Cc: Liming Gao , Laszlo Ersek Date: Wed, 5 Oct 2016 09:30:26 +0800 Message-Id: <1475631026-23928-1-git-send-email-yonghong.zhu@intel.com> X-Mailer: git-send-email 2.6.1.windows.1 Subject: [Patch V2] BaseTools: support the NOOPT target with the GCC tool chains X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Oct 2016 01:30:32 -0000 Update the tools_def.template to add NOOPT support with GCC tool chains. Cc: Liming Gao Cc: Laszlo Ersek Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu --- BaseTools/Conf/tools_def.template | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template index 5414454..2c0dcd6 100755 --- a/BaseTools/Conf/tools_def.template +++ b/BaseTools/Conf/tools_def.template @@ -4333,10 +4333,11 @@ NOOPT_DDK3790xASL_IPF_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF *_*_*_OBJCOPY_FLAGS = objcopy not needed for *_*_*_SYMRENAME_PATH = echo *_*_*_SYMRENAME_FLAGS = Symbol renaming not needed for DEBUG_*_*_OBJCOPY_ADDDEBUGFLAG = --add-gnu-debuglink=$(DEBUG_DIR)/$(MODULE_NAME).debug RELEASE_*_*_OBJCOPY_ADDDEBUGFLAG = +NOOPT_*_*_OBJCOPY_ADDDEBUGFLAG = --add-gnu-debuglink=$(DEBUG_DIR)/$(MODULE_NAME).debug DEFINE GCC_ALL_CC_FLAGS = -g -Os -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -include AutoGen.h -fno-common DEFINE GCC_IA32_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -m32 -malign-double -freorder-blocks -freorder-blocks-and-partition -O2 -mno-stack-arg-probe DEFINE GCC_X64_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -mno-red-zone -Wno-address -mno-stack-arg-probe DEFINE GCC_IPF_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -minline-int-divide-min-latency @@ -4767,10 +4768,11 @@ DEFINE GCC5_AARCH64_ASLDLINK_FLAGS = DEF(GCC49_AARCH64_ASLDLINK_FLAGS) *_GCC46_IA32_OBJCOPY_FLAGS = *_GCC46_IA32_NASM_FLAGS = -f elf32 DEBUG_GCC46_IA32_CC_FLAGS = DEF(GCC46_IA32_CC_FLAGS) -Os RELEASE_GCC46_IA32_CC_FLAGS = DEF(GCC46_IA32_CC_FLAGS) -Os -Wno-unused-but-set-variable + NOOPT_GCC46_IA32_CC_FLAGS = DEF(GCC46_IA32_CC_FLAGS) -O0 ################## # GCC46 X64 definitions ################## *_GCC46_X64_OBJCOPY_PATH = DEF(GCC46_X64_PREFIX)objcopy @@ -4794,10 +4796,11 @@ RELEASE_GCC46_IA32_CC_FLAGS = DEF(GCC46_IA32_CC_FLAGS) -Os -Wno-unused-but *_GCC46_X64_OBJCOPY_FLAGS = *_GCC46_X64_NASM_FLAGS = -f elf64 DEBUG_GCC46_X64_CC_FLAGS = DEF(GCC46_X64_CC_FLAGS) RELEASE_GCC46_X64_CC_FLAGS = DEF(GCC46_X64_CC_FLAGS) -Wno-unused-but-set-variable + NOOPT_GCC46_X64_CC_FLAGS = DEF(GCC46_X64_CC_FLAGS) -O0 ################## # GCC46 ARM definitions ################## *_GCC46_ARM_OBJCOPY_PATH = echo @@ -4826,10 +4829,11 @@ RELEASE_GCC46_X64_CC_FLAGS = DEF(GCC46_X64_CC_FLAGS) -Wno-unused-but-set-v *_GCC46_ARM_VFRPP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_VFRPP_FLAGS) *_GCC46_ARM_CC_XIPFLAGS = DEF(GCC46_ARM_CC_XIPFLAGS) DEBUG_GCC46_ARM_CC_FLAGS = DEF(GCC46_ARM_CC_FLAGS) -O0 RELEASE_GCC46_ARM_CC_FLAGS = DEF(GCC46_ARM_CC_FLAGS) -Wno-unused-but-set-variable + NOOPT_GCC46_ARM_CC_FLAGS = DEF(GCC46_ARM_CC_FLAGS) -O0 #################################################################################### # # GCC 4.7 - This configuration is used to compile under Linux to produce # PE/COFF binaries using GCC 4.7. @@ -4873,10 +4877,11 @@ RELEASE_GCC46_ARM_CC_FLAGS = DEF(GCC46_ARM_CC_FLAGS) -Wno-unused-but-set-v *_GCC47_IA32_OBJCOPY_FLAGS = *_GCC47_IA32_NASM_FLAGS = -f elf32 DEBUG_GCC47_IA32_CC_FLAGS = DEF(GCC47_IA32_CC_FLAGS) -Os RELEASE_GCC47_IA32_CC_FLAGS = DEF(GCC47_IA32_CC_FLAGS) -Os -Wno-unused-but-set-variable + NOOPT_GCC47_IA32_CC_FLAGS = DEF(GCC47_IA32_CC_FLAGS) -O0 ################## # GCC47 X64 definitions ################## *_GCC47_X64_OBJCOPY_PATH = DEF(GCC47_X64_PREFIX)objcopy @@ -4900,10 +4905,11 @@ RELEASE_GCC47_IA32_CC_FLAGS = DEF(GCC47_IA32_CC_FLAGS) -Os -Wno-unused-but *_GCC47_X64_OBJCOPY_FLAGS = *_GCC47_X64_NASM_FLAGS = -f elf64 DEBUG_GCC47_X64_CC_FLAGS = DEF(GCC47_X64_CC_FLAGS) RELEASE_GCC47_X64_CC_FLAGS = DEF(GCC47_X64_CC_FLAGS) -Wno-unused-but-set-variable + NOOPT_GCC47_X64_CC_FLAGS = DEF(GCC47_X64_CC_FLAGS) -O0 ################## # GCC47 ARM definitions ################## *_GCC47_ARM_CC_PATH = ENV(GCC47_ARM_PREFIX)gcc @@ -4931,10 +4937,11 @@ RELEASE_GCC47_X64_CC_FLAGS = DEF(GCC47_X64_CC_FLAGS) -Wno-unused-but-set-v *_GCC47_ARM_VFRPP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_VFRPP_FLAGS) *_GCC47_ARM_CC_XIPFLAGS = DEF(GCC47_ARM_CC_XIPFLAGS) DEBUG_GCC47_ARM_CC_FLAGS = DEF(GCC47_ARM_CC_FLAGS) -O0 RELEASE_GCC47_ARM_CC_FLAGS = DEF(GCC47_ARM_CC_FLAGS) -Wno-unused-but-set-variable + NOOPT_GCC47_ARM_CC_FLAGS = DEF(GCC47_ARM_CC_FLAGS) -O0 ################## # GCC47 AARCH64 definitions ################## *_GCC47_AARCH64_CC_PATH = ENV(GCC47_AARCH64_PREFIX)gcc @@ -4959,10 +4966,11 @@ RELEASE_GCC47_ARM_CC_FLAGS = DEF(GCC47_ARM_CC_FLAGS) -Wno-unused-but-set-v *_GCC47_AARCH64_VFRPP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_VFRPP_FLAGS) *_GCC47_AARCH64_CC_XIPFLAGS = DEF(GCC47_AARCH64_CC_XIPFLAGS) DEBUG_GCC47_AARCH64_CC_FLAGS = DEF(GCC47_AARCH64_CC_FLAGS) -O0 RELEASE_GCC47_AARCH64_CC_FLAGS = DEF(GCC47_AARCH64_CC_FLAGS) -Wno-unused-but-set-variable -fomit-frame-pointer + NOOPT_GCC47_AARCH64_CC_FLAGS = DEF(GCC47_AARCH64_CC_FLAGS) -O0 #################################################################################### # # GCC 4.8 - This configuration is used to compile under Linux to produce # PE/COFF binaries using GCC 4.8. @@ -5006,10 +5014,11 @@ RELEASE_GCC47_AARCH64_CC_FLAGS = DEF(GCC47_AARCH64_CC_FLAGS) -Wno-unused-but-s *_GCC48_IA32_OBJCOPY_FLAGS = *_GCC48_IA32_NASM_FLAGS = -f elf32 DEBUG_GCC48_IA32_CC_FLAGS = DEF(GCC48_IA32_CC_FLAGS) -Os RELEASE_GCC48_IA32_CC_FLAGS = DEF(GCC48_IA32_CC_FLAGS) -Os -Wno-unused-but-set-variable + NOOPT_GCC48_IA32_CC_FLAGS = DEF(GCC48_IA32_CC_FLAGS) -O0 ################## # GCC48 X64 definitions ################## *_GCC48_X64_OBJCOPY_PATH = DEF(GCC48_X64_PREFIX)objcopy @@ -5033,10 +5042,11 @@ RELEASE_GCC48_IA32_CC_FLAGS = DEF(GCC48_IA32_CC_FLAGS) -Os -Wno-unused-but *_GCC48_X64_OBJCOPY_FLAGS = *_GCC48_X64_NASM_FLAGS = -f elf64 DEBUG_GCC48_X64_CC_FLAGS = DEF(GCC48_X64_CC_FLAGS) RELEASE_GCC48_X64_CC_FLAGS = DEF(GCC48_X64_CC_FLAGS) -Wno-unused-but-set-variable + NOOPT_GCC48_X64_CC_FLAGS = DEF(GCC48_X64_CC_FLAGS) -O0 ################## # GCC48 ARM definitions ################## *_GCC48_ARM_CC_PATH = ENV(GCC48_ARM_PREFIX)gcc @@ -5064,10 +5074,11 @@ RELEASE_GCC48_X64_CC_FLAGS = DEF(GCC48_X64_CC_FLAGS) -Wno-unused-but-set-v *_GCC48_ARM_VFRPP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_VFRPP_FLAGS) *_GCC48_ARM_CC_XIPFLAGS = DEF(GCC48_ARM_CC_XIPFLAGS) DEBUG_GCC48_ARM_CC_FLAGS = DEF(GCC48_ARM_CC_FLAGS) -O0 RELEASE_GCC48_ARM_CC_FLAGS = DEF(GCC48_ARM_CC_FLAGS) -Wno-unused-but-set-variable + NOOPT_GCC48_ARM_CC_FLAGS = DEF(GCC48_ARM_CC_FLAGS) -O0 ################## # GCC48 AARCH64 definitions ################## *_GCC48_AARCH64_CC_PATH = ENV(GCC48_AARCH64_PREFIX)gcc @@ -5092,10 +5103,11 @@ RELEASE_GCC48_ARM_CC_FLAGS = DEF(GCC48_ARM_CC_FLAGS) -Wno-unused-but-set-v *_GCC48_AARCH64_VFRPP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_VFRPP_FLAGS) *_GCC48_AARCH64_CC_XIPFLAGS = DEF(GCC48_AARCH64_CC_XIPFLAGS) DEBUG_GCC48_AARCH64_CC_FLAGS = DEF(GCC48_AARCH64_CC_FLAGS) -O0 RELEASE_GCC48_AARCH64_CC_FLAGS = DEF(GCC48_AARCH64_CC_FLAGS) -Wno-unused-but-set-variable -fomit-frame-pointer + NOOPT_GCC48_AARCH64_CC_FLAGS = DEF(GCC48_AARCH64_CC_FLAGS) -O0 #################################################################################### # # GCC 4.9 - This configuration is used to compile under Linux to produce # PE/COFF binaries using GCC 4.9. @@ -5139,10 +5151,11 @@ RELEASE_GCC48_AARCH64_CC_FLAGS = DEF(GCC48_AARCH64_CC_FLAGS) -Wno-unused-but-s *_GCC49_IA32_OBJCOPY_FLAGS = *_GCC49_IA32_NASM_FLAGS = -f elf32 DEBUG_GCC49_IA32_CC_FLAGS = DEF(GCC49_IA32_CC_FLAGS) -Os RELEASE_GCC49_IA32_CC_FLAGS = DEF(GCC49_IA32_CC_FLAGS) -Os -Wno-unused-but-set-variable + NOOPT_GCC49_IA32_CC_FLAGS = DEF(GCC49_IA32_CC_FLAGS) -O0 ################## # GCC49 X64 definitions ################## *_GCC49_X64_OBJCOPY_PATH = DEF(GCC49_X64_PREFIX)objcopy @@ -5166,10 +5179,11 @@ RELEASE_GCC49_IA32_CC_FLAGS = DEF(GCC49_IA32_CC_FLAGS) -Os -Wno-unused-but *_GCC49_X64_OBJCOPY_FLAGS = *_GCC49_X64_NASM_FLAGS = -f elf64 DEBUG_GCC49_X64_CC_FLAGS = DEF(GCC49_X64_CC_FLAGS) RELEASE_GCC49_X64_CC_FLAGS = DEF(GCC49_X64_CC_FLAGS) -Wno-unused-but-set-variable + NOOPT_GCC49_X64_CC_FLAGS = DEF(GCC49_X64_CC_FLAGS) -O0 ################## # GCC49 ARM definitions ################## *_GCC49_ARM_CC_PATH = ENV(GCC49_ARM_PREFIX)gcc @@ -5197,10 +5211,11 @@ RELEASE_GCC49_X64_CC_FLAGS = DEF(GCC49_X64_CC_FLAGS) -Wno-unused-but-set-v *_GCC49_ARM_VFRPP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_VFRPP_FLAGS) *_GCC49_ARM_CC_XIPFLAGS = DEF(GCC49_ARM_CC_XIPFLAGS) DEBUG_GCC49_ARM_CC_FLAGS = DEF(GCC49_ARM_CC_FLAGS) -O0 RELEASE_GCC49_ARM_CC_FLAGS = DEF(GCC49_ARM_CC_FLAGS) -Wno-unused-but-set-variable + NOOPT_GCC49_ARM_CC_FLAGS = DEF(GCC49_ARM_CC_FLAGS) -O0 ################## # GCC49 AARCH64 definitions ################## *_GCC49_AARCH64_CC_PATH = ENV(GCC49_AARCH64_PREFIX)gcc @@ -5229,10 +5244,14 @@ RELEASE_GCC49_ARM_CC_FLAGS = DEF(GCC49_ARM_CC_FLAGS) -Wno-unused-but-set-v DEBUG_GCC49_AARCH64_DLINK_XIPFLAGS = -z common-page-size=0x20 RELEASE_GCC49_AARCH64_CC_FLAGS = DEF(GCC49_AARCH64_CC_FLAGS) -Wno-unused-but-set-variable -mcmodel=tiny -fomit-frame-pointer RELEASE_GCC49_AARCH64_DLINK_FLAGS = DEF(GCC49_AARCH64_DLINK_FLAGS) + NOOPT_GCC49_AARCH64_CC_FLAGS = DEF(GCC49_AARCH64_CC_FLAGS) -O0 -mcmodel=small + NOOPT_GCC49_AARCH64_DLINK_FLAGS = DEF(GCC49_AARCH64_DLINK_FLAGS) -z common-page-size=0x1000 -O0 + NOOPT_GCC49_AARCH64_DLINK_XIPFLAGS = -z common-page-size=0x20 -O0 + #################################################################################### # # GCC 5 - This configuration is used to compile under Linux to produce # PE/COFF binaries using GCC 5 # @@ -5275,10 +5294,11 @@ RELEASE_GCC49_AARCH64_DLINK_FLAGS = DEF(GCC49_AARCH64_DLINK_FLAGS) *_GCC5_IA32_OBJCOPY_FLAGS = *_GCC5_IA32_NASM_FLAGS = -f elf32 DEBUG_GCC5_IA32_CC_FLAGS = DEF(GCC5_IA32_CC_FLAGS) -Os RELEASE_GCC5_IA32_CC_FLAGS = DEF(GCC5_IA32_CC_FLAGS) -Os -Wno-unused-but-set-variable + NOOPT_GCC5_IA32_CC_FLAGS = DEF(GCC5_IA32_CC_FLAGS) -O0 ################## # GCC5 X64 definitions ################## *_GCC5_X64_OBJCOPY_PATH = DEF(GCC5_X64_PREFIX)objcopy @@ -5302,10 +5322,11 @@ RELEASE_GCC5_IA32_CC_FLAGS = DEF(GCC5_IA32_CC_FLAGS) -Os -Wno-unused-but-s *_GCC5_X64_OBJCOPY_FLAGS = *_GCC5_X64_NASM_FLAGS = -f elf64 DEBUG_GCC5_X64_CC_FLAGS = DEF(GCC5_X64_CC_FLAGS) RELEASE_GCC5_X64_CC_FLAGS = DEF(GCC5_X64_CC_FLAGS) -Wno-unused-but-set-variable + NOOPT_GCC5_X64_CC_FLAGS = DEF(GCC5_X64_CC_FLAGS) -O0 ################## # GCC5 ARM definitions ################## *_GCC5_ARM_CC_PATH = ENV(GCC5_ARM_PREFIX)gcc @@ -5334,10 +5355,13 @@ RELEASE_GCC5_X64_CC_FLAGS = DEF(GCC5_X64_CC_FLAGS) -Wno-unused-but-set-va DEBUG_GCC5_ARM_DLINK_FLAGS = DEF(GCC5_ARM_DLINK_FLAGS) RELEASE_GCC5_ARM_CC_FLAGS = DEF(GCC5_ARM_CC_FLAGS) -flto -Wno-unused-but-set-variable RELEASE_GCC5_ARM_DLINK_FLAGS = DEF(GCC5_ARM_DLINK_FLAGS) -flto -Os -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-arm -Wl,-plugin-opt=-pass-through=-llto-arm + NOOPT_GCC5_ARM_CC_FLAGS = DEF(GCC5_ARM_CC_FLAGS) -O0 + NOOPT_GCC5_ARM_DLINK_FLAGS = DEF(GCC5_ARM_DLINK_FLAGS) -O0 + ################## # GCC5 AARCH64 definitions ################## *_GCC5_AARCH64_CC_PATH = ENV(GCC5_AARCH64_PREFIX)gcc *_GCC5_AARCH64_SLINK_PATH = ENV(GCC5_AARCH64_PREFIX)gcc-ar @@ -5365,10 +5389,14 @@ RELEASE_GCC5_ARM_DLINK_FLAGS = DEF(GCC5_ARM_DLINK_FLAGS) -flto -Os -L$(WORKS DEBUG_GCC5_AARCH64_DLINK_XIPFLAGS = -z common-page-size=0x20 RELEASE_GCC5_AARCH64_CC_FLAGS = DEF(GCC5_AARCH64_CC_FLAGS) -flto -Wno-unused-but-set-variable -mcmodel=tiny -fomit-frame-pointer RELEASE_GCC5_AARCH64_DLINK_FLAGS = DEF(GCC5_AARCH64_DLINK_FLAGS) -flto -Os -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-aarch64 -Wl,-plugin-opt=-pass-through=-llto-aarch64 + NOOPT_GCC5_AARCH64_CC_FLAGS = DEF(GCC5_AARCH64_CC_FLAGS) -O0 -mcmodel=small + NOOPT_GCC5_AARCH64_DLINK_FLAGS = DEF(GCC5_AARCH64_DLINK_FLAGS) -z common-page-size=0x1000 -O0 + NOOPT_GCC5_AARCH64_DLINK_XIPFLAGS = -z common-page-size=0x20 -O0 + #################################################################################### # # CLANG35 - This configuration is used to compile under Linux to produce # PE/COFF binaries using the clang compiler and assembler (v3.5 and up) # and GNU linker -- 2.6.1.windows.1