[all-commits] [llvm/llvm-project] beff2b: [MLIR, Python] Make it easy to run tests with ASan...

Kasper Nielsen via All-commits all-commits at lists.llvm.org
Fri Nov 22 16:34:25 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: beff2bacae76fe25c86c5bf7bccb2cbef93de047
      https://github.com/llvm/llvm-project/commit/beff2bacae76fe25c86c5bf7bccb2cbef93de047
  Author: Kasper Nielsen <kasper0406 at gmail.com>
  Date:   2024-11-23 (Sat, 23 Nov 2024)

  Changed paths:
    A mlir/test/get_darwin_real_python.py
    M mlir/test/lit.cfg.py

  Log Message:
  -----------
  [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.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list