[PATCH] D28575: [CMake] Support externalizing debug info on non-Darwin platforms

Petr Hosek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 9 16:48:46 PST 2017


phosek updated this revision to Diff 87916.
phosek marked 2 inline comments as done.

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,10 @@
       ${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}>.dbg
+      ${strip_command}
+      )
   endif()
 endfunction()
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D28575.87916.patch
Type: text/x-patch
Size: 898 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170210/7a904277/attachment.bin>


More information about the llvm-commits mailing list