<div dir="ltr"><span style="font-size:12.8px">"portable" in the following sense:</span><div style="font-size:12.8px">for example, let's have a look at the binary "main".</div><div style="font-size:12.8px">The debug info (inside "main") contains dwarf::DW_AT_comp_dir with the absolute path</div><div style="font-size:12.8px">to the <build directory>, thus if you move this file to another machine this test can (likely will) fail.</div><div style="font-size:12.8px">That's what i meant by saying that out-of-the box this binary is not suitable for llvm tests.</div><div style="font-size:12.8px">Solution (unfortunately hacky) - replace the value of dwarf::DW_AT_comp_dir with the following string: ".////////".</div><div style="font-size:12.8px">For more details please take a look at the comments inside the newly added test.</div><div class="gmail-yj6qo gmail-ajU" style="font-size:12.8px"><div id="gmail-:we" class="gmail-ajR" tabindex="0"><img class="gmail-ajT" src="https://ssl.gstatic.com/ui/v1/icons/mail/images/cleardot.gif" style="opacity: 0.3;"></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Sep 1, 2017 at 10:11 PM, David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><br><div class="gmail_quote"><span class=""><div dir="ltr">On Fri, Sep 1, 2017 at 9:59 PM Alexander Shaposhnikov via Phabricator <<a href="mailto:reviews@reviews.llvm.org" target="_blank">reviews@reviews.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">alexshap updated this revision to Diff 113642.<br>
alexshap added a comment.<br>
<br>
Update the binaries used by the test and document the hack used to generate "portable" binaries.<br></blockquote></span><div><br>Why do they need to be portable? (I guess the original DWP tests that just consume DWOs are portable already - because they're all ELF files, but no executable code, etc - but now the executable has to be read? But does it matter what target the executable is for if it's still ELF?)<br> </div><span class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
I have not committed this diff yet and will keep this open for some time since the problem with the test<br>
might be of independent interest.<br>
Notes:<br>
<br>
1. obj2yaml + sed + yaml2obj doesn't seem to be an option at this point<br>
<br>
(we need to edit the debug info, obj2yaml dumps dwarf just as hex).<br>
<br>
2. running the compiler + linker doesn't seem to be an option (since this is an llvm test).<br>
3. the approach chosen below (while being hacky) only requires some efforts at the data preparation step and is quite simple,<br>
<br>
thus it seems to be the smaller evil than other options are,<br>
however i assume i could have missed something.<br>
<br>
<br>
Repository:<br>
  rL LLVM<br>
<br>
<a href="https://reviews.llvm.org/D37371" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D37371</a><br>
<br>
Files:<br>
  test/tools/llvm-dwp/Inputs/<wbr>dwos_list_from_exec/a.dwo<br>
  test/tools/llvm-dwp/Inputs/<wbr>dwos_list_from_exec/b.dwo<br>
  test/tools/llvm-dwp/Inputs/<wbr>dwos_list_from_exec/c.dwo<br>
  test/tools/llvm-dwp/Inputs/<wbr>dwos_list_from_exec/d.dwo<br>
  test/tools/llvm-dwp/Inputs/<wbr>dwos_list_from_exec/e.dwo<br>
  test/tools/llvm-dwp/Inputs/<wbr>dwos_list_from_exec/main<br>
  test/tools/llvm-dwp/X86/dwos_<wbr>list_from_exec_simple.test<br>
  tools/llvm-dwp/llvm-dwp.cpp<br>
<br>
</blockquote></span></div></div>
</blockquote></div><br></div>