From: "Guomin Jiang" <guomin.jiang@intel.com>
To: devel@edk2.groups.io
Cc: Bob Feng <bob.c.feng@intel.com>,
Liming Gao <gaoliming@byosoft.com.cn>,
Yuwei Chen <yuwei.chen@intel.com>
Subject: [PATCH 1/2] BaseTools/Conf: Reduce the ASSERT patch to save the binary size
Date: Fri, 18 Feb 2022 10:30:07 +0800 [thread overview]
Message-ID: <20220218023008.1347-2-guomin.jiang@intel.com> (raw)
In-Reply-To: <20220218023008.1347-1-guomin.jiang@intel.com>
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3840
Use DEBUG_FILE to control ASSERT path
Motivation and Goal:
1. The path will occupy many size in DEBUG build when file path is long
2. We hope can reduce the size but not impact the debug capability
3. If only use filename, we can search the filename to locate file. It
can save many size meanwhile.
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: Guomin Jiang <guomin.jiang@intel.com>
---
BaseTools/Conf/build_rule.template | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/BaseTools/Conf/build_rule.template b/BaseTools/Conf/build_rule.template
index f40118234471..ad0bae42be62 100755
--- a/BaseTools/Conf/build_rule.template
+++ b/BaseTools/Conf/build_rule.template
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2007 - 2022, Intel Corporation. All rights reserved.<BR>
# Portions copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>
# Copyright (c) 2020, ARM Ltd. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -126,14 +126,14 @@
$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj
<Command.MSFT, Command.INTEL>
- "$(CC)" /Fo${dst} $(DEPS_FLAGS) $(CC_FLAGS) $(INC) ${src}
+ "$(CC)" /Fo${dst} $(DEPS_FLAGS) /D DEBUG_FILE="\"${s_base}.c\"" $(CC_FLAGS) $(INC) ${src}
<Command.GCC, Command.RVCT>
# For RVCTCYGWIN CC_FLAGS must be first to work around pathing issues
- "$(CC)" $(DEPS_FLAGS) $(CC_FLAGS) -c -o ${dst} $(INC) ${src}
+ "$(CC)" $(DEPS_FLAGS) -D DEBUG_FILE="\"${s_base}.c\"" $(CC_FLAGS) -c -o ${dst} $(INC) ${src}
<Command.XCODE>
- "$(CC)" $(DEPS_FLAGS) $(CC_FLAGS) -o ${dst} $(INC) ${src}
+ "$(CC)" $(DEPS_FLAGS) -D DEBUG_FILE="\"${s_base}.c\"" $(CC_FLAGS) -o ${dst} $(INC) ${src}
[C-Code-File.BASE.AARCH64,C-Code-File.SEC.AARCH64,C-Code-File.PEI_CORE.AARCH64,C-Code-File.PEIM.AARCH64,C-Code-File.BASE.ARM,C-Code-File.SEC.ARM,C-Code-File.PEI_CORE.ARM,C-Code-File.PEIM.ARM]
<InputFile>
@@ -146,7 +146,7 @@
$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj
<Command.GCC, Command.RVCT>
- "$(CC)" $(CC_FLAGS) $(CC_XIPFLAGS) -c -o ${dst} $(INC) ${src}
+ "$(CC)" -D DEBUG_FILE="\"${s_base}.c\"" $(CC_FLAGS) $(CC_XIPFLAGS) -c -o ${dst} $(INC) ${src}
[C-Header-File]
<InputFile>
--
2.35.1.windows.2
next prev parent reply other threads:[~2022-02-18 2:31 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-18 2:30 [PATCH 0/2] Reduce the ASSERT patch to save the binary size Guomin Jiang
2022-02-18 2:30 ` Guomin Jiang [this message]
2022-02-28 9:52 ` [PATCH 1/2] BaseTools/Conf: " Bob Feng
2022-03-01 0:47 ` Guomin Jiang
2022-02-18 2:30 ` [PATCH 2/2] MdePkg/Include: Define new DEBUG_FILE to specify path Guomin Jiang
2022-02-18 3:33 ` [edk2-devel] [PATCH 0/2] Reduce the ASSERT patch to save the binary size Michael D Kinney
2022-02-21 1:30 ` Guomin Jiang
2022-03-01 1:47 ` 回复: " gaoliming
[not found] ` <16D4C08DC1603ADF.6551@groups.io>
2022-02-24 2:33 ` [edk2-devel] [PATCH 2/2] MdePkg/Include: Define new DEBUG_FILE to specify path Guomin Jiang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220218023008.1347-2-guomin.jiang@intel.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox