mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-23 13:50:11 +00:00
[mlir] Don't use -z,defs on sanitizer builds
This works around link errors when building the python bindings with ASAN, since the ASAN run-time doesn't get linked into shared libraries. The ASAN docs specficially call out -z,defs as a potential issue: https://clang.llvm.org/docs/AddressSanitizer.html#usage closes https://github.com/llvm/llvm-project/issues/60565 Reviewed By: stellaraccident, mehdi_amini Differential Revision: https://reviews.llvm.org/D145956
This commit is contained in:
parent
4e901cda72
commit
87296fd3c1
@ -495,7 +495,9 @@ function(add_mlir_aggregate name)
|
||||
# many other platforms are more strict. We want these libraries to be
|
||||
# self contained, and we want any undefined symbols to be reported at
|
||||
# library construction time, not at library use, so make Linux strict too.
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
# We make an exception for sanitizer builds, since the AddressSanitizer
|
||||
# run-time doesn't get linked into shared libraries.
|
||||
if((CMAKE_SYSTEM_NAME STREQUAL "Linux") AND (NOT LLVM_USE_SANITIZER))
|
||||
target_link_options(${name} PRIVATE
|
||||
"LINKER:-z,defs"
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user