Re: [PATCH 0/2] Reduce the ASSERT patch to save the binary size

Michael D Kinney


I think there is a cleaner solution to this problem using
compiler flags to change the contents of the __FILE__ macro.

I found this content when I was working on the CompareBuild tool
and using these techniques can guarantee the same binaries are
produced when the path to WORKSPACE is different on different
build systems.

Does your change provide a module-relative, package-relative,
or workspace-relative file path in the ASSERT()?

How does ASSERT() in autogen work?



-----Original Message-----
From: <> On Behalf Of Guomin Jiang
Sent: Thursday, February 17, 2022 6:30 PM
Subject: [edk2-devel] [PATCH 0/2] Reduce the ASSERT patch to save the binary size


1. Use DEBUG_FILE to control ASSERT path
2. Default use file name as 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.

Guomin Jiang (2):
BaseTools/Conf: Reduce the ASSERT patch to save the binary size
MdePkg/Include: Define new DEBUG_FILE to specify path.

BaseTools/Conf/build_rule.template | 10 ++++----
MdePkg/Include/Library/DebugLib.h | 39 +++++++++++++++++++++---------
2 files changed, 33 insertions(+), 16 deletions(-)


Join to automatically receive all group messages.