[Mlir-commits] [mlir] [MLIR, Python] Make it easy to run tests with ASan on mac (PR #115524)
Kasper Nielsen
llvmlistbot at llvm.org
Wed Nov 13 15:49:39 PST 2024
================
@@ -174,8 +252,25 @@ def add_runtime(name):
python_executable = config.python_executable
# Python configuration with sanitizer requires some magic preloading. This will only work on clang/linux.
# TODO: detect Darwin/Windows situation (or mark these tests as unsupported on these platforms).
-if "asan" in config.available_features and "Linux" in config.host_os:
- python_executable = f"LD_PRELOAD=$({config.host_cxx} -print-file-name=libclang_rt.asan-{config.host_arch}.so) {config.python_executable}"
+if "asan" in config.available_features:
+ if "Linux" in config.host_os:
+ python_executable = f"LD_PRELOAD=$({config.host_cxx} -print-file-name=libclang_rt.asan-{config.host_arch}.so) {config.python_executable}"
+ if "Darwin" in config.host_os:
+ real_python_executable = find_real_python_interpreter()
+ if real_python_executable:
+ python_executable = real_python_executable
+ # Ensure Python is not wrapped, for DYLD_INSERT_LIBRARIES to take effect
----------------
kasper0406 wrote:
Thanks, I moved the comment up, and made it a bit more clear.
In addition I improved the code finding the ASan RT lib, so it also works for custom llvm installations (such as through brew), and not just the bundled one with osx Xcode tools.
https://github.com/llvm/llvm-project/pull/115524
More information about the Mlir-commits
mailing list