Skip to content

Commit

Permalink
adjust chapel-py's setup script, and run-in-venv script to allow it t…
Browse files Browse the repository at this point in the history
…o be built when Chapel is configured for asan (on linux)

Signed-off-by: Jeremiah Corrado <[email protected]>
  • Loading branch information
jeremiah-corrado committed Oct 7, 2024
1 parent bd617ec commit 1e4d035
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tools/chapel-py/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@
chpl_lib_path,
]

if str(chpl_variables.get("CHPL_SANITIZE")) == "address":
CXXFLAGS += ["-fsanitize=address"]
LDFLAGS += ["-fsanitize=address"]

os.environ["CC"] = host_cc
os.environ["CXX"] = host_cxx
setup(
Expand Down
4 changes: 4 additions & 0 deletions util/config/run-in-venv-with-python-bindings.bash
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,8 @@ if [ ! -d "$chpl_frontend_py_deps/chapel" ]; then
exit 1
fi

if [ "$CHPL_SANITIZE" == "address" ]; then
export LD_PRELOAD=$(gcc -print-file-name=libasan.so)
fi

exec "$1" "${@:2}"

0 comments on commit 1e4d035

Please sign in to comment.