You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit ebc936d
Browse filesBrowse the repository at this point in the historyBrowse files
gh-160689: Link only the bootstrap modules into the build helper programs
Programs/_freeze_module and _bootstrap_python were linked with
$(LIBRARY_OBJS_OMIT_FROZEN), i.e. every static module from all Setup
files (Setup.local, Setup.stdlib with MODULE_BUILDTYPE=static, ...).
That makes it impossible for a builtin module to depend on anything the
helpers produce: a frozen module header, Modules/getpath.o, or generated
sources. A Setup.local module including a header generated by
$(FREEZE_MODULE) is a dependency cycle ("Circular ... dependency
dropped"), and one referencing a getpath.o symbol fails to link, since
_freeze_module links Modules/getpath_noop.o instead. CPython itself
needed a workaround for the latter: a stub of
_Py_Get_Getpath_CodeObject() in getpath_noop.c for _testinternalcapi
in MODULE_BUILDTYPE=static builds.
Mirror what PCbuild/_freeze_module.vcxproj already does on Windows
(a fixed source list plus PC/config_minimal.c): link the helpers with
the core objects plus the modules of Modules/Setup.bootstrap only.
* makesetup: new "-b Setup" option marking a Setup file as the bootstrap
modules. Their objects and libraries are substituted for
_BOOTSTRAP_MODOBJS_ / _BOOTSTRAP_MODLIBS_, and a second table,
config_bootstrap.c, is generated with only those modules. A bootstrap
module overridden by an earlier rule (Setup.local) keeps the
overriding static module for the helpers too.
* Makefile.pre.in: BOOTSTRAP_LIBRARY_OBJS (core + Modules/config_bootstrap.o
+ $(BOOTSTRAP_MODOBJS)) replaces LIBRARY_OBJS_OMIT_FROZEN in the
_freeze_module and _bootstrap_python links. getbuildinfo gets a
separate object for the helpers, as its prerequisites include
$(MODOBJS).
* configure.ac / configure: pass -b Modules/Setup.bootstrap and move
config_bootstrap.c into Modules/ (configure hand-edited in sync).
* Tools/c-analyzer: whitelist _PyImport_Inittab in the generated
Modules/config_bootstrap.c, as for Modules/config.c.
The final libpython/python link is unchanged.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YD8kPnXaAMJZk2LvSHPXYA
0 commit comments