Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

asan: replace used python in mlir lit.cfg with shim script #436

Merged
merged 3 commits into from
Jan 7, 2025

Conversation

philippjh
Copy link
Member

@philippjh philippjh commented Jan 6, 2025

This PR exchanges the used Python executable inside the MLIR LIT test suite, when the build is configured for utilizing ASan. The executable is replaced with a shim script, which preloads the necessary ASan shared object file as it did before, but additionally exhibits two benefits:

  1. Provide full support for LLVM's test utils like not, which are prepended to the original statement containing the LD_PRELOAD env definition. Having environment definitions in the middle of a command line is syntactically illegal.
  2. Mitigate issues with LIT's internal shell that puts single quotes around the environment definition, which leads to malformed command lines: LD_PRELOAD=$(/usr/bin/clang++-17' '-print-file-name=libclang_rt.asan-x86_64.so)' python (...)
    • The problem might be circumvented by disabling the LIT's internal shell through updating the environment with LIT_USE_INTERNAL_SHELL=0, but might not be desired for compatibility/stability reasons.

@philippjh philippjh force-pushed the philippjh.fix-asan-lit branch from acd9991 to ed3a469 Compare January 6, 2025 21:33
@philippjh philippjh merged commit c6d34c5 into feature/fused-ops Jan 7, 2025
4 checks passed
@philippjh philippjh deleted the philippjh.fix-asan-lit branch January 7, 2025 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants