| #
beff2bac |
| 23-Nov-2024 |
Kasper Nielsen <kasper0406@gmail.com> |
[MLIR, Python] Make it easy to run tests with ASan on mac (#115524)
There are two things that make running MLIR tests with ASan on a mac tedious:
1. The `DYLD_INSERT_LIBRARIES` environment variable
[MLIR, Python] Make it easy to run tests with ASan on mac (#115524)
There are two things that make running MLIR tests with ASan on a mac tedious:
1. The `DYLD_INSERT_LIBRARIES` environment variable needs to be set to point to `libclang_rt.asan_osx_dynamic.dylib` 2. Mac is wrapping Python, which means that the `DYLD_INSERT_LIBRARIES` environment variable is not being respected in the Python tests. The solution is to find and use a non-wrapped Python binary.
With the above two changes, ASan works out of the box on mac's by setting the `-DLLVM_USE_SANITIZER=Address` cmake flag.
I have stolen most of the code in this PR from other LLVM projects. It may be a good idea to reconcile it somewhere.
show more ...
|