]> granicus.if.org Git - llvm/commit
[CMake] Support stripping and linking output to .build-id directory
authorPetr Hosek <phosek@chromium.org>
Sat, 9 Mar 2019 01:26:55 +0000 (01:26 +0000)
committerPetr Hosek <phosek@chromium.org>
Sat, 9 Mar 2019 01:26:55 +0000 (01:26 +0000)
commit308caddf916a4e1ac99b086a8d371738ec91f1de
treef2a80cd78ba70d6ea96f19fbaca36db16f288205
parent2473ad9be81f62834350baebac653a50f7fb7d20
[CMake] Support stripping and linking output to .build-id directory

When installing runtimes with install-runtimes-stripped, we don't want
to just strip them, we also want to preserve the debugging information
for potential debugging. To make it possible to later find the stripped
debugging information, we want to use the .build-id layout:

https://fedoraproject.org/wiki/RolandMcGrath/BuildID#Find_files_by_build_ID

That is, for libfoo.so with build ID abcdef1234, the debugging information
will be installed into lib/debug/.build-id/ab/cdef1234. llvm-objcopy
already has support for stripping files and linking the debugging
stripped output into the right location. However, CMake doesn't support
customizing strip invocation for the *-stripped targets. So instead, we
replace CMAKE_STRIP with a custom script that invokes llvm-objcopy with
the right command line flags.

Differential Revision: https://reviews.llvm.org/D59127

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355765 91177308-0d34-0410-b5e6-96231b3b80d8
cmake/modules/LLVMExternalProjectUtils.cmake
runtimes/CMakeLists.txt
runtimes/llvm-strip-link.in [new file with mode: 0755]