mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-03-03 07:29:23 +00:00
Fix regression with Python linker eaxmples
We can once again create 2mb statically-linked Python binaries:
$ make -j8 m=tiny o/tiny/examples/pyapp/pyapp.com
$ ls -hal o/tiny/examples/pyapp/pyapp.com
-rwxr-xr-x 1 jart jart 2.1M May 1 14:04 o/tiny/examples/pyapp/pyapp.com
$ o/tiny/examples/pyapp/pyapp.com
cosmopolitan is cool!
The regression was caused by Python thread support in b15f9eb58
This commit is contained in:
parent
fc82f77a46
commit
12438cce16
4 changed files with 3 additions and 7 deletions
5
third_party/python/Modules/_threadmodule.c
vendored
5
third_party/python/Modules/_threadmodule.c
vendored
|
@ -1519,8 +1519,3 @@ PyInit__thread(void)
|
|||
PyThread_init_thread();
|
||||
return m;
|
||||
}
|
||||
|
||||
_Section(".rodata.pytab.1") const struct _inittab _PyImport_Inittab__thread = {
|
||||
"_thread",
|
||||
PyInit__thread,
|
||||
};
|
||||
|
|
2
third_party/python/Modules/config.c
vendored
2
third_party/python/Modules/config.c
vendored
|
@ -18,6 +18,7 @@ PyObject *PyInit__ast(void);
|
|||
PyObject *PyInit_gc(void);
|
||||
PyObject *_PyWarnings_Init(void);
|
||||
PyObject *PyInit__string(void);
|
||||
PyObject *PyInit__thread(void);
|
||||
|
||||
_Alignas(16) _Section(".rodata.pytab.0") const struct _inittab _PyImport_Inittab[0];
|
||||
_Alignas(16) _Section(".rodata.pytab.2") const struct _inittab _PyImport_Inittab2[] = {
|
||||
|
@ -25,6 +26,7 @@ _Alignas(16) _Section(".rodata.pytab.2") const struct _inittab _PyImport_Inittab
|
|||
{"_codecs", PyInit__codecs},
|
||||
{"itertools", PyInit_itertools},
|
||||
{"_io", PyInit__io},
|
||||
{"_thread", PyInit__thread},
|
||||
{"_weakref", PyInit__weakref},
|
||||
{"marshal", PyMarshal_Init},
|
||||
{"_imp", PyInit_imp},
|
||||
|
|
1
third_party/python/python.c
vendored
1
third_party/python/python.c
vendored
|
@ -167,7 +167,6 @@ STATIC_YOINK("_PyImport_Inittab__stat");
|
|||
STATIC_YOINK("_PyImport_Inittab__struct");
|
||||
STATIC_YOINK("_PyImport_Inittab__symtable");
|
||||
STATIC_YOINK("_PyImport_Inittab__testcapi");
|
||||
STATIC_YOINK("_PyImport_Inittab__thread");
|
||||
STATIC_YOINK("_PyImport_Inittab__tracemalloc");
|
||||
STATIC_YOINK("_PyImport_Inittab_array");
|
||||
STATIC_YOINK("_PyImport_Inittab_atexit");
|
||||
|
|
2
third_party/python/python.mk
vendored
2
third_party/python/python.mk
vendored
|
@ -290,7 +290,7 @@ THIRD_PARTY_PYTHON_INCS = \
|
|||
third_party/python/Modules/clinic/audioop.inc
|
||||
|
||||
THIRD_PARTY_PYTHON_STAGE1_A_SRCS = \
|
||||
third_party/python/Modules/_threadmodule.c \
|
||||
third_party/python/Modules/_threadmodule.c \
|
||||
third_party/python/Modules/_tracemalloc.c \
|
||||
third_party/python/Modules/faulthandler.c \
|
||||
third_party/python/Objects/abstract.c \
|
||||
|
|
Loading…
Add table
Reference in a new issue