From 0fd93073c26b87a29ef76c36c7015f3116676610 Mon Sep 17 00:00:00 2001 From: Koi Date: Fri, 30 Oct 2026 23:16:59 -0400 Subject: [PATCH 1/2] gh-150467: Fix linking python3.dll and python3t.dll with ASan on Windows The stable ABI forwarder DLLs are linked with /NOENTRY, so nothing pulls in the CRT. With AddressSanitizer enabled, the linker adds the ASan runtime thunk library, which needs the CRT, and the link fails with unresolved symbols. Keep the default CRT entry point for these DLLs when building with ASan. --- .../Build/2026-10-30-23-16-35.gh-issue-150467.qMGY7M.rst | 2 ++ PCbuild/pyproject.props | 8 ++++++++ PCbuild/python3dll.vcxproj | 6 +++++- PCbuild/python3tdll.vcxproj | 6 +++++- 4 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 Misc/NEWS.d/next/Build/2026-10-30-23-16-35.gh-issue-150467.qMGY7M.rst diff --git a/Misc/NEWS.d/next/Build/2026-10-30-23-16-35.gh-issue-150467.qMGY7M.rst b/Misc/NEWS.d/next/Build/2026-10-30-23-16-35.gh-issue-150467.qMGY7M.rst new file mode 100644 index 000000000000000..c1d63934f80a6ed --- /dev/null +++ b/Misc/NEWS.d/next/Build/2026-10-30-23-16-35.gh-issue-150467.qMGY7M.rst @@ -0,0 +1,2 @@ +Fix linking ``python3.dll`` and ``python3t.dll`` on Windows when building with +AddressSanitizer. diff --git a/PCbuild/pyproject.props b/PCbuild/pyproject.props index ca8330c004cccea..8e4f7dd8bebf778 100644 --- a/PCbuild/pyproject.props +++ b/PCbuild/pyproject.props @@ -25,6 +25,14 @@ false false false + + + true + true + true diff --git a/PCbuild/python3dll.vcxproj b/PCbuild/python3dll.vcxproj index 3d8ac1b23532c1d..604e75073e1d662 100644 --- a/PCbuild/python3dll.vcxproj +++ b/PCbuild/python3dll.vcxproj @@ -95,7 +95,11 @@ false - true + + true diff --git a/PCbuild/python3tdll.vcxproj b/PCbuild/python3tdll.vcxproj index 796712cca3146c4..49a123c1cf89631 100644 --- a/PCbuild/python3tdll.vcxproj +++ b/PCbuild/python3tdll.vcxproj @@ -95,7 +95,11 @@ false - true + + true From d04b81a9ee02eae2a09e2bee186247c26afbcfa4 Mon Sep 17 00:00:00 2001 From: Koi Date: Sat, 31 Oct 2026 10:59:04 -0400 Subject: [PATCH 2/2] Drive the python3 DLL entry point from EnableASAN only --- PCbuild/pyproject.props | 8 -------- PCbuild/python3dll.vcxproj | 2 +- PCbuild/python3tdll.vcxproj | 2 +- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/PCbuild/pyproject.props b/PCbuild/pyproject.props index 8e4f7dd8bebf778..ca8330c004cccea 100644 --- a/PCbuild/pyproject.props +++ b/PCbuild/pyproject.props @@ -25,14 +25,6 @@ false false false - - - true - true - true diff --git a/PCbuild/python3dll.vcxproj b/PCbuild/python3dll.vcxproj index 604e75073e1d662..f6f1d0d8f95ed96 100644 --- a/PCbuild/python3dll.vcxproj +++ b/PCbuild/python3dll.vcxproj @@ -99,7 +99,7 @@ The ASan runtime thunks need the CRT to be initialized, so keep the default entry point when building with AddressSanitizer. --> - true + true diff --git a/PCbuild/python3tdll.vcxproj b/PCbuild/python3tdll.vcxproj index 49a123c1cf89631..9ccc71ce4a40a81 100644 --- a/PCbuild/python3tdll.vcxproj +++ b/PCbuild/python3tdll.vcxproj @@ -99,7 +99,7 @@ The ASan runtime thunks need the CRT to be initialized, so keep the default entry point when building with AddressSanitizer. --> - true + true