Repository navigation
3.9.25.3: link Windows builds with /OPT:REF,NOICF (bpo-42825) - #116
Merged
Merged
Conversation
We explicitly disable /OPT:ICF as some manual optimisations depend on some functions still having distinct pointers (such as wrap_binary_func and wrap_binary_func_l). (cherry picked from commit b4af629)
ActiveState release of the end-of-life 3.9 line: the bpo-42825 /OPT:REF,NOICF linker setting, so Windows builds made with Visual Studio 2022 keep wrap_binaryfunc and wrap_binaryfunc_l distinct. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ezequielp-activestate
approved these changes
Oct 29, 2026
ezequielp-activestate
left a comment
There was a problem hiding this comment.
Approving. This is a clean backport and the diagnosis holds up.
- 38f8e73 is upstream b4af629 (bpo-42825, pythonGH-24098) with the same one-line
PCbuild/pyproject.propschange, character for character. Upstream's commit message names the same two functions (wrap_binaryfunc/wrap_binaryfunc_l). upstream/3.10still carries/OPT:REF,NOICFtoday. Upstream only added/CGTHREADS:1 /PDBTHREADS:1later for reproducible builds, which isn't needed for this fix.pythoncore.vcxprojimportspyproject.props, so the DLL that containstypeobject.cgets the flag. Nothing else inPCbuildsetsEnableCOMDATFoldingor another/OPT:value that would override it.- The flag applies only to non-Debug builds, which is where ICF is on.
- The version bump has the same shape as the 3.9.25.2 one:
PY_VERSIONplus a whatsnew section.
I couldn't build on Windows here, so the behavior check relies on your before/after table. A useful check after the rebuild: class I(int): pass; I(1) + "s" raises TypeError and test_datetime passes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Backports upstream bpo-42825 (pythonGH-24098): Windows release builds now link with
/OPT:REF,NOICF. The PR also bumps the version to 3.9.25.3.The bug
On the Platform's Windows build of 3.9.25.2,
+with an instance of a subclass of a built-in type returnsNotImplementedinstead of raisingTypeError:This also affects subclasses of
datetime,dateandtimedelta, and it makestest_datetime'sTestSubclassDateTime_Fast.test_computationsfail.Cause
Objects/typeobject.chas two slot wrappers with identical bodies:wrap_binaryfuncandwrap_binaryfunc_l.update_one_slot()tells them apart by their address.nb_addinstalled as itssq_concattoo.PyNumber_Addthen calls it as a fallback and returns itsNotImplementedto the caller./OPT:REF,NOICF. The commit message names these same two functions. 3.9 never got that change, while our 3.10 tags have it.Evidence
wrapperbase.wrappervia ctypes showsint.__add__andstr.__add__share a wrapper address on 3.9.25.2. On 3.9.25 and on 3.10.22.2 the addresses differ.I(1) + "s"test_datetime/OPT:REF,ICF, without this changeNotImplementedTypeErrortest_datetimewas the only CPython regression in 3.9.25.2.Release
After merge: tag
v3.9.25.3, then add language/python 3.9.25.3 to the inventory and rebuild. The Windows QA suite then needs to re-run on the rebuilt runtime.