public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-devel] [Patch] BaseTools/Conf: Add new macro for customizing dll file reduction.
@ 2022-01-20 14:59 Xu, Wei6
  2022-01-26  2:04 ` 回复: " gaoliming
  0 siblings, 1 reply; 2+ messages in thread
From: Xu, Wei6 @ 2022-01-20 14:59 UTC (permalink / raw)
  To: devel; +Cc: Bob Feng, Liming Gao, Yuwei Chen

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 <bob.c.feng@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Yuwei Chen <yuwei.chen@intel.com>
Signed-off-by: Wei6 Xu <wei6.xu@intel.com>
---
 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) 
     <Command.GCC>
         $(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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-01-26  2:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-20 14:59 [edk2-devel] [Patch] BaseTools/Conf: Add new macro for customizing dll file reduction Xu, Wei6
2022-01-26  2:04 ` 回复: " gaoliming

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox