<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Mar 25, 2021, at 10:19 AM, Laszlo Ersek <<a href="mailto:lersek@redhat.com" class="">lersek@redhat.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta charset="UTF-8" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">On 03/25/21 00:25, Andrew Fish wrote:</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">This breaks some usage we have have in our fork. We have symbols turned on for Release builds, so this change would break that.<span class="Apple-converted-space"> </span><br class=""><br class="">It looks to me that the root cause of this issue might be that the GenFw is blindly writing the debug directory entry into the PE/COFF?<br class=""></blockquote><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">Yes, that's my understanding, from TianoCore#3256.</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">For native PE/COFF I think this is controlled by linker flags? For Xcode/clang it is controlled by the *_XCODE5_*_MTOC_FLAGS. So at this point it is kind of up to each toolchain how they want to deal with symbols on release builds.<span class="Apple-converted-space"> </span><br class=""><br class=""><br class="">It seems kind of strange to insert a section and then zero it. Almost seems like the intent of —zero was to post process compare images?<span class="Apple-converted-space"> </span><br class=""><br class=""> -z, --zero            Zero the Debug Data Fields in the PE input image file.<br class="">                       It also zeros the time stamp fields.<br class="">                       This option can be used to compare the binary efi image.<br class="">                       It can't be combined with other action options<br class="">                       except for -o, -r option. It is a action option.<br class="">                       If it is combined with other action options, the later<br class="">                       input action option will override the previous one.<br class=""><br class="">And in case you are going to ask our fork uses relative paths from the Build directory and/or a UUID string for the Debug Directory entry file name so it is a constant value and does not impact build reproducibility.<span class="Apple-converted-space"> </span><br class=""></blockquote><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">I'd like if we could satisfy both your use case and Ross's (Yocto's).</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">Until we have a technical solution for that, is it important that we</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">revert the patch upstream? (If it's urgent, I'm going to ask someone</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">else to do that, because I'll be back in April.)</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""></div></blockquote><div><br class=""></div><div>Laszlo,</div><div><br class=""></div><div>Per my other email about —keepexceptiontable it looks like source level debug is intertwined with GenFw flags that are global, and this has been going on for a long time. So I think I’ll just file a BZ about this issue in general and not ask for changes in this patch. </div><div><br class=""></div><div>Thanks,</div><div><br class=""></div><div>Andrew Fish</div><br class=""><blockquote type="cite" class=""><div class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">From a feature stand point this change will break any hope of source level debugging with RELEASE builds. I also think it changes the exception handler code output in OVMF [1] for ELF toolchains. You are going to get the (No PDB) vs. the file and path you were getting today. I assume if you had tools that natively produce PE/COFF and did not have a Debug Directory entry the same thing would happen prior to this change.<span class="Apple-converted-space"> </span><br class=""><br class="">   Status = PeCoffLoaderGetEntryPoint ((VOID *) Pe32Data, &EntryPoint);<br class="">   if (EFI_ERROR (Status)) {<br class="">     EntryPoint = NULL;<br class="">   }<br class="">   InternalPrintMessage ("!!!! Find image based on IP(0x%x) ", CurrentEip);<br class="">   PdbPointer = PeCoffLoaderGetPdbPointer ((VOID *) Pe32Data);<br class="">   if (PdbPointer != NULL) {<br class="">     InternalPrintMessage ("%a", PdbPointer);<br class="">   } else {<br class="">     InternalPrintMessage ("(No PDB) " );<br class="">   }<br class="">   InternalPrintMessage (<br class="">     " (ImageBase=%016lp, EntryPoint=%016p) !!!!\n",<br class="">     (VOID *) Pe32Data,<br class="">     EntryPoint<br class="">     );<br class=""><br class="">Not saying we have to "stop the presses", but just trying to point out the side effects of this change. It is not so much that this change is bad, but that we have no way to turn off the Debug Directory Entry for ELF conversion, so we seem to be working around that issue with a bigger hammer?<br class=""></blockquote><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">I don't have suggestions alas, but am open to any solution that works</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">for you and Ross both.</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">Thanks (and my apologies for breaking your process!),</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">Laszlo</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br class="">[1] <a href="https://github.com/tianocore/edk2/blob/master/UefiCpuPkg/Library/CpuExceptionHandlerLib/CpuExceptionCommon.c#L117" class="">https://github.com/tianocore/edk2/blob/master/UefiCpuPkg/Library/CpuExceptionHandlerLib/CpuExceptionCommon.c#L117</a><br class=""><br class="">Thanks,<br class=""><br class="">Andrew Fish<br class=""><br class=""><blockquote type="cite" class="">On Mar 24, 2021, at 4:58 AM, Ross Burton <<a href="mailto:ross@burtonini.com" class="">ross@burtonini.com</a>> wrote:<br class=""><br class="">GenFw will embed a NB10 section which contains the path to the input file,<br class="">which means the output files have build paths embedded in them.  To reduce<br class="">information leakage and ensure reproducible builds, pass --zero in release<br class="">builds to remove this information.<br class=""><br class="">Ref: <a href="https://bugzilla.tianocore.org/show_bug.cgi?id=3256" class="">https://bugzilla.tianocore.org/show_bug.cgi?id=3256</a><br class="">Signed-off-by: Ross Burton <<a href="mailto:ross.burton@arm.com" class="">ross.burton@arm.com</a>><br class="">---<br class="">OvmfPkg/AmdSev/AmdSevX64.dsc | 1 +<br class="">OvmfPkg/Bhyve/BhyveX64.dsc   | 1 +<br class="">OvmfPkg/OvmfPkgIa32.dsc      | 1 +<br class="">OvmfPkg/OvmfPkgIa32X64.dsc   | 1 +<br class="">OvmfPkg/OvmfPkgX64.dsc       | 1 +<br class="">OvmfPkg/OvmfXen.dsc          | 1 +<br class="">6 files changed, 6 insertions(+)<br class=""><br class="">diff --git a/OvmfPkg/AmdSev/AmdSevX64.dsc b/OvmfPkg/AmdSev/AmdSevX64.dsc<br class="">index 65c42284d9..69a05feea9 100644<br class="">--- a/OvmfPkg/AmdSev/AmdSevX64.dsc<br class="">+++ b/OvmfPkg/AmdSev/AmdSevX64.dsc<br class="">@@ -78,6 +78,7 @@<br class=""> GCC:*_*_X64_GENFW_FLAGS   = --keepexceptiontable<br class=""> INTEL:*_*_X64_GENFW_FLAGS = --keepexceptiontable<br class="">!endif<br class="">+  RELEASE_*_*_GENFW_FLAGS = --zero<br class=""><br class=""> #<br class=""> # Disable deprecated APIs.<br class="">diff --git a/OvmfPkg/Bhyve/BhyveX64.dsc b/OvmfPkg/Bhyve/BhyveX64.dsc<br class="">index 4a1cdf5aca..132f55cf69 100644<br class="">--- a/OvmfPkg/Bhyve/BhyveX64.dsc<br class="">+++ b/OvmfPkg/Bhyve/BhyveX64.dsc<br class="">@@ -76,6 +76,7 @@<br class=""> GCC:*_*_X64_GENFW_FLAGS   = --keepexceptiontable<br class=""> INTEL:*_*_X64_GENFW_FLAGS = --keepexceptiontable<br class="">!endif<br class="">+  RELEASE_*_*_GENFW_FLAGS = --zero<br class=""><br class=""> #<br class=""> # Disable deprecated APIs.<br class="">diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc<br class="">index 1eaf3e99c6..93c209950c 100644<br class="">--- a/OvmfPkg/OvmfPkgIa32.dsc<br class="">+++ b/OvmfPkg/OvmfPkgIa32.dsc<br class="">@@ -80,6 +80,7 @@<br class="">!if $(TOOL_CHAIN_TAG) != "XCODE5" && $(TOOL_CHAIN_TAG) != "CLANGPDB"<br class=""> GCC:*_*_*_CC_FLAGS                   = -mno-mmx -mno-sse<br class="">!endif<br class="">+  RELEASE_*_*_GENFW_FLAGS = --zero<br class=""><br class=""> #<br class=""> # Disable deprecated APIs.<br class="">diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc<br class="">index 4a5a430147..97cc438250 100644<br class="">--- a/OvmfPkg/OvmfPkgIa32X64.dsc<br class="">+++ b/OvmfPkg/OvmfPkgIa32X64.dsc<br class="">@@ -84,6 +84,7 @@<br class=""> GCC:*_*_X64_GENFW_FLAGS   = --keepexceptiontable<br class=""> INTEL:*_*_X64_GENFW_FLAGS = --keepexceptiontable<br class="">!endif<br class="">+  RELEASE_*_*_GENFW_FLAGS = --zero<br class=""><br class=""> #<br class=""> # Disable deprecated APIs.<br class="">diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc<br class="">index d4d601b444..f544fb04bf 100644<br class="">--- a/OvmfPkg/OvmfPkgX64.dsc<br class="">+++ b/OvmfPkg/OvmfPkgX64.dsc<br class="">@@ -84,6 +84,7 @@<br class=""> GCC:*_*_X64_GENFW_FLAGS   = --keepexceptiontable<br class=""> INTEL:*_*_X64_GENFW_FLAGS = --keepexceptiontable<br class="">!endif<br class="">+  RELEASE_*_*_GENFW_FLAGS = --zero<br class=""><br class=""> #<br class=""> # Disable deprecated APIs.<br class="">diff --git a/OvmfPkg/OvmfXen.dsc b/OvmfPkg/OvmfXen.dsc<br class="">index 507029404f..fcaa35acf1 100644<br class="">--- a/OvmfPkg/OvmfXen.dsc<br class="">+++ b/OvmfPkg/OvmfXen.dsc<br class="">@@ -74,6 +74,7 @@<br class=""> GCC:*_*_X64_GENFW_FLAGS   = --keepexceptiontable<br class=""> INTEL:*_*_X64_GENFW_FLAGS = --keepexceptiontable<br class="">!endif<br class="">+  RELEASE_*_*_GENFW_FLAGS = --zero<br class=""><br class=""> #<br class=""> # Disable deprecated APIs.<br class="">--<span class="Apple-converted-space"> </span><br class="">2.25.1<br class=""><br class=""><br class=""><br class=""></blockquote></blockquote></div></blockquote></div><br class=""></body></html>


 <div width="1" style="color:white;clear:both">_._,_._,_</div> <hr> Groups.io Links:<p>   You receive all messages sent to this group.    <p> <a target="_blank" href="https://edk2.groups.io/g/devel/message/73291">View/Reply Online (#73291)</a> |    |  <a target="_blank" href="https://groups.io/mt/81574493/1813853">Mute This Topic</a>  | <a href="https://edk2.groups.io/g/devel/post">New Topic</a><br>    <a href="https://edk2.groups.io/g/devel/editsub/1813853">Your Subscription</a> | <a href="mailto:devel+owner@edk2.groups.io">Contact Group Owner</a> |  <a href="https://edk2.groups.io/g/devel/unsub">Unsubscribe</a>  [edk2-devel-archive@redhat.com]<br> <div width="1" style="color:white;clear:both">_._,_._,_</div>