diff options
author | Alexey Samsonov <vonosmas@gmail.com> | 2015-04-01 23:00:02 +0000 |
---|---|---|
committer | Alexey Samsonov <vonosmas@gmail.com> | 2015-04-01 23:00:02 +0000 |
commit | 5b3ffc514a5ca6389e0c3f78da42ebfc99eb7def (patch) | |
tree | f4c2777fc13342a1fa9c403ca354811567c161a8 /lib/ubsan | |
parent | b05184a2968adf141d964bee0852a849e79f4181 (diff) | |
download | compiler-rt-5b3ffc514a5ca6389e0c3f78da42ebfc99eb7def.tar.gz |
[CMake] Fixup for r233861: don't build standalone UBSan on unsupported platforms.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@233865 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ubsan')
-rw-r--r-- | lib/ubsan/CMakeLists.txt | 52 |
1 files changed, 27 insertions, 25 deletions
diff --git a/lib/ubsan/CMakeLists.txt b/lib/ubsan/CMakeLists.txt index 4ea0f5067..08bb739e5 100644 --- a/lib/ubsan/CMakeLists.txt +++ b/lib/ubsan/CMakeLists.txt @@ -35,7 +35,7 @@ if(APPLE) SOURCES ${UBSAN_SOURCES} ${UBSAN_CXX_SOURCES} CFLAGS ${UBSAN_CXXFLAGS}) - if(UBSAN_SUPPORTED_ARCH) + if(COMPILER_RT_HAS_UBSAN) # Initializer of standalone UBSan runtime. add_compiler_rt_darwin_object_library(RTUbsan_standalone ${os} ARCH ${UBSAN_SUPPORTED_ARCH} @@ -61,33 +61,35 @@ else() SOURCES ${UBSAN_CXX_SOURCES} CFLAGS ${UBSAN_CXXFLAGS}) endforeach() - foreach(arch ${UBSAN_SUPPORTED_ARCH}) - # Initializer of standalone UBSan runtime. - add_compiler_rt_object_library(RTUbsan_standalone ${arch} - SOURCES ${UBSAN_STANDALONE_SOURCES} CFLAGS ${UBSAN_STANDALONE_CFLAGS}) + if(COMPILER_RT_HAS_UBSAN) + foreach(arch ${UBSAN_SUPPORTED_ARCH}) + # Initializer of standalone UBSan runtime. + add_compiler_rt_object_library(RTUbsan_standalone ${arch} + SOURCES ${UBSAN_STANDALONE_SOURCES} CFLAGS ${UBSAN_STANDALONE_CFLAGS}) - # Standalone UBSan runtimes. - add_compiler_rt_runtime(clang_rt.ubsan_standalone-${arch} ${arch} STATIC - SOURCES $<TARGET_OBJECTS:RTSanitizerCommon.${arch}> - $<TARGET_OBJECTS:RTSanitizerCommonLibc.${arch}> - $<TARGET_OBJECTS:RTUbsan.${arch}> - $<TARGET_OBJECTS:RTUbsan_standalone.${arch}> - CFLAGS ${UBSAN_CFLAGS}) - add_compiler_rt_runtime(clang_rt.ubsan_standalone_cxx-${arch} ${arch} STATIC - SOURCES $<TARGET_OBJECTS:RTUbsan_cxx.${arch}> - CFLAGS ${UBSAN_CXXFLAGS}) + # Standalone UBSan runtimes. + add_compiler_rt_runtime(clang_rt.ubsan_standalone-${arch} ${arch} STATIC + SOURCES $<TARGET_OBJECTS:RTSanitizerCommon.${arch}> + $<TARGET_OBJECTS:RTSanitizerCommonLibc.${arch}> + $<TARGET_OBJECTS:RTUbsan.${arch}> + $<TARGET_OBJECTS:RTUbsan_standalone.${arch}> + CFLAGS ${UBSAN_CFLAGS}) + add_compiler_rt_runtime(clang_rt.ubsan_standalone_cxx-${arch} ${arch} STATIC + SOURCES $<TARGET_OBJECTS:RTUbsan_cxx.${arch}> + CFLAGS ${UBSAN_CXXFLAGS}) - add_dependencies(ubsan - clang_rt.ubsan_standalone-${arch} - clang_rt.ubsan_standalone_cxx-${arch}) - if (UNIX AND NOT ${arch} MATCHES "i386|i686") - add_sanitizer_rt_symbols(clang_rt.ubsan_standalone-${arch} ubsan.syms.extra) - add_sanitizer_rt_symbols(clang_rt.ubsan_standalone_cxx-${arch} ubsan.syms.extra) add_dependencies(ubsan - clang_rt.ubsan_standalone-${arch}-symbols - clang_rt.ubsan_standalone_cxx-${arch}-symbols) - endif() - endforeach() + clang_rt.ubsan_standalone-${arch} + clang_rt.ubsan_standalone_cxx-${arch}) + if (UNIX AND NOT ${arch} MATCHES "i386|i686") + add_sanitizer_rt_symbols(clang_rt.ubsan_standalone-${arch} ubsan.syms.extra) + add_sanitizer_rt_symbols(clang_rt.ubsan_standalone_cxx-${arch} ubsan.syms.extra) + add_dependencies(ubsan + clang_rt.ubsan_standalone-${arch}-symbols + clang_rt.ubsan_standalone_cxx-${arch}-symbols) + endif() + endforeach() + endif() endif() add_dependencies(compiler-rt ubsan) |