Peter Collingbourne | eee71ae | 2013-08-07 22:47:26 +0000 | [diff] [blame^] | 1 | include_directories(..) |
| 2 | |
| 3 | # Runtime library sources and build flags. |
| 4 | set(DFSAN_RTL_SOURCES |
| 5 | dfsan.cc |
| 6 | ) |
| 7 | set(DFSAN_RTL_CFLAGS |
| 8 | ${SANITIZER_COMMON_CFLAGS} |
| 9 | # Prevent clang from generating libc calls. |
| 10 | -ffreestanding) |
| 11 | |
| 12 | # Static runtime library. |
| 13 | set(DFSAN_RUNTIME_LIBRARIES) |
| 14 | set(arch "x86_64") |
| 15 | if(CAN_TARGET_${arch}) |
| 16 | add_compiler_rt_static_runtime(clang_rt.dfsan-${arch} ${arch} |
| 17 | SOURCES ${DFSAN_RTL_SOURCES} |
| 18 | $<TARGET_OBJECTS:RTInterception.${arch}> |
| 19 | $<TARGET_OBJECTS:RTSanitizerCommon.${arch}> |
| 20 | $<TARGET_OBJECTS:RTSanitizerCommonLibc.${arch}> |
| 21 | CFLAGS ${DFSAN_RTL_CFLAGS} -fPIE) |
| 22 | add_compiler_rt_static_runtime(clang_rt.dfsan-libc-${arch} ${arch} |
| 23 | SOURCES ${DFSAN_RTL_SOURCES} |
| 24 | $<TARGET_OBJECTS:RTSanitizerCommon.${arch}> |
| 25 | CFLAGS ${DFSAN_RTL_CFLAGS} -fPIC -DDFSAN_NOLIBC) |
| 26 | list(APPEND DFSAN_RUNTIME_LIBRARIES clang_rt.dfsan-${arch}) |
| 27 | endif() |
| 28 | |
| 29 | add_subdirectory(lit_tests) |