mirror of
https://github.com/zeek/zeek.git
synced 2025-10-13 20:18:20 +00:00
Merge remote-tracking branch 'origin/topic/timw/surface-better-sanitizer-flag-error'
* origin/topic/timw/surface-better-sanitizer-flag-error: Surface a better CMake error if the user passes an invalid sanitizer name
This commit is contained in:
commit
ea57cac871
3 changed files with 17 additions and 1 deletions
4
CHANGES
4
CHANGES
|
@ -1,3 +1,7 @@
|
||||||
|
5.2.0-dev.105 | 2022-10-17 08:48:20 -0700
|
||||||
|
|
||||||
|
* Surface a better CMake error if the user passes an invalid sanitizer name (Tim Wojtulewicz, Corelight)
|
||||||
|
|
||||||
5.2.0-dev.103 | 2022-10-16 17:49:24 -0700
|
5.2.0-dev.103 | 2022-10-16 17:49:24 -0700
|
||||||
|
|
||||||
* plugins: Reject dynamic plugins matching names of built-in ones (Arne Welzel, Corelight)
|
* plugins: Reject dynamic plugins matching names of built-in ones (Arne Welzel, Corelight)
|
||||||
|
|
|
@ -235,6 +235,18 @@ if ( ZEEK_SANITIZERS )
|
||||||
|
|
||||||
set(_sanitizer_flags "-fsanitize=${ZEEK_SANITIZERS}")
|
set(_sanitizer_flags "-fsanitize=${ZEEK_SANITIZERS}")
|
||||||
|
|
||||||
|
# The linker command used by check_cxx_compiler_flag requires you to also pass the sanitizer to
|
||||||
|
# it or it fails. The best way to do this is to set CMAKE_REQUIRED_LINK_OPTIONS, but save off a
|
||||||
|
# copy of it so it can be reset back to what it was previously afterwards.
|
||||||
|
set(_temp_link_options ${CMAKE_REQUIRED_LINK_OPTIONS})
|
||||||
|
list(APPEND CMAKE_REQUIRED_LINK_OPTIONS ${_sanitizer_flags})
|
||||||
|
include(CheckCXXCompilerFlag)
|
||||||
|
check_cxx_compiler_flag(${_sanitizer_flags} COMPILER_SUPPORTS_SANITIZERS)
|
||||||
|
if ( NOT COMPILER_SUPPORTS_SANITIZERS )
|
||||||
|
message(FATAL_ERROR "Invalid sanitizer compiler flags: ${_sanitizer_flags}")
|
||||||
|
endif()
|
||||||
|
set(CMAKE_REQUIRED_LINK_OPTIONS ${_temp_link_options})
|
||||||
|
|
||||||
if ( ZEEK_SANITIZER_UB_CHECKS )
|
if ( ZEEK_SANITIZER_UB_CHECKS )
|
||||||
set(_sanitizer_flags "${_sanitizer_flags} -fno-sanitize-recover=${ZEEK_SANITIZER_UB_CHECKS}")
|
set(_sanitizer_flags "${_sanitizer_flags} -fno-sanitize-recover=${ZEEK_SANITIZER_UB_CHECKS}")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
||||||
5.2.0-dev.103
|
5.2.0-dev.105
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue