summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
Diffstat (limited to 'llvm')
-rw-r--r--llvm/cmake/modules/AddLLVM.cmake12
1 files changed, 10 insertions, 2 deletions
diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake
index cb4171c9bc8..7f7608cff33 100644
--- a/llvm/cmake/modules/AddLLVM.cmake
+++ b/llvm/cmake/modules/AddLLVM.cmake
@@ -1387,7 +1387,11 @@ function(llvm_externalize_debuginfo name)
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 @@ function(llvm_externalize_debuginfo name)
${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()
OpenPOWER on IntegriCloud