From e0d96abb16ecabf0e78b641361b0586b08e7c3f5 Mon Sep 17 00:00:00 2001 From: Lucas Colley Date: Sun, 9 Aug 2026 12:25:22 +0100 Subject: [PATCH 1/2] gh-155375: `-shared-libsan` for linux ASAN builds --- Tools/pixi-packages/build.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Tools/pixi-packages/build.sh b/Tools/pixi-packages/build.sh index b13e26d688e46a1..fecca0623e6b440 100644 --- a/Tools/pixi-packages/build.sh +++ b/Tools/pixi-packages/build.sh @@ -7,6 +7,9 @@ if [[ "${PYTHON_VARIANT}" == "freethreading" ]]; then elif [[ "${PYTHON_VARIANT}" == "asan" ]]; then CONFIGURE_EXTRA="--with-address-sanitizer" export ASAN_OPTIONS="strict_init_order=true" + if [[ "$target_platform" == linux-* ]]; then + export LDFLAGS="-shared-libsan $LDFLAGS" + fi elif [[ "${PYTHON_VARIANT}" == "tsan_freethreading" ]]; then CONFIGURE_EXTRA="--disable-gil --with-thread-sanitizer" export TSAN_OPTIONS="suppressions=${SRC_DIR}/Tools/tsan/suppressions_free_threading.txt" From 7febf22afacb8d59cd82b075604bbef0b36e0126 Mon Sep 17 00:00:00 2001 From: Lucas Colley Date: Mon, 24 Aug 2026 08:12:56 +0100 Subject: [PATCH 2/2] Update build.sh Co-authored-by: Isuru Fernando --- Tools/pixi-packages/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tools/pixi-packages/build.sh b/Tools/pixi-packages/build.sh index fecca0623e6b440..c9b6b5de1e4d036 100644 --- a/Tools/pixi-packages/build.sh +++ b/Tools/pixi-packages/build.sh @@ -7,7 +7,7 @@ if [[ "${PYTHON_VARIANT}" == "freethreading" ]]; then elif [[ "${PYTHON_VARIANT}" == "asan" ]]; then CONFIGURE_EXTRA="--with-address-sanitizer" export ASAN_OPTIONS="strict_init_order=true" - if [[ "$target_platform" == linux-* ]]; then + if [[ "$target_platform" == linux-* && "$c_compiler" == "clang" ]]; then export LDFLAGS="-shared-libsan $LDFLAGS" fi elif [[ "${PYTHON_VARIANT}" == "tsan_freethreading" ]]; then