summaryrefslogtreecommitdiffstats
path: root/compiler-rt/cmake/Modules/AddCompilerRT.cmake
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2013-03-23 00:31:07 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2013-03-23 00:31:07 +0000
commitc91e327cba6435bc7078e4abbf9fbb63754b8dec (patch)
tree8602292828158c251f7f3b211b11f77555e3b927 /compiler-rt/cmake/Modules/AddCompilerRT.cmake
parentf3e624ca73b007552554b31358f4abde9eb2d3b7 (diff)
downloadbcm5719-llvm-c91e327cba6435bc7078e4abbf9fbb63754b8dec.tar.gz
bcm5719-llvm-c91e327cba6435bc7078e4abbf9fbb63754b8dec.zip
Build and install .syms files alongside sanitizer runtimes. These are used to
specify which symbols are exported to DSOs when the sanitizer is statically linked into a binary. llvm-svn: 177784
Diffstat (limited to 'compiler-rt/cmake/Modules/AddCompilerRT.cmake')
-rw-r--r--compiler-rt/cmake/Modules/AddCompilerRT.cmake12
1 files changed, 10 insertions, 2 deletions
diff --git a/compiler-rt/cmake/Modules/AddCompilerRT.cmake b/compiler-rt/cmake/Modules/AddCompilerRT.cmake
index 742d81f9ab0..c261d10453e 100644
--- a/compiler-rt/cmake/Modules/AddCompilerRT.cmake
+++ b/compiler-rt/cmake/Modules/AddCompilerRT.cmake
@@ -36,10 +36,11 @@ endmacro()
# add_compiler_rt_static_runtime(<name> <arch>
# SOURCES <source files>
# CFLAGS <compile flags>
-# DEFS <compile definitions>)
+# DEFS <compile definitions>
+# SYMS <symbols file>)
macro(add_compiler_rt_static_runtime name arch)
if(CAN_TARGET_${arch})
- parse_arguments(LIB "SOURCES;CFLAGS;DEFS" "" ${ARGN})
+ parse_arguments(LIB "SOURCES;CFLAGS;DEFS;SYMS" "" ${ARGN})
add_library(${name} STATIC ${LIB_SOURCES})
# Setup compile flags and definitions.
set_target_compile_flags(${name}
@@ -52,6 +53,13 @@ macro(add_compiler_rt_static_runtime name arch)
# Add installation command.
install(TARGETS ${name}
ARCHIVE DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR})
+ # Generate the .syms file if possible.
+ if(LIB_SYMS)
+ get_target_property(libfile ${name} LOCATION)
+ configure_file(${LIB_SYMS} ${libfile}.syms)
+ install(FILES ${libfile}.syms
+ DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR})
+ endif(LIB_SYMS)
else()
message(FATAL_ERROR "Archtecture ${arch} can't be targeted")
endif()
OpenPOWER on IntegriCloud