<div dir="ltr">Hi there - I'm not a CMake person, but a Clang/LLVM developer who helped in the implementation of Split DWARF in Clang/LLVM, so I know a bit about DWOs and DWPs, etc & thought I'd offer a few extra details...<br><br><div class="gmail_quote"><div dir="ltr">On Fri, Dec 21, 2018 at 3:39 AM David Jobet <<a href="mailto:djobet@tower-research.com">djobet@tower-research.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<br>
in order to speed up our link step, I wanted to experiment with split dwarf.<br>
See <a href="http://www.productive-cpp.com/improving-cpp-builds-with-split-dwarf/" rel="noreferrer" target="_blank">http://www.productive-cpp.com/improving-cpp-builds-with-split-dwarf/</a><br>
<br>
Adding the compilation flag is easy, but I'm stumbling on the installation step.<br>
In our current mode, we redirect the STRIP step to extract the symbols<br>
and strip the binary.<br></blockquote><div><br>When you say "symbols" - do you mean only debug info? Or other things (like the ELF symbol table (.symtab section) - since they're no longer needed if no one's calling into the binary (I guess maybe a symbol table that contains the entry point - 'main' would be needed? - this is the part of ELF I don't understand too well))<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">With split dwarf, I want to use 'dwp' to collect all .dwo files and<br>
assemble a symbol file. No need to strip I guess since symbols are<br>
already put elsewhere.<br></blockquote><div><br>Actually there's probably still a desire to strip the executable - Split DWARF leaves some debug info in the .o/executable (& at least the GNU extension form of Split DWARF available in DWARFv4 leaves quiet a bit in the .o/executable, especially in an optimized build, unfortunately) that you can benefit from stripping out - along with the non-debug-related symbol table, if that's a thing you're stripping (see above).<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">So I figure I would just use dwp as the strip command in my custom<br>
strip command.<br>
<br>
Problem is .dwo files are recorded in the .o files relative to the<br>
build directory and the strip command is executed on the installed<br>
directory.<br></blockquote><div><br>I think this depends on your build system - and might be resolvable relative to the comp_dir in the debug info remaining in the .o file? Though I haven't looked/checked closely (but yeah, moving debug info around when using Split DWARF is a bit tricky)<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
As a result, 'dwp' complains it cannot find the .dwo files.<br>
<br>
I don't want to add a POST_BUILD step on each our binaries (we have<br>
lots of binaries), and anyway I'd rather prefer to have the 'dwp' step<br>
executed at install time so it's executed only when we want to<br>
deliver.<br>
<br>
Is there a way to either<br>
- pass the build_dir to the strip command ?<br>
- define a custom step of the install process that would execute on<br>
the build dir previous to the install step itself ? (for the same<br>
reason I don't want to manually define a POST_BUILD step on each<br>
binaries, I don't want to manually define a custom INSTALL step that<br>
would precede the INSTALL step of all our binaries)<br>
- or another option ?<br>
<br>
With regards<br>
<br>
David<br>
-- <br>
<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" rel="noreferrer" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br>
<br>
CMake Support: <a href="http://cmake.org/cmake/help/support.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/training.html</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://cmake.org/mailman/listinfo/cmake" rel="noreferrer" target="_blank">https://cmake.org/mailman/listinfo/cmake</a><br>
</blockquote></div></div>