From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web10.6112.1645151475685665381 for ; Thu, 17 Feb 2022 18:31:17 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=oEFAH0mB; spf=pass (domain: intel.com, ip: 134.134.136.24, mailfrom: guomin.jiang@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645151476; x=1676687476; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=aVBJ5uIFU29m6gkrq8Pifuq2nh04uL+5jx5jRpS/Hx4=; b=oEFAH0mBCEjZyNg5DX3PJHYoWv+Yr3nBeLZUX6HH649zH2FiGps2VIGN GPI5OTjZZ/PEm2oDsF6M0gNQZaEMaMfsTzdEpja8kerWNuK56TZBo6Khd EdeKbCWhY+yaKswd3cQI7bEhn66THrI2nTv3j67J4RXxEWQl9y6JVN87B NrnLMqrqN6BmbgzritkGEUfN+PzcIOK0FMA52epv0NO5iN/ePSk2aozMx 1+w4Nc0A76Ur8d+TBfBPDjlb88ZjwkJeKL+JE3zbCv3KjkkaNnkozfLw2 kkPqQryfX+ciMHGuqS9bj6JiCPrFbSeFAUDCQKmWaet2souLMGmUOkOA1 g==; X-IronPort-AV: E=McAfee;i="6200,9189,10261"; a="250789692" X-IronPort-AV: E=Sophos;i="5.88,377,1635231600"; d="scan'208";a="250789692" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Feb 2022 18:31:16 -0800 X-IronPort-AV: E=Sophos;i="5.88,377,1635231600"; d="scan'208";a="590004697" Received: from guominji-mobl1.ccr.corp.intel.com ([10.238.15.53]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Feb 2022 18:31:15 -0800 From: "Guomin Jiang" To: devel@edk2.groups.io Cc: Bob Feng , Liming Gao , Yuwei Chen Subject: [PATCH 1/2] BaseTools/Conf: Reduce the ASSERT patch to save the binary size Date: Fri, 18 Feb 2022 10:30:07 +0800 Message-Id: <20220218023008.1347-2-guomin.jiang@intel.com> X-Mailer: git-send-email 2.35.1.windows.2 In-Reply-To: <20220218023008.1347-1-guomin.jiang@intel.com> References: <20220218023008.1347-1-guomin.jiang@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Cc: Liming Gao Cc: Yuwei Chen Signed-off-by: Guomin Jiang --- 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.
+# Copyright (c) 2007 - 2022, Intel Corporation. All rights reserved.
# Portions copyright (c) 2008 - 2010, Apple Inc. All rights reserved.
# Copyright (c) 2020, ARM Ltd. All rights reserved.
# SPDX-License-Identifier: BSD-2-Clause-Patent @@ -126,14 +126,14 @@ $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj - "$(CC)" /Fo${dst} $(DEPS_FLAGS) $(CC_FLAGS) $(INC) ${src} + "$(CC)" /Fo${dst} $(DEPS_FLAGS) /D DEBUG_FILE="\"${s_base}.c\"" $(CC_FLAGS) $(INC) ${src} # 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} - "$(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] @@ -146,7 +146,7 @@ $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj - "$(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] -- 2.35.1.windows.2