From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mx.groups.io with SMTP id smtpd.web09.13058.1642690802748623056 for ; Thu, 20 Jan 2022 07:00:03 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=jmZWb93t; spf=pass (domain: intel.com, ip: 192.55.52.151, mailfrom: wei6.xu@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1642690802; x=1674226802; h=from:to:cc:subject:date:message-id; bh=rW0sFXdrJo22WjXuJ7aRvane4FszCGRIiZqg7h0qE3U=; b=jmZWb93tlSPdKG9zRtQhaUmHdkTrNhKjyeB1GDSfMg4eU5z7qNh867wh a6PLZWJ7G/uhOshCi4wPIzZzaW4b/2WRcJ7LyQzmKw/mT59rYk38QmSje eZUKFdW4tJzo1nCSIsIj1YF2H8jdPpqSzBlvMkaW965mdOQFqI5q1yXsK q4crYWLf+c6XUcOm5ap6CkyWDDPdK4JaUydl5wTOwdstAbtqZjdkjIkrL Uj/dW19Pza9YktgM/uVateeDYcmQYqM7w7SPxtzQRQ3W/EqjXeO9mYAu1 9jU1zI6LEI7WhY90+LdP7kpmUPYObBV2yPvlnmdbz6Az9CiNnJ2sYLuiw g==; X-IronPort-AV: E=McAfee;i="6200,9189,10232"; a="226044373" X-IronPort-AV: E=Sophos;i="5.88,302,1635231600"; d="scan'208";a="226044373" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jan 2022 07:00:01 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,302,1635231600"; d="scan'208";a="532799349" Received: from shwdeopenpsi174.ccr.corp.intel.com ([10.239.157.25]) by orsmga008.jf.intel.com with ESMTP; 20 Jan 2022 07:00:00 -0800 From: "Xu, Wei6" To: devel@edk2.groups.io Cc: Bob Feng , Liming Gao , Yuwei Chen Subject: [edk2-devel] [Patch] BaseTools/Conf: Add new macro for customizing dll file reduction. Date: Thu, 20 Jan 2022 22:59:56 +0800 Message-Id: <20220120145956.11592-1-wei6.xu@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3810 New macro OBJCOPY_STRIPFLAG is added in build_rule.template to replace '--strip-unneeded -R .eh_frame', so that module can have some unique objcopy flags for its own purpose. In tools_def.template, set '--strip-unneeded -R .eh_frame' as default value of OBJCOPY_STRIPFLAG. Cc: Bob Feng Cc: Liming Gao Cc: Yuwei Chen Signed-off-by: Wei6 Xu --- BaseTools/Conf/build_rule.template | 2 +- BaseTools/Conf/tools_def.template | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/BaseTools/Conf/build_rule.template b/BaseTools/Conf/build_rule.template index 3add1029f2..f401182344 100755 --- a/BaseTools/Conf/build_rule.template +++ b/BaseTools/Conf/build_rule.template @@ -373,11 +373,11 @@ $(CP) ${dst} $(BIN_DIR)(+)$(MODULE_NAME_GUID).efi -$(CP) $(DEBUG_DIR)(+)*.map $(OUTPUT_DIR) -$(CP) $(DEBUG_DIR)(+)*.pdb $(OUTPUT_DIR) $(CP) ${src} $(DEBUG_DIR)(+)$(MODULE_NAME).debug - $(OBJCOPY) --strip-unneeded -R .eh_frame ${src} + $(OBJCOPY) $(OBJCOPY_STRIPFLAG) ${src} # #The below 2 lines are only needed for UNIXGCC tool chain, which generates PE image directly # -$(OBJCOPY) $(OBJCOPY_ADDDEBUGFLAG) ${src} diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template index 2e6b382ab6..85b8afbb2d 100755 --- a/BaseTools/Conf/tools_def.template +++ b/BaseTools/Conf/tools_def.template @@ -1860,10 +1860,11 @@ NOOPT_VS2019_AARCH64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF *_*_*_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 +*_*_*_OBJCOPY_STRIPFLAG = --strip-unneeded -R .eh_frame *_*_*_DTC_FLAGS = -H epapr *_*_*_DTCPP_PATH = DEF(DTCPP_BIN) *_*_*_DTC_PATH = DEF(DTC_BIN) DEFINE GCC_ALL_CC_FLAGS = -g -Os -fshort-wchar -fno-builtin -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -include AutoGen.h -fno-common -- 2.16.2.windows.1