[PATCH] D28575: [CMake] Support externalizing debug info on non-Darwin platforms
Petr Hosek via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 15 10:18:57 PST 2017
phosek updated this revision to Diff 88574.
Repository:
rL LLVM
https://reviews.llvm.org/D28575
Files:
cmake/modules/AddLLVM.cmake
Index: cmake/modules/AddLLVM.cmake
===================================================================
--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -1387,7 +1387,11 @@
endif()
if(NOT LLVM_EXTERNALIZE_DEBUGINFO_SKIP_STRIP)
- set(strip_command COMMAND xcrun strip -Sxl $<TARGET_FILE:${name}>)
+ if(APPLE)
+ set(strip_command COMMAND xcrun strip -Sxl $<TARGET_FILE:${name}>)
+ else()
+ set(strip_command COMMAND strip -gx $<TARGET_FILE:${name}>)
+ endif()
endif()
if(APPLE)
@@ -1403,7 +1407,11 @@
${strip_command}
)
else()
- message(FATAL_ERROR "LLVM_EXTERNALIZE_DEBUGINFO isn't implemented for non-darwin platforms!")
+ add_custom_command(TARGET ${name} POST_BUILD
+ COMMAND objcopy --only-keep-debug $<TARGET_FILE:${name}> $<TARGET_FILE:${name}>.debug
+ ${strip_command} -R .gnu_debuglink
+ COMMAND objcopy --add-gnu-debuglink=$<TARGET_FILE:${name}>.debug $<TARGET_FILE:${name}>
+ )
endif()
endfunction()
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D28575.88574.patch
Type: text/x-patch
Size: 1013 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170215/61961725/attachment.bin>
More information about the llvm-commits
mailing list