Evgeniy Stepanov | 0231c50 | 2012-12-25 12:39:56 +0000 | [diff] [blame] | 1 | include_directories(..) |
Evgeniy Stepanov | 78c56c3 | 2012-12-11 12:27:27 +0000 | [diff] [blame] | 2 | |
Evgeniy Stepanov | 0231c50 | 2012-12-25 12:39:56 +0000 | [diff] [blame] | 3 | # Runtime library sources and build flags. |
| 4 | set(MSAN_RTL_SOURCES |
Evgeniy Stepanov | 78c56c3 | 2012-12-11 12:27:27 +0000 | [diff] [blame] | 5 | msan.cc |
| 6 | msan_allocator.cc |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 7 | msan_chained_origin_depot.cc |
Evgeniy Stepanov | 78c56c3 | 2012-12-11 12:27:27 +0000 | [diff] [blame] | 8 | msan_interceptors.cc |
| 9 | msan_linux.cc |
Evgeniy Stepanov | db010da | 2012-12-26 09:32:05 +0000 | [diff] [blame] | 10 | msan_report.cc |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 11 | msan_thread.cc |
Stephen Hines | 86277eb | 2015-03-23 12:06:32 -0700 | [diff] [blame] | 12 | msan_poisoning.cc |
Evgeniy Stepanov | 78c56c3 | 2012-12-11 12:27:27 +0000 | [diff] [blame] | 13 | ) |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 14 | |
Pirama Arumuga Nainar | cdce50b | 2015-07-01 12:26:56 -0700 | [diff] [blame] | 15 | set(MSAN_RTL_CXX_SOURCES |
| 16 | msan_new_delete.cc) |
| 17 | |
| 18 | |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 19 | set(MSAN_RTL_CFLAGS ${SANITIZER_COMMON_CFLAGS}) |
| 20 | append_no_rtti_flag(MSAN_RTL_CFLAGS) |
Stephen Hines | 6d18623 | 2014-11-26 17:56:19 -0800 | [diff] [blame] | 21 | append_list_if(COMPILER_RT_HAS_FPIE_FLAG -fPIE MSAN_RTL_CFLAGS) |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 22 | # Prevent clang from generating libc calls. |
Stephen Hines | 6d18623 | 2014-11-26 17:56:19 -0800 | [diff] [blame] | 23 | append_list_if(COMPILER_RT_HAS_FFREESTANDING_FLAG -ffreestanding MSAN_RTL_CFLAGS) |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 24 | |
| 25 | set(MSAN_RUNTIME_LIBRARIES) |
Evgeniy Stepanov | 78c56c3 | 2012-12-11 12:27:27 +0000 | [diff] [blame] | 26 | |
Evgeniy Stepanov | 0231c50 | 2012-12-25 12:39:56 +0000 | [diff] [blame] | 27 | # Static runtime library. |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 28 | add_custom_target(msan) |
Stephen Hines | 6d18623 | 2014-11-26 17:56:19 -0800 | [diff] [blame] | 29 | foreach(arch ${MSAN_SUPPORTED_ARCH}) |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 30 | add_compiler_rt_runtime(clang_rt.msan-${arch} ${arch} STATIC |
Alexey Samsonov | 7eca152 | 2013-01-20 14:14:13 +0000 | [diff] [blame] | 31 | SOURCES ${MSAN_RTL_SOURCES} |
| 32 | $<TARGET_OBJECTS:RTInterception.${arch}> |
| 33 | $<TARGET_OBJECTS:RTSanitizerCommon.${arch}> |
Peter Collingbourne | 0c547de | 2013-05-17 16:17:19 +0000 | [diff] [blame] | 34 | $<TARGET_OBJECTS:RTSanitizerCommonLibc.${arch}> |
Pirama Arumuga Nainar | cdce50b | 2015-07-01 12:26:56 -0700 | [diff] [blame] | 35 | $<TARGET_OBJECTS:RTUbsan.${arch}> |
Alexey Samsonov | e5fa243 | 2013-08-27 15:08:02 +0000 | [diff] [blame] | 36 | CFLAGS ${MSAN_RTL_CFLAGS}) |
Pirama Arumuga Nainar | cdce50b | 2015-07-01 12:26:56 -0700 | [diff] [blame] | 37 | add_compiler_rt_runtime(clang_rt.msan_cxx-${arch} ${arch} STATIC |
| 38 | SOURCES ${MSAN_RTL_CXX_SOURCES} |
| 39 | $<TARGET_OBJECTS:RTUbsan_cxx.${arch}> |
| 40 | CFLAGS ${MSAN_RTL_CFLAGS}) |
| 41 | add_dependencies(msan clang_rt.msan-${arch} |
| 42 | clang_rt.msan_cxx-${arch}) |
| 43 | list(APPEND MSAN_RUNTIME_LIBRARIES clang_rt.msan-${arch} |
| 44 | clang_rt.msan_cxx-${arch}) |
Alexey Samsonov | 544bdfb | 2013-08-28 08:07:04 +0000 | [diff] [blame] | 45 | if(UNIX) |
| 46 | add_sanitizer_rt_symbols(clang_rt.msan-${arch} msan.syms.extra) |
Pirama Arumuga Nainar | cdce50b | 2015-07-01 12:26:56 -0700 | [diff] [blame] | 47 | add_sanitizer_rt_symbols(clang_rt.msan_cxx-${arch} msan.syms.extra) |
| 48 | add_dependencies(msan clang_rt.msan-${arch}-symbols |
| 49 | clang_rt.msan_cxx-${arch}-symbols) |
Alexey Samsonov | 544bdfb | 2013-08-28 08:07:04 +0000 | [diff] [blame] | 50 | endif() |
Stephen Hines | 6d18623 | 2014-11-26 17:56:19 -0800 | [diff] [blame] | 51 | endforeach() |
Evgeniy Stepanov | 0231c50 | 2012-12-25 12:39:56 +0000 | [diff] [blame] | 52 | |
Alexey Samsonov | 4d1b383 | 2013-05-21 13:55:56 +0000 | [diff] [blame] | 53 | add_compiler_rt_resource_file(msan_blacklist msan_blacklist.txt) |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 54 | add_dependencies(msan msan_blacklist) |
| 55 | add_dependencies(compiler-rt msan) |
Alexey Samsonov | 4d1b383 | 2013-05-21 13:55:56 +0000 | [diff] [blame] | 56 | |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 57 | if(COMPILER_RT_INCLUDE_TESTS) |
Evgeniy Stepanov | 0231c50 | 2012-12-25 12:39:56 +0000 | [diff] [blame] | 58 | add_subdirectory(tests) |
| 59 | endif() |