2017-04-11 21:45:05 +08:00
|
|
|
if (COMPILER_RT_BUILD_SANITIZERS)
|
|
|
|
set(SANITIZER_HEADERS
|
|
|
|
sanitizer/allocator_interface.h
|
|
|
|
sanitizer/asan_interface.h
|
|
|
|
sanitizer/common_interface_defs.h
|
|
|
|
sanitizer/coverage_interface.h
|
|
|
|
sanitizer/dfsan_interface.h
|
|
|
|
sanitizer/esan_interface.h
|
2017-12-09 09:31:51 +08:00
|
|
|
sanitizer/hwasan_interface.h
|
2017-04-11 21:45:05 +08:00
|
|
|
sanitizer/linux_syscall_hooks.h
|
|
|
|
sanitizer/lsan_interface.h
|
|
|
|
sanitizer/msan_interface.h
|
Add NetBSD syscall hooks skeleton in sanitizers
Summary:
Implement the skeleton of NetBSD syscall hooks for use with sanitizers.
Add a script that generates the rules to handle syscalls
on NetBSD: generate_netbsd_syscalls.awk. It has been written
in NetBSD awk(1) (patched nawk) and is compatible with gawk.
Generate lib/sanitizer_common/sanitizer_platform_limits_netbsd.h
that is a public header for applications, and included as:
<sanitizer_common/sanitizer_platform_limits_netbsd.h>.
Generate sanitizer_syscalls_netbsd.inc that defines all the
syscall rules for NetBSD. This file is modeled after the Linux
specific file: sanitizer_common_syscalls.inc.
Start recognizing NetBSD syscalls with existing sanitizers:
ASan, ESan, HWASan, TSan, MSan.
Sponsored by <The NetBSD Foundation>
Reviewers: joerg, vitalybuka, kcc, dvyukov, eugenis
Reviewed By: vitalybuka
Subscribers: hintonda, kubamracek, mgorny, llvm-commits, #sanitizers
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D42048
llvm-svn: 325206
2018-02-15 10:43:02 +08:00
|
|
|
sanitizer/netbsd_syscall_hooks.h
|
2017-12-14 04:41:35 +08:00
|
|
|
sanitizer/scudo_interface.h
|
2017-04-11 21:45:05 +08:00
|
|
|
sanitizer/tsan_interface.h
|
|
|
|
sanitizer/tsan_interface_atomic.h)
|
|
|
|
endif(COMPILER_RT_BUILD_SANITIZERS)
|
2013-04-11 23:49:52 +08:00
|
|
|
|
2017-04-11 21:45:05 +08:00
|
|
|
if (COMPILER_RT_BUILD_XRAY)
|
|
|
|
set(XRAY_HEADERS
|
|
|
|
xray/xray_interface.h
|
|
|
|
xray/xray_log_interface.h)
|
|
|
|
endif(COMPILER_RT_BUILD_XRAY)
|
2016-07-21 15:39:55 +08:00
|
|
|
|
|
|
|
set(COMPILER_RT_HEADERS
|
|
|
|
${SANITIZER_HEADERS}
|
2017-12-15 21:20:13 +08:00
|
|
|
${XRAY_HEADERS})
|
2016-07-21 15:39:55 +08:00
|
|
|
|
2014-02-18 22:28:53 +08:00
|
|
|
set(output_dir ${COMPILER_RT_OUTPUT_DIR}/include)
|
2013-04-11 23:49:52 +08:00
|
|
|
|
|
|
|
# Copy compiler-rt headers to the build tree.
|
|
|
|
set(out_files)
|
2016-07-21 15:39:55 +08:00
|
|
|
foreach( f ${COMPILER_RT_HEADERS} )
|
2013-04-11 23:49:52 +08:00
|
|
|
set( src ${CMAKE_CURRENT_SOURCE_DIR}/${f} )
|
|
|
|
set( dst ${output_dir}/${f} )
|
|
|
|
add_custom_command(OUTPUT ${dst}
|
|
|
|
DEPENDS ${src}
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst}
|
|
|
|
COMMENT "Copying compiler-rt's ${f}...")
|
|
|
|
list(APPEND out_files ${dst})
|
|
|
|
endforeach( f )
|
|
|
|
|
|
|
|
add_custom_target(compiler-rt-headers ALL DEPENDS ${out_files})
|
2013-11-18 18:57:36 +08:00
|
|
|
add_dependencies(compiler-rt compiler-rt-headers)
|
2016-07-12 05:51:56 +08:00
|
|
|
set_target_properties(compiler-rt-headers PROPERTIES FOLDER "Compiler-RT Misc")
|
2013-04-11 23:49:52 +08:00
|
|
|
|
|
|
|
# Install sanitizer headers.
|
|
|
|
install(FILES ${SANITIZER_HEADERS}
|
2017-12-15 21:20:13 +08:00
|
|
|
COMPONENT compiler-rt-headers
|
2013-04-11 23:49:52 +08:00
|
|
|
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
|
2014-02-18 22:28:53 +08:00
|
|
|
DESTINATION ${COMPILER_RT_INSTALL_PATH}/include/sanitizer)
|
2016-07-21 15:39:55 +08:00
|
|
|
# Install xray headers.
|
|
|
|
install(FILES ${XRAY_HEADERS}
|
2017-12-15 21:20:13 +08:00
|
|
|
COMPONENT compiler-rt-headers
|
2016-07-21 15:39:55 +08:00
|
|
|
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
|
|
|
|
DESTINATION ${COMPILER_RT_INSTALL_PATH}/include/xray)
|
2017-12-15 21:20:13 +08:00
|
|
|
|
|
|
|
if (NOT CMAKE_CONFIGURATION_TYPES) # don't add this for IDEs.
|
|
|
|
add_custom_target(install-compiler-rt-headers
|
|
|
|
DEPENDS compiler-rt-headers
|
|
|
|
COMMAND "${CMAKE_COMMAND}"
|
|
|
|
-DCMAKE_INSTALL_COMPONENT="compiler-rt-headers"
|
|
|
|
-P "${CMAKE_BINARY_DIR}/cmake_install.cmake"
|
|
|
|
USES_TERMINAL)
|
|
|
|
add_custom_target(install-compiler-rt-headers-stripped
|
|
|
|
DEPENDS compiler-rt-headers
|
|
|
|
COMMAND "${CMAKE_COMMAND}"
|
|
|
|
-DCMAKE_INSTALL_COMPONENT="compiler-rt-headers"
|
|
|
|
-DCMAKE_INSTALL_DO_STRIP=1
|
|
|
|
-P "${CMAKE_BINARY_DIR}/cmake_install.cmake"
|
|
|
|
USES_TERMINAL)
|
|
|
|
endif()
|