[mlir] Don't use -z,defs on sanitizer builds
authorRahul Kayaith <rkayaith@gmail.com>
Mon, 13 Mar 2023 16:42:25 +0000 (12:42 -0400)
committerRahul Kayaith <rkayaith@gmail.com>
Mon, 13 Mar 2023 18:04:31 +0000 (14:04 -0400)
commit87296fd3c1c5f8d20be017b3b1295ffbf7bf8e0d
tree8e696e69e8dce48837a0fae10e99eaac256c7fe9
parent4e901cda725b5adbdfeb495607fda9a2f84128c8
[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
mlir/cmake/modules/AddMLIR.cmake