Repository navigation
Commit 3af290e
committed
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_01YD8kPnXaAMJZk2LvSHPXYA1 parent 7b12a41 commit 3af290e
6 files changed
Lines changed: 138 additions & 37 deletions
File tree
- Modules
- Tools/c-analyzer/cpython
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| 105 | + | |
105 | 106 | | |
106 | 107 | | |
107 | 108 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
28 | 35 | | |
29 | 36 | | |
30 | 37 | | |
| |||
359 | 366 | | |
360 | 367 | | |
361 | 368 | | |
362 | | - | |
363 | | - | |
| 369 | + | |
364 | 370 | | |
365 | 371 | | |
366 | 372 | | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
367 | 377 | | |
368 | 378 | | |
369 | 379 | | |
| |||
614 | 624 | | |
615 | 625 | | |
616 | 626 | | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
617 | 640 | | |
618 | 641 | | |
619 | 642 | | |
| |||
1613 | 1636 | | |
1614 | 1637 | | |
1615 | 1638 | | |
1616 | | - | |
| 1639 | + | |
1617 | 1640 | | |
1618 | 1641 | | |
1619 | 1642 | | |
| |||
1624 | 1647 | | |
1625 | 1648 | | |
1626 | 1649 | | |
1627 | | - | |
| 1650 | + | |
1628 | 1651 | | |
1629 | | - | |
| 1652 | + | |
1630 | 1653 | | |
1631 | 1654 | | |
1632 | 1655 | | |
| |||
1661 | 1684 | | |
1662 | 1685 | | |
1663 | 1686 | | |
1664 | | - | |
1665 | | - | |
1666 | | - | |
| 1687 | + | |
| 1688 | + | |
| 1689 | + | |
1667 | 1690 | | |
1668 | 1691 | | |
1669 | 1692 | | |
| |||
1681 | 1704 | | |
1682 | 1705 | | |
1683 | 1706 | | |
| 1707 | + | |
| 1708 | + | |
| 1709 | + | |
1684 | 1710 | | |
1685 | 1711 | | |
1686 | 1712 | | |
| |||
1753 | 1779 | | |
1754 | 1780 | | |
1755 | 1781 | | |
1756 | | - | |
1757 | | - | |
| 1782 | + | |
| 1783 | + | |
1758 | 1784 | | |
1759 | 1785 | | |
1760 | 1786 | | |
| |||
1907 | 1933 | | |
1908 | 1934 | | |
1909 | 1935 | | |
1910 | | - | |
| 1936 | + | |
| 1937 | + | |
| 1938 | + | |
| 1939 | + | |
| 1940 | + | |
| 1941 | + | |
| 1942 | + | |
| 1943 | + | |
| 1944 | + | |
| 1945 | + | |
| 1946 | + | |
| 1947 | + | |
| 1948 | + | |
| 1949 | + | |
| 1950 | + | |
1911 | 1951 | | |
1912 | 1952 | | |
1913 | | - | |
1914 | | - | |
| 1953 | + | |
1915 | 1954 | | |
1916 | 1955 | | |
1917 | 1956 | | |
| |||
2279 | 2318 | | |
2280 | 2319 | | |
2281 | 2320 | | |
2282 | | - | |
| 2321 | + | |
2283 | 2322 | | |
2284 | 2323 | | |
2285 | 2324 | | |
| |||
3365 | 3404 | | |
3366 | 3405 | | |
3367 | 3406 | | |
3368 | | - | |
| 3407 | + | |
3369 | 3408 | | |
3370 | 3409 | | |
3371 | 3410 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
13 | | - | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
18 | 23 | | |
19 | 24 | | |
20 | 25 | | |
| |||
28 | 33 | | |
29 | 34 | | |
30 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
31 | 39 | | |
32 | 40 | | |
33 | 41 | | |
| |||
37 | 45 | | |
38 | 46 | | |
39 | 47 | | |
| 48 | + | |
| 49 | + | |
40 | 50 | | |
41 | 51 | | |
42 | 52 | | |
| |||
47 | 57 | | |
48 | 58 | | |
49 | 59 | | |
50 | | - | |
| 60 | + | |
51 | 61 | | |
52 | 62 | | |
53 | 63 | | |
54 | 64 | | |
55 | 65 | | |
56 | 66 | | |
| 67 | + | |
57 | 68 | | |
58 | 69 | | |
59 | 70 | | |
| |||
93 | 104 | | |
94 | 105 | | |
95 | 106 | | |
96 | | - | |
| 107 | + | |
| 108 | + | |
97 | 109 | | |
98 | 110 | | |
99 | 111 | | |
| |||
114 | 126 | | |
115 | 127 | | |
116 | 128 | | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
117 | 133 | | |
118 | 134 | | |
119 | 135 | | |
| |||
136 | 152 | | |
137 | 153 | | |
138 | 154 | | |
| 155 | + | |
| 156 | + | |
139 | 157 | | |
140 | 158 | | |
141 | 159 | | |
| |||
204 | 222 | | |
205 | 223 | | |
206 | 224 | | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
207 | 237 | | |
208 | 238 | | |
209 | 239 | | |
| |||
213 | 243 | | |
214 | 244 | | |
215 | 245 | | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
216 | 252 | | |
217 | 253 | | |
218 | 254 | | |
| |||
265 | 301 | | |
266 | 302 | | |
267 | 303 | | |
268 | | - | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
269 | 319 | | |
270 | 320 | | |
271 | 321 | | |
| |||
295 | 345 | | |
296 | 346 | | |
297 | 347 | | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
310 | 359 | | |
311 | 360 | | |
312 | 361 | | |
313 | 362 | | |
314 | 363 | | |
315 | | - | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
316 | 373 | | |
317 | 374 | | |
318 | 375 | | |
| |||
331 | 388 | | |
332 | 389 | | |
333 | 390 | | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
334 | 394 | | |
335 | 395 | | |
336 | 396 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
314 | 314 | | |
315 | 315 | | |
316 | 316 | | |
| 317 | + | |
317 | 318 | | |
318 | 319 | | |
319 | 320 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9070 | 9070 | | |
9071 | 9071 | | |
9072 | 9072 | | |
9073 | | - | |
| 9073 | + | |
9074 | 9074 | | |
9075 | 9075 | | |
9076 | 9076 | | |
9077 | 9077 | | |
9078 | | - | |
| 9078 | + | |
9079 | 9079 | | |
9080 | 9080 | | |
9081 | 9081 | | |
| |||
0 commit comments