diff --git a/ape/ape-m1.c b/ape/ape-m1.c index a4ce54b5b..7319eef38 100644 --- a/ape/ape-m1.c +++ b/ape/ape-m1.c @@ -344,12 +344,9 @@ static char SearchPath(struct PathSearcher *ps, const char *suffix) { } static char FindCommand(struct PathSearcher *ps, const char *suffix) { - if (MemChr(ps->name, '/', ps->namelen) || - MemChr(ps->name, '\\', ps->namelen)) { + if (MemChr(ps->name, '/', ps->namelen)) { ps->path[0] = 0; return AccessCommand(ps, suffix, 0); - } else { - if (AccessCommand(ps, suffix, 0)) return 1; } return SearchPath(ps, suffix); } diff --git a/libc/zipos/get.c b/libc/zipos/get.c index 1824c83d3..f2718997c 100644 --- a/libc/zipos/get.c +++ b/libc/zipos/get.c @@ -62,52 +62,59 @@ static void __zipos_munmap_unneeded(const uint8_t *base, const uint8_t *cdir, * @threadsafe */ struct Zipos *__zipos_get(void) { - int fd = -1; + char *endptr; ssize_t size; - int err, msg; + int fd, err, msg; static bool once; struct Zipos *res; const char *progpath; static struct Zipos zipos; uint8_t *map, *base, *cdir; - progpath = getenv("COSMOPOLITAN_INIT_ZIPOS"); - if (progpath) { - fd = atoi(progpath); - } - if (!once && ((fd != -1) || PLEDGED(RPATH))) { - __zipos_lock(); - if (fd == -1) { - progpath = GetProgramExecutableName(); - fd = open(progpath, O_RDONLY); - } - if (fd != -1) { - if ((size = lseek(fd, 0, SEEK_END)) != -1 && - (map = mmap(0, size, PROT_READ, MAP_SHARED, fd, 0)) != MAP_FAILED) { - if ((base = FindEmbeddedApe(map, size))) { - size -= base - map; - } else { - base = map; - } - if ((cdir = GetZipEocd(base, size, &err)) && - _cmpxchg(&zipos.map, 0, base)) { - __zipos_munmap_unneeded(base, cdir, map); - zipos.cdir = cdir; - msg = kZipOk; - } else { - munmap(map, size); - msg = !cdir ? err : kZipErrorRaceCondition; - } - } else { - msg = kZipErrorMapFailed; - } - close(fd); + __zipos_lock(); + if (!once) { + progpath = getenv("COSMOPOLITAN_INIT_ZIPOS"); + if (progpath) { + fd = strtol(progpath, &endptr, 10); + if (*endptr) fd = -1; } else { - msg = kZipErrorOpenFailed; + fd = -1; + } + if (fd != -1 || PLEDGED(RPATH)) { + if (fd == -1) { + progpath = GetProgramExecutableName(); + fd = open(progpath, O_RDONLY); + } + if (fd != -1) { + if ((size = lseek(fd, 0, SEEK_END)) != -1 && + (map = mmap(0, size, PROT_READ, MAP_SHARED, fd, 0)) != MAP_FAILED) { + if ((base = FindEmbeddedApe(map, size))) { + size -= base - map; + } else { + base = map; + } + if ((cdir = GetZipEocd(base, size, &err)) && + _cmpxchg(&zipos.map, 0, base)) { + __zipos_munmap_unneeded(base, cdir, map); + zipos.cdir = cdir; + msg = kZipOk; + } else { + munmap(map, size); + msg = !cdir ? err : kZipErrorRaceCondition; + } + } else { + msg = kZipErrorMapFailed; + } + close(fd); + } else { + msg = kZipErrorOpenFailed; + } + } else { + msg = -666; } - once = true; - __zipos_unlock(); STRACE("__zipos_get(%#s) → %d% m", progpath, msg); + once = true; } + __zipos_unlock(); if (zipos.cdir) { res = &zipos; } else { diff --git a/third_party/python/Modules/_bisectmodule.c b/third_party/python/Modules/_bisectmodule.c index 75220fec6..1046ada22 100644 --- a/third_party/python/Modules/_bisectmodule.c +++ b/third_party/python/Modules/_bisectmodule.c @@ -284,7 +284,12 @@ PyInit__bisect(void) return PyModule_Create(&_bisectmodule); } -_Section(".rodata.pytab.1 //") const struct _inittab _PyImport_Inittab__bisect = { +#ifdef __aarch64__ +_Section(".rodata.pytab.1 //") +#else +_Section(".rodata.pytab.1") +#endif + const struct _inittab _PyImport_Inittab__bisect = { "_bisect", PyInit__bisect, }; diff --git a/third_party/python/Modules/_bz2module.c b/third_party/python/Modules/_bz2module.c index dc06cc6ea..b18245448 100644 --- a/third_party/python/Modules/_bz2module.c +++ b/third_party/python/Modules/_bz2module.c @@ -804,7 +804,12 @@ PyInit__bz2(void) return m; } -_Section(".rodata.pytab.1 //") const struct _inittab _PyImport_Inittab__bz2 = { +#ifdef __aarch64__ +_Section(".rodata.pytab.1 //") +#else +_Section(".rodata.pytab.1") +#endif + const struct _inittab _PyImport_Inittab__bz2 = { "_bz2", PyInit__bz2, }; diff --git a/third_party/python/Modules/_collectionsmodule.c b/third_party/python/Modules/_collectionsmodule.c index 924458ee4..609160c73 100644 --- a/third_party/python/Modules/_collectionsmodule.c +++ b/third_party/python/Modules/_collectionsmodule.c @@ -2455,7 +2455,12 @@ PyInit__collections(void) return m; } -_Section(".rodata.pytab.1 //") const struct _inittab _PyImport_Inittab__collections = { +#ifdef __aarch64__ +_Section(".rodata.pytab.1 //") +#else +_Section(".rodata.pytab.1") +#endif + const struct _inittab _PyImport_Inittab__collections = { "_collections", PyInit__collections, }; diff --git a/third_party/python/Modules/_csv.c b/third_party/python/Modules/_csv.c index 8e348945c..c23893000 100644 --- a/third_party/python/Modules/_csv.c +++ b/third_party/python/Modules/_csv.c @@ -1717,7 +1717,12 @@ PyInit__csv(void) return module; } -_Section(".rodata.pytab.1 //") const struct _inittab _PyImport_Inittab__csv = { +#ifdef __aarch64__ +_Section(".rodata.pytab.1 //") +#else +_Section(".rodata.pytab.1") +#endif + const struct _inittab _PyImport_Inittab__csv = { "_csv", PyInit__csv, }; diff --git a/third_party/python/Modules/_datetimemodule.c b/third_party/python/Modules/_datetimemodule.c index 599d70170..7e61bf5b7 100644 --- a/third_party/python/Modules/_datetimemodule.c +++ b/third_party/python/Modules/_datetimemodule.c @@ -6041,7 +6041,12 @@ PyInit__datetime(void) return m; } -_Section(".rodata.pytab.1 //") const struct _inittab _PyImport_Inittab__datetime = { +#ifdef __aarch64__ +_Section(".rodata.pytab.1 //") +#else +_Section(".rodata.pytab.1") +#endif + const struct _inittab _PyImport_Inittab__datetime = { "_datetime", PyInit__datetime, }; diff --git a/third_party/python/Modules/_decimal/_decimal.c b/third_party/python/Modules/_decimal/_decimal.c index 6406d20d6..cab874903 100644 --- a/third_party/python/Modules/_decimal/_decimal.c +++ b/third_party/python/Modules/_decimal/_decimal.c @@ -5948,7 +5948,12 @@ error: return NULL; /* GCOV_NOT_REACHED */ } -_Section(".rodata.pytab.1 //") const struct _inittab _PyImport_Inittab__decimal = { +#ifdef __aarch64__ +_Section(".rodata.pytab.1 //") +#else +_Section(".rodata.pytab.1") +#endif + const struct _inittab _PyImport_Inittab__decimal = { "_decimal", PyInit__decimal, }; diff --git a/third_party/python/Modules/_elementtree.c b/third_party/python/Modules/_elementtree.c index 8a1b0a3ed..ad8dd14c0 100644 --- a/third_party/python/Modules/_elementtree.c +++ b/third_party/python/Modules/_elementtree.c @@ -4092,7 +4092,12 @@ PyInit__elementtree(void) return m; } -_Section(".rodata.pytab.1 //") const struct _inittab _PyImport_Inittab__elementtree = { +#ifdef __aarch64__ +_Section(".rodata.pytab.1 //") +#else +_Section(".rodata.pytab.1") +#endif + const struct _inittab _PyImport_Inittab__elementtree = { "_elementtree", PyInit__elementtree, }; diff --git a/third_party/python/Modules/_functoolsmodule.c b/third_party/python/Modules/_functoolsmodule.c index abb2b8fe9..052d4374f 100644 --- a/third_party/python/Modules/_functoolsmodule.c +++ b/third_party/python/Modules/_functoolsmodule.c @@ -1349,7 +1349,12 @@ PyInit__functools(void) return m; } -_Section(".rodata.pytab.1 //") const struct _inittab _PyImport_Inittab__functools = { +#ifdef __aarch64__ +_Section(".rodata.pytab.1 //") +#else +_Section(".rodata.pytab.1") +#endif + const struct _inittab _PyImport_Inittab__functools = { "_functools", PyInit__functools, }; diff --git a/third_party/python/Modules/_hashmbedtls.c b/third_party/python/Modules/_hashmbedtls.c index 4b909a078..913b38da6 100644 --- a/third_party/python/Modules/_hashmbedtls.c +++ b/third_party/python/Modules/_hashmbedtls.c @@ -582,7 +582,12 @@ PyInit__hashlib(void) return m; } -_Section(".rodata.pytab.1 //") const struct _inittab _PyImport_Inittab__hashlib = { +#ifdef __aarch64__ +_Section(".rodata.pytab.1 //") +#else +_Section(".rodata.pytab.1") +#endif + const struct _inittab _PyImport_Inittab__hashlib = { "_hashlib", PyInit__hashlib, }; diff --git a/third_party/python/Modules/_heapqmodule.c b/third_party/python/Modules/_heapqmodule.c index 377ea17e8..044eaaf2a 100644 --- a/third_party/python/Modules/_heapqmodule.c +++ b/third_party/python/Modules/_heapqmodule.c @@ -678,7 +678,12 @@ PyInit__heapq(void) return m; } -_Section(".rodata.pytab.1 //") const struct _inittab _PyImport_Inittab__heapq = { +#ifdef __aarch64__ +_Section(".rodata.pytab.1 //") +#else +_Section(".rodata.pytab.1") +#endif + const struct _inittab _PyImport_Inittab__heapq = { "_heapq", PyInit__heapq, }; diff --git a/third_party/python/Modules/_json.c b/third_party/python/Modules/_json.c index 26a3fcf9f..a02674cb2 100644 --- a/third_party/python/Modules/_json.c +++ b/third_party/python/Modules/_json.c @@ -1978,7 +1978,12 @@ PyInit__json(void) return NULL; } -_Section(".rodata.pytab.1 //") const struct _inittab _PyImport_Inittab__json = { +#ifdef __aarch64__ +_Section(".rodata.pytab.1 //") +#else +_Section(".rodata.pytab.1") +#endif + const struct _inittab _PyImport_Inittab__json = { "_json", PyInit__json, }; diff --git a/third_party/python/Modules/_localemodule.c b/third_party/python/Modules/_localemodule.c index 4f1226e1c..bf221877f 100644 --- a/third_party/python/Modules/_localemodule.c +++ b/third_party/python/Modules/_localemodule.c @@ -777,7 +777,12 @@ indent-tabs-mode: nil End: */ -_Section(".rodata.pytab.1 //") const struct _inittab _PyImport_Inittab__locale = { +#ifdef __aarch64__ +_Section(".rodata.pytab.1 //") +#else +_Section(".rodata.pytab.1") +#endif + const struct _inittab _PyImport_Inittab__locale = { "_locale", PyInit__locale, }; diff --git a/third_party/python/Modules/_lol3.c b/third_party/python/Modules/_lol3.c index a03a14804..b7fa36fcc 100644 --- a/third_party/python/Modules/_lol3.c +++ b/third_party/python/Modules/_lol3.c @@ -7980,7 +7980,12 @@ error: return 0; } -_Section(".rodata.pytab.1 //") const struct _inittab _PyImport_Inittab__sha3 = { - "_sha3", - PyInit__sha3, +#ifdef __aarch64__ +_Section(".rodata.pytab.1 //") +#else +_Section(".rodata.pytab.1") +#endif + const struct _inittab _PyImport_Inittab__sha3 = { + "_sha3", + PyInit__sha3, }; diff --git a/third_party/python/Modules/_lsprof.c b/third_party/python/Modules/_lsprof.c index c4c41704c..fb06b8fcf 100644 --- a/third_party/python/Modules/_lsprof.c +++ b/third_party/python/Modules/_lsprof.c @@ -909,7 +909,12 @@ PyInit__lsprof(void) return module; } -_Section(".rodata.pytab.1 //") const struct _inittab _PyImport_Inittab__lsprof = { +#ifdef __aarch64__ +_Section(".rodata.pytab.1 //") +#else +_Section(".rodata.pytab.1") +#endif + const struct _inittab _PyImport_Inittab__lsprof = { "_lsprof", PyInit__lsprof, }; diff --git a/third_party/python/Modules/_multiprocessing/multiprocessing.c b/third_party/python/Modules/_multiprocessing/multiprocessing.c index 536aec202..80684de66 100644 --- a/third_party/python/Modules/_multiprocessing/multiprocessing.c +++ b/third_party/python/Modules/_multiprocessing/multiprocessing.c @@ -4,8 +4,8 @@ │ Python 3 │ │ https://docs.python.org/3/license.html │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "third_party/python/Include/yoink.h" #include "third_party/python/Modules/_multiprocessing/multiprocessing.h" +#include "third_party/python/Include/yoink.h" /* clang-format off */ PYTHON_PROVIDE("_multiprocessing"); @@ -225,7 +225,12 @@ PyInit__multiprocessing(void) return module; } -_Section(".rodata.pytab.1 //") const struct _inittab _PyImport_Inittab__multiprocessing = { +#ifdef __aarch64__ +_Section(".rodata.pytab.1 //") +#else +_Section(".rodata.pytab.1") +#endif + const struct _inittab _PyImport_Inittab__multiprocessing = { "_multiprocessing", PyInit__multiprocessing, }; diff --git a/third_party/python/Modules/_opcode.c b/third_party/python/Modules/_opcode.c index 9604cf697..6cd56bbc1 100644 --- a/third_party/python/Modules/_opcode.c +++ b/third_party/python/Modules/_opcode.c @@ -94,7 +94,12 @@ PyInit__opcode(void) return PyModule_Create(&opcodemodule); } -_Section(".rodata.pytab.1 //") const struct _inittab _PyImport_Inittab__opcode = { +#ifdef __aarch64__ +_Section(".rodata.pytab.1 //") +#else +_Section(".rodata.pytab.1") +#endif + const struct _inittab _PyImport_Inittab__opcode = { "_opcode", PyInit__opcode, }; diff --git a/third_party/python/Modules/_operator.c b/third_party/python/Modules/_operator.c index 131fa3a44..24c70be98 100644 --- a/third_party/python/Modules/_operator.c +++ b/third_party/python/Modules/_operator.c @@ -1305,7 +1305,12 @@ PyInit__operator(void) return m; } -_Section(".rodata.pytab.1 //") const struct _inittab _PyImport_Inittab__operator = { +#ifdef __aarch64__ +_Section(".rodata.pytab.1 //") +#else +_Section(".rodata.pytab.1") +#endif + const struct _inittab _PyImport_Inittab__operator = { "_operator", PyInit__operator, }; diff --git a/third_party/python/Modules/_pickle.c b/third_party/python/Modules/_pickle.c index 53792d214..930701c33 100644 --- a/third_party/python/Modules/_pickle.c +++ b/third_party/python/Modules/_pickle.c @@ -7499,7 +7499,12 @@ PyInit__pickle(void) return m; } -_Section(".rodata.pytab.1 //") const struct _inittab _PyImport_Inittab__pickle = { +#ifdef __aarch64__ +_Section(".rodata.pytab.1 //") +#else +_Section(".rodata.pytab.1") +#endif + const struct _inittab _PyImport_Inittab__pickle = { "_pickle", PyInit__pickle, }; diff --git a/third_party/python/Modules/_posixsubprocess.c b/third_party/python/Modules/_posixsubprocess.c index 34c3c2442..dcab56044 100644 --- a/third_party/python/Modules/_posixsubprocess.c +++ b/third_party/python/Modules/_posixsubprocess.c @@ -729,7 +729,12 @@ PyInit__posixsubprocess(void) return PyModule_Create(&_posixsubprocessmodule); } -_Section(".rodata.pytab.1 //") const struct _inittab _PyImport_Inittab__posixsubprocess = { +#ifdef __aarch64__ +_Section(".rodata.pytab.1 //") +#else +_Section(".rodata.pytab.1") +#endif + const struct _inittab _PyImport_Inittab__posixsubprocess = { "_posixsubprocess", PyInit__posixsubprocess, }; diff --git a/third_party/python/Modules/_randommodule.c b/third_party/python/Modules/_randommodule.c index 6d8f6a424..77d0d9d46 100644 --- a/third_party/python/Modules/_randommodule.c +++ b/third_party/python/Modules/_randommodule.c @@ -4,11 +4,11 @@ │ Python 3 │ │ https://docs.python.org/3/license.html │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/intrin/bits.h" #include "libc/calls/calls.h" +#include "libc/intrin/bits.h" #include "libc/nexgen32e/x86feature.h" -#include "libc/stdio/rand.h" #include "libc/runtime/runtime.h" +#include "libc/stdio/rand.h" #include "libc/sysv/consts/grnd.h" #include "third_party/python/Include/floatobject.h" #include "third_party/python/Include/import.h" @@ -565,7 +565,12 @@ PyInit__random(void) return m; } -_Section(".rodata.pytab.1 //") const struct _inittab _PyImport_Inittab__random = { +#ifdef __aarch64__ +_Section(".rodata.pytab.1 //") +#else +_Section(".rodata.pytab.1") +#endif + const struct _inittab _PyImport_Inittab__random = { "_random", PyInit__random, }; diff --git a/third_party/python/Modules/_sqlite/module.c b/third_party/python/Modules/_sqlite/module.c index 4422a1672..392931eeb 100644 --- a/third_party/python/Modules/_sqlite/module.c +++ b/third_party/python/Modules/_sqlite/module.c @@ -492,7 +492,12 @@ error: return module; } -_Section(".rodata.pytab.1 //") const struct _inittab _PyImport_Inittab__sqlite3 = { +#ifdef __aarch64__ +_Section(".rodata.pytab.1 //") +#else +_Section(".rodata.pytab.1") +#endif + const struct _inittab _PyImport_Inittab__sqlite3 = { "_sqlite3", PyInit__sqlite3, }; diff --git a/third_party/python/Modules/_sre.c b/third_party/python/Modules/_sre.c index 515dd337f..4fab3b5c7 100644 --- a/third_party/python/Modules/_sre.c +++ b/third_party/python/Modules/_sre.c @@ -2997,7 +2997,12 @@ PyInit__sre(void) return m; } -_Section(".rodata.pytab.1 //") const struct _inittab _PyImport_Inittab__sre = { +#ifdef __aarch64__ +_Section(".rodata.pytab.1 //") +#else +_Section(".rodata.pytab.1") +#endif + const struct _inittab _PyImport_Inittab__sre = { "_sre", PyInit__sre, }; diff --git a/third_party/python/Modules/_stat.c b/third_party/python/Modules/_stat.c index 8b6cc3517..11b10b135 100644 --- a/third_party/python/Modules/_stat.c +++ b/third_party/python/Modules/_stat.c @@ -628,7 +628,12 @@ PyInit__stat(void) return m; } -_Section(".rodata.pytab.1 //") const struct _inittab _PyImport_Inittab__stat = { +#ifdef __aarch64__ +_Section(".rodata.pytab.1 //") +#else +_Section(".rodata.pytab.1") +#endif + const struct _inittab _PyImport_Inittab__stat = { "_stat", PyInit__stat, }; diff --git a/third_party/python/Modules/_struct.c b/third_party/python/Modules/_struct.c index 523072ea9..f5723128c 100644 --- a/third_party/python/Modules/_struct.c +++ b/third_party/python/Modules/_struct.c @@ -2411,7 +2411,12 @@ PyInit__struct(void) return m; } -_Section(".rodata.pytab.1 //") const struct _inittab _PyImport_Inittab__struct = { +#ifdef __aarch64__ +_Section(".rodata.pytab.1 //") +#else +_Section(".rodata.pytab.1") +#endif + const struct _inittab _PyImport_Inittab__struct = { "_struct", PyInit__struct, }; diff --git a/third_party/python/Modules/_testcapimodule.c b/third_party/python/Modules/_testcapimodule.c index e41239d80..d83bf9feb 100644 --- a/third_party/python/Modules/_testcapimodule.c +++ b/third_party/python/Modules/_testcapimodule.c @@ -5218,7 +5218,12 @@ PyInit__testcapi(void) return m; } -_Section(".rodata.pytab.1 //") const struct _inittab _PyImport_Inittab__testcapi = { +#ifdef __aarch64__ +_Section(".rodata.pytab.1 //") +#else +_Section(".rodata.pytab.1") +#endif + const struct _inittab _PyImport_Inittab__testcapi = { "_testcapi", PyInit__testcapi, }; diff --git a/third_party/python/Modules/_tracemalloc.c b/third_party/python/Modules/_tracemalloc.c index 2d6284ec6..e3023b83b 100644 --- a/third_party/python/Modules/_tracemalloc.c +++ b/third_party/python/Modules/_tracemalloc.c @@ -1613,7 +1613,12 @@ PyInit__tracemalloc(void) return m; } -_Section(".rodata.pytab.1 //") const struct _inittab _PyImport_Inittab__tracemalloc = { +#ifdef __aarch64__ +_Section(".rodata.pytab.1 //") +#else +_Section(".rodata.pytab.1") +#endif + const struct _inittab _PyImport_Inittab__tracemalloc = { "_tracemalloc", PyInit__tracemalloc, }; diff --git a/third_party/python/Modules/arraymodule.c b/third_party/python/Modules/arraymodule.c index 3ccbc4e59..0683d98d5 100644 --- a/third_party/python/Modules/arraymodule.c +++ b/third_party/python/Modules/arraymodule.c @@ -3058,7 +3058,12 @@ PyInit_array(void) return PyModuleDef_Init(&arraymodule); } -_Section(".rodata.pytab.1 //") const struct _inittab _PyImport_Inittab_array = { +#ifdef __aarch64__ +_Section(".rodata.pytab.1 //") +#else +_Section(".rodata.pytab.1") +#endif + const struct _inittab _PyImport_Inittab_array = { "array", PyInit_array, }; diff --git a/third_party/python/Modules/atexitmodule.c b/third_party/python/Modules/atexitmodule.c index 1b2183480..b4cf01243 100644 --- a/third_party/python/Modules/atexitmodule.c +++ b/third_party/python/Modules/atexitmodule.c @@ -373,7 +373,12 @@ PyInit_atexit(void) return m; } -_Section(".rodata.pytab.1 //") const struct _inittab _PyImport_Inittab_atexit = { +#ifdef __aarch64__ +_Section(".rodata.pytab.1 //") +#else +_Section(".rodata.pytab.1") +#endif + const struct _inittab _PyImport_Inittab_atexit = { "atexit", PyInit_atexit, }; diff --git a/third_party/python/Modules/audioop.c b/third_party/python/Modules/audioop.c index 64138f1f1..c8f0fca9b 100644 --- a/third_party/python/Modules/audioop.c +++ b/third_party/python/Modules/audioop.c @@ -1713,7 +1713,12 @@ PyInit_audioop(void) return m; } -_Section(".rodata.pytab.1 //") const struct _inittab _PyImport_Inittab_audioop = { +#ifdef __aarch64__ +_Section(".rodata.pytab.1 //") +#else +_Section(".rodata.pytab.1") +#endif + const struct _inittab _PyImport_Inittab_audioop = { "audioop", PyInit_audioop, }; diff --git a/third_party/python/Modules/binascii.c b/third_party/python/Modules/binascii.c index 016333445..0060ed127 100644 --- a/third_party/python/Modules/binascii.c +++ b/third_party/python/Modules/binascii.c @@ -1476,7 +1476,12 @@ PyInit_binascii(void) return m; } -_Section(".rodata.pytab.1 //") const struct _inittab _PyImport_Inittab_binascii = { +#ifdef __aarch64__ +_Section(".rodata.pytab.1 //") +#else +_Section(".rodata.pytab.1") +#endif + const struct _inittab _PyImport_Inittab_binascii = { "binascii", PyInit_binascii, }; diff --git a/third_party/python/Modules/cjkcodecs/_codecs_cn.c b/third_party/python/Modules/cjkcodecs/_codecs_cn.c index 43417af5d..d1e519f41 100644 --- a/third_party/python/Modules/cjkcodecs/_codecs_cn.c +++ b/third_party/python/Modules/cjkcodecs/_codecs_cn.c @@ -524,7 +524,12 @@ END_CODECS_LIST I_AM_A_MODULE_FOR(cn) -_Section(".rodata.pytab.1 //") const struct _inittab _PyImport_Inittab__codecs_cn = { +#ifdef __aarch64__ +_Section(".rodata.pytab.1 //") +#else +_Section(".rodata.pytab.1") +#endif + const struct _inittab _PyImport_Inittab__codecs_cn = { "_codecs_cn", PyInit__codecs_cn, }; diff --git a/third_party/python/Modules/cjkcodecs/_codecs_hk.c b/third_party/python/Modules/cjkcodecs/_codecs_hk.c index 3b7b72b38..7259a5d6a 100644 --- a/third_party/python/Modules/cjkcodecs/_codecs_hk.c +++ b/third_party/python/Modules/cjkcodecs/_codecs_hk.c @@ -236,7 +236,12 @@ END_CODECS_LIST I_AM_A_MODULE_FOR(hk) -_Section(".rodata.pytab.1 //") const struct _inittab _PyImport_Inittab__codecs_hk = { +#ifdef __aarch64__ +_Section(".rodata.pytab.1 //") +#else +_Section(".rodata.pytab.1") +#endif + const struct _inittab _PyImport_Inittab__codecs_hk = { "_codecs_hk", PyInit__codecs_hk, }; diff --git a/third_party/python/Modules/cjkcodecs/_codecs_iso2022.c b/third_party/python/Modules/cjkcodecs/_codecs_iso2022.c index c9aa43410..b629522a3 100644 --- a/third_party/python/Modules/cjkcodecs/_codecs_iso2022.c +++ b/third_party/python/Modules/cjkcodecs/_codecs_iso2022.c @@ -1080,7 +1080,12 @@ END_CODECS_LIST I_AM_A_MODULE_FOR(iso2022) -_Section(".rodata.pytab.1 //") const struct _inittab _PyImport_Inittab__codecs_iso2022 = { +#ifdef __aarch64__ +_Section(".rodata.pytab.1 //") +#else +_Section(".rodata.pytab.1") +#endif + const struct _inittab _PyImport_Inittab__codecs_iso2022 = { "_codecs_iso2022", PyInit__codecs_iso2022, }; diff --git a/third_party/python/Modules/cjkcodecs/_codecs_jp.c b/third_party/python/Modules/cjkcodecs/_codecs_jp.c index 27de186cc..1d99cfb95 100644 --- a/third_party/python/Modules/cjkcodecs/_codecs_jp.c +++ b/third_party/python/Modules/cjkcodecs/_codecs_jp.c @@ -703,7 +703,12 @@ END_CODECS_LIST I_AM_A_MODULE_FOR(jp) -_Section(".rodata.pytab.1 //") const struct _inittab _PyImport_Inittab__codecs_jp = { +#ifdef __aarch64__ +_Section(".rodata.pytab.1 //") +#else +_Section(".rodata.pytab.1") +#endif + const struct _inittab _PyImport_Inittab__codecs_jp = { "_codecs_jp", PyInit__codecs_jp, }; diff --git a/third_party/python/Modules/cjkcodecs/_codecs_kr.c b/third_party/python/Modules/cjkcodecs/_codecs_kr.c index 62f91f12e..32f095625 100644 --- a/third_party/python/Modules/cjkcodecs/_codecs_kr.c +++ b/third_party/python/Modules/cjkcodecs/_codecs_kr.c @@ -482,7 +482,12 @@ END_CODECS_LIST I_AM_A_MODULE_FOR(kr) -_Section(".rodata.pytab.1 //") const struct _inittab _PyImport_Inittab__codecs_kr = { +#ifdef __aarch64__ +_Section(".rodata.pytab.1 //") +#else +_Section(".rodata.pytab.1") +#endif + const struct _inittab _PyImport_Inittab__codecs_kr = { "_codecs_kr", PyInit__codecs_kr, }; diff --git a/third_party/python/Modules/cjkcodecs/_codecs_tw.c b/third_party/python/Modules/cjkcodecs/_codecs_tw.c index 71c95d0ac..827fdc0b1 100644 --- a/third_party/python/Modules/cjkcodecs/_codecs_tw.c +++ b/third_party/python/Modules/cjkcodecs/_codecs_tw.c @@ -149,7 +149,12 @@ END_CODECS_LIST I_AM_A_MODULE_FOR(tw) -_Section(".rodata.pytab.1 //") const struct _inittab _PyImport_Inittab__codecs_tw = { +#ifdef __aarch64__ +_Section(".rodata.pytab.1 //") +#else +_Section(".rodata.pytab.1") +#endif + const struct _inittab _PyImport_Inittab__codecs_tw = { "_codecs_tw", PyInit__codecs_tw, }; diff --git a/third_party/python/Modules/cjkcodecs/multibytecodec.c b/third_party/python/Modules/cjkcodecs/multibytecodec.c index 70d934f32..10f1b9867 100644 --- a/third_party/python/Modules/cjkcodecs/multibytecodec.c +++ b/third_party/python/Modules/cjkcodecs/multibytecodec.c @@ -5,6 +5,7 @@ │ https://docs.python.org/3/license.html │ ╚─────────────────────────────────────────────────────────────────────────────*/ #define PY_SSIZE_T_CLEAN +#include "third_party/python/Modules/cjkcodecs/multibytecodec.h" #include "third_party/python/Include/abstract.h" #include "third_party/python/Include/codecs.h" #include "third_party/python/Include/descrobject.h" @@ -19,7 +20,6 @@ #include "third_party/python/Include/structmember.h" #include "third_party/python/Include/tupleobject.h" #include "third_party/python/Include/yoink.h" -#include "third_party/python/Modules/cjkcodecs/multibytecodec.h" /* clang-format off */ PYTHON_PROVIDE("_multibytecodec"); @@ -1911,7 +1911,12 @@ PyInit__multibytecodec(void) return m; } -_Section(".rodata.pytab.1 //") const struct _inittab _PyImport_Inittab__multibytecodec = { +#ifdef __aarch64__ +_Section(".rodata.pytab.1 //") +#else +_Section(".rodata.pytab.1") +#endif + const struct _inittab _PyImport_Inittab__multibytecodec = { "_multibytecodec", PyInit__multibytecodec, }; diff --git a/third_party/python/Modules/cmathmodule.c b/third_party/python/Modules/cmathmodule.c index d0b13ea6f..4092bffc6 100644 --- a/third_party/python/Modules/cmathmodule.c +++ b/third_party/python/Modules/cmathmodule.c @@ -1458,7 +1458,12 @@ PyInit_cmath(void) return m; } -_Section(".rodata.pytab.1 //") const struct _inittab _PyImport_Inittab_cmath = { +#ifdef __aarch64__ +_Section(".rodata.pytab.1 //") +#else +_Section(".rodata.pytab.1") +#endif + const struct _inittab _PyImport_Inittab_cmath = { "cmath", PyInit_cmath, }; diff --git a/third_party/python/Modules/errnomodule.c b/third_party/python/Modules/errnomodule.c index a81660f7d..cee3013e4 100644 --- a/third_party/python/Modules/errnomodule.c +++ b/third_party/python/Modules/errnomodule.c @@ -400,7 +400,12 @@ PyInit_errno(void) return m; } -_Section(".rodata.pytab.1 //") const struct _inittab _PyImport_Inittab_errno = { +#ifdef __aarch64__ +_Section(".rodata.pytab.1 //") +#else +_Section(".rodata.pytab.1") +#endif + const struct _inittab _PyImport_Inittab_errno = { "errno", PyInit_errno, }; diff --git a/third_party/python/Modules/faulthandler.c b/third_party/python/Modules/faulthandler.c index e6b3e202a..3f566b2ed 100644 --- a/third_party/python/Modules/faulthandler.c +++ b/third_party/python/Modules/faulthandler.c @@ -1434,7 +1434,12 @@ void _PyFaulthandler_Fini(void) #endif } -_Section(".rodata.pytab.1 //") const struct _inittab _PyImport_Inittab_faulthandler = { +#ifdef __aarch64__ +_Section(".rodata.pytab.1 //") +#else +_Section(".rodata.pytab.1") +#endif + const struct _inittab _PyImport_Inittab_faulthandler = { "faulthandler", PyInit_faulthandler, }; diff --git a/third_party/python/Modules/fcntlmodule.c b/third_party/python/Modules/fcntlmodule.c index 1679a04a0..0a56c35cd 100644 --- a/third_party/python/Modules/fcntlmodule.c +++ b/third_party/python/Modules/fcntlmodule.c @@ -692,7 +692,12 @@ PyInit_fcntl(void) return m; } -_Section(".rodata.pytab.1 //") const struct _inittab _PyImport_Inittab_fcntl = { +#ifdef __aarch64__ +_Section(".rodata.pytab.1 //") +#else +_Section(".rodata.pytab.1") +#endif + const struct _inittab _PyImport_Inittab_fcntl = { "fcntl", PyInit_fcntl, }; diff --git a/third_party/python/Modules/fpectlmodule.c b/third_party/python/Modules/fpectlmodule.c index b577f828e..afa369be1 100644 --- a/third_party/python/Modules/fpectlmodule.c +++ b/third_party/python/Modules/fpectlmodule.c @@ -277,7 +277,12 @@ PyMODINIT_FUNC PyInit_fpectl(void) return m; } -_Section(".rodata.pytab.1 //") const struct _inittab _PyImport_Inittab_fpectl = { +#ifdef __aarch64__ +_Section(".rodata.pytab.1 //") +#else +_Section(".rodata.pytab.1") +#endif + const struct _inittab _PyImport_Inittab_fpectl = { "fpectl", PyInit_fpectl, }; diff --git a/third_party/python/Modules/grpmodule.c b/third_party/python/Modules/grpmodule.c index c40603cd2..954ded73f 100644 --- a/third_party/python/Modules/grpmodule.c +++ b/third_party/python/Modules/grpmodule.c @@ -18,10 +18,11 @@ #include "third_party/python/Include/unicodeobject.h" #include "third_party/python/Include/warnings.h" #include "third_party/python/Include/yoink.h" -#include "third_party/python/Modules/clinic/grpmodule.inc" #include "third_party/python/Modules/posixmodule.h" /* clang-format off */ +#include "third_party/python/Modules/clinic/grpmodule.inc" + PYTHON_PROVIDE("grp"); PYTHON_PROVIDE("grp.getgrall"); PYTHON_PROVIDE("grp.getgrgid"); @@ -278,7 +279,12 @@ PyInit_grp(void) return m; } -_Section(".rodata.pytab.1 //") const struct _inittab _PyImport_Inittab_grp = { +#ifdef __aarch64__ +_Section(".rodata.pytab.1 //") +#else +_Section(".rodata.pytab.1") +#endif + const struct _inittab _PyImport_Inittab_grp = { "grp", PyInit_grp, }; diff --git a/third_party/python/Modules/mathmodule.c b/third_party/python/Modules/mathmodule.c index e876c30fb..d3187d017 100644 --- a/third_party/python/Modules/mathmodule.c +++ b/third_party/python/Modules/mathmodule.c @@ -2229,7 +2229,12 @@ PyInit_math(void) return m; } -_Section(".rodata.pytab.1 //") const struct _inittab _PyImport_Inittab_math = { +#ifdef __aarch64__ +_Section(".rodata.pytab.1 //") +#else +_Section(".rodata.pytab.1") +#endif + const struct _inittab _PyImport_Inittab_math = { "math", PyInit_math, }; diff --git a/third_party/python/Modules/mmapmodule.c b/third_party/python/Modules/mmapmodule.c index c744c276c..3a4b2a1ad 100644 --- a/third_party/python/Modules/mmapmodule.c +++ b/third_party/python/Modules/mmapmodule.c @@ -1495,7 +1495,12 @@ PyInit_mmap(void) return module; } -_Section(".rodata.pytab.1 //") const struct _inittab _PyImport_Inittab_mmap = { +#ifdef __aarch64__ +_Section(".rodata.pytab.1 //") +#else +_Section(".rodata.pytab.1") +#endif + const struct _inittab _PyImport_Inittab_mmap = { "mmap", PyInit_mmap, }; diff --git a/third_party/python/Modules/parsermodule.c b/third_party/python/Modules/parsermodule.c index 97ef28f28..0f05ebb5e 100644 --- a/third_party/python/Modules/parsermodule.c +++ b/third_party/python/Modules/parsermodule.c @@ -1240,7 +1240,12 @@ PyInit_parser(void) return module; } -_Section(".rodata.pytab.1 //") const struct _inittab _PyImport_Inittab_parser = { +#ifdef __aarch64__ +_Section(".rodata.pytab.1 //") +#else +_Section(".rodata.pytab.1") +#endif + const struct _inittab _PyImport_Inittab_parser = { "parser", PyInit_parser, }; diff --git a/third_party/python/Modules/pwdmodule.c b/third_party/python/Modules/pwdmodule.c index d4ab1f9be..2c75a4920 100644 --- a/third_party/python/Modules/pwdmodule.c +++ b/third_party/python/Modules/pwdmodule.c @@ -15,10 +15,11 @@ #include "third_party/python/Include/structseq.h" #include "third_party/python/Include/unicodeobject.h" #include "third_party/python/Include/yoink.h" -#include "third_party/python/Modules/clinic/pwdmodule.inc" #include "third_party/python/Modules/posixmodule.h" /* clang-format off */ +#include "third_party/python/Modules/clinic/pwdmodule.inc" + PYTHON_PROVIDE("pwd"); PYTHON_PROVIDE("pwd.getpwall"); PYTHON_PROVIDE("pwd.getpwnam"); @@ -266,7 +267,12 @@ PyInit_pwd(void) return m; } -_Section(".rodata.pytab.1 //") const struct _inittab _PyImport_Inittab_pwd = { +#ifdef __aarch64__ +_Section(".rodata.pytab.1 //") +#else +_Section(".rodata.pytab.1") +#endif + const struct _inittab _PyImport_Inittab_pwd = { "pwd", PyInit_pwd, }; diff --git a/third_party/python/Modules/pyexpat.c b/third_party/python/Modules/pyexpat.c index 2ed750521..a3a8dab2d 100644 --- a/third_party/python/Modules/pyexpat.c +++ b/third_party/python/Modules/pyexpat.c @@ -4,6 +4,7 @@ │ Python 3 │ │ https://docs.python.org/3/license.html │ ╚─────────────────────────────────────────────────────────────────────────────*/ +#include "third_party/python/Include/pyexpat.h" #include "libc/fmt/fmt.h" #include "third_party/python/Include/abstract.h" #include "third_party/python/Include/boolobject.h" @@ -16,7 +17,6 @@ #include "third_party/python/Include/modsupport.h" #include "third_party/python/Include/objimpl.h" #include "third_party/python/Include/pycapsule.h" -#include "third_party/python/Include/pyexpat.h" #include "third_party/python/Include/pyhash.h" #include "third_party/python/Include/pymacro.h" #include "third_party/python/Include/sysmodule.h" @@ -2041,7 +2041,12 @@ dump buffer [clinic start generated code]*/ /*[clinic end generated code: output=da39a3ee5e6b4b0d input=524ce2e021e4eba6]*/ -_Section(".rodata.pytab.1 //") const struct _inittab _PyImport_Inittab_pyexpat = { +#ifdef __aarch64__ +_Section(".rodata.pytab.1 //") +#else +_Section(".rodata.pytab.1") +#endif + const struct _inittab _PyImport_Inittab_pyexpat = { "pyexpat", PyInit_pyexpat, }; diff --git a/third_party/python/Modules/resource.c b/third_party/python/Modules/resource.c index 8032ee119..a74b0b3cb 100644 --- a/third_party/python/Modules/resource.c +++ b/third_party/python/Modules/resource.c @@ -390,7 +390,12 @@ PyInit_resource(void) return m; } -_Section(".rodata.pytab.1 //") const struct _inittab _PyImport_Inittab_resource = { +#ifdef __aarch64__ +_Section(".rodata.pytab.1 //") +#else +_Section(".rodata.pytab.1") +#endif + const struct _inittab _PyImport_Inittab_resource = { "resource", PyInit_resource, }; diff --git a/third_party/python/Modules/selectmodule.c b/third_party/python/Modules/selectmodule.c index 30f4ca827..fb19938cf 100644 --- a/third_party/python/Modules/selectmodule.c +++ b/third_party/python/Modules/selectmodule.c @@ -7,9 +7,9 @@ #include "libc/calls/calls.h" #include "libc/dce.h" #include "libc/errno.h" +#include "libc/mem/gc.internal.h" #include "libc/mem/mem.h" #include "libc/nt/efi.h" -#include "libc/mem/gc.internal.h" #include "libc/sock/epoll.h" #include "libc/sock/select.h" #include "libc/sock/sock.h" @@ -2605,7 +2605,12 @@ PyInit_select(void) return m; } -_Section(".rodata.pytab.1 //") const struct _inittab _PyImport_Inittab_select = { +#ifdef __aarch64__ +_Section(".rodata.pytab.1 //") +#else +_Section(".rodata.pytab.1") +#endif + const struct _inittab _PyImport_Inittab_select = { "select", PyInit_select, }; diff --git a/third_party/python/Modules/signalmodule.c b/third_party/python/Modules/signalmodule.c index 62bdd4a1b..5459e28d8 100644 --- a/third_party/python/Modules/signalmodule.c +++ b/third_party/python/Modules/signalmodule.c @@ -1569,7 +1569,12 @@ void *_PyOS_SigintEvent(void) } #endif -_Section(".rodata.pytab.1 //") const struct _inittab _PyImport_Inittab__signal = { +#ifdef __aarch64__ +_Section(".rodata.pytab.1 //") +#else +_Section(".rodata.pytab.1") +#endif + const struct _inittab _PyImport_Inittab__signal = { "_signal", PyInit__signal, }; diff --git a/third_party/python/Modules/socketmodule.c b/third_party/python/Modules/socketmodule.c index 2e9dacad3..5876d96fc 100644 --- a/third_party/python/Modules/socketmodule.c +++ b/third_party/python/Modules/socketmodule.c @@ -4,6 +4,7 @@ │ Python 3 │ │ https://docs.python.org/3/license.html │ ╚─────────────────────────────────────────────────────────────────────────────*/ +#include "third_party/python/Modules/socketmodule.h" #include "libc/calls/calls.h" #include "libc/calls/ioctl.h" #include "libc/calls/weirdtypes.h" @@ -55,7 +56,6 @@ #include "third_party/python/Include/tupleobject.h" #include "third_party/python/Include/warnings.h" #include "third_party/python/Include/yoink.h" -#include "third_party/python/Modules/socketmodule.h" #include "third_party/python/pyconfig.h" /* clang-format off */ @@ -7200,7 +7200,12 @@ PyInit__socket(void) return m; } -_Section(".rodata.pytab.1 //") const struct _inittab _PyImport_Inittab__socket = { +#ifdef __aarch64__ +_Section(".rodata.pytab.1 //") +#else +_Section(".rodata.pytab.1") +#endif + const struct _inittab _PyImport_Inittab__socket = { "_socket", PyInit__socket, }; diff --git a/third_party/python/Modules/symtablemodule.c b/third_party/python/Modules/symtablemodule.c index aac5f25ea..1abb04d6b 100644 --- a/third_party/python/Modules/symtablemodule.c +++ b/third_party/python/Modules/symtablemodule.c @@ -135,7 +135,12 @@ PyInit__symtable(void) return m; } -_Section(".rodata.pytab.1 //") const struct _inittab _PyImport_Inittab__symtable = { +#ifdef __aarch64__ +_Section(".rodata.pytab.1 //") +#else +_Section(".rodata.pytab.1") +#endif + const struct _inittab _PyImport_Inittab__symtable = { "_symtable", PyInit__symtable, }; diff --git a/third_party/python/Modules/syslogmodule.c b/third_party/python/Modules/syslogmodule.c index 47e811a39..64e783c1c 100644 --- a/third_party/python/Modules/syslogmodule.c +++ b/third_party/python/Modules/syslogmodule.c @@ -404,7 +404,12 @@ PyInit_syslog(void) return m; } -_Section(".rodata.pytab.1 //") const struct _inittab _PyImport_Inittab_syslog = { +#ifdef __aarch64__ +_Section(".rodata.pytab.1 //") +#else +_Section(".rodata.pytab.1") +#endif + const struct _inittab _PyImport_Inittab_syslog = { "syslog", PyInit_syslog, }; diff --git a/third_party/python/Modules/termios.c b/third_party/python/Modules/termios.c index 16aad6aaf..11f4efcf8 100644 --- a/third_party/python/Modules/termios.c +++ b/third_party/python/Modules/termios.c @@ -760,7 +760,12 @@ PyInit_termios(void) return m; } -_Section(".rodata.pytab.1 //") const struct _inittab _PyImport_Inittab_termios = { +#ifdef __aarch64__ +_Section(".rodata.pytab.1 //") +#else +_Section(".rodata.pytab.1") +#endif + const struct _inittab _PyImport_Inittab_termios = { "termios", PyInit_termios, }; diff --git a/third_party/python/Modules/timemodule.c b/third_party/python/Modules/timemodule.c index a22bb6f89..13b00b15c 100644 --- a/third_party/python/Modules/timemodule.c +++ b/third_party/python/Modules/timemodule.c @@ -1597,7 +1597,12 @@ pysleep(_PyTime_t secs) return 0; } -_Section(".rodata.pytab.1 //") const struct _inittab _PyImport_Inittab_time = { +#ifdef __aarch64__ +_Section(".rodata.pytab.1 //") +#else +_Section(".rodata.pytab.1") +#endif + const struct _inittab _PyImport_Inittab_time = { "time", PyInit_time, }; diff --git a/third_party/python/Modules/tlsmodule.c b/third_party/python/Modules/tlsmodule.c index 2f84e5a5f..33717f3fe 100644 --- a/third_party/python/Modules/tlsmodule.c +++ b/third_party/python/Modules/tlsmodule.c @@ -495,7 +495,12 @@ PyInit_tls(void) return m; } -_Section(".rodata.pytab.1 //") const struct _inittab _PyImport_Inittab_tls = { +#ifdef __aarch64__ +_Section(".rodata.pytab.1 //") +#else +_Section(".rodata.pytab.1") +#endif + const struct _inittab _PyImport_Inittab_tls = { "tls", PyInit_tls, }; diff --git a/third_party/python/Modules/tokenbucket.c b/third_party/python/Modules/tokenbucket.c index 82b3c04b4..81f7d8db1 100644 --- a/third_party/python/Modules/tokenbucket.c +++ b/third_party/python/Modules/tokenbucket.c @@ -236,7 +236,12 @@ PyInit_tokenbucket(void) return !PyErr_Occurred() ? m : 0; } -_Section(".rodata.pytab.1 //") const struct _inittab _PyImport_Inittab_tokenbucket = { +#ifdef __aarch64__ +_Section(".rodata.pytab.1 //") +#else +_Section(".rodata.pytab.1") +#endif + const struct _inittab _PyImport_Inittab_tokenbucket = { "tokenbucket", PyInit_tokenbucket, }; diff --git a/third_party/python/Modules/unicodedata.c b/third_party/python/Modules/unicodedata.c index c09ffb082..af241fd24 100644 --- a/third_party/python/Modules/unicodedata.c +++ b/third_party/python/Modules/unicodedata.c @@ -5,6 +5,7 @@ │ https://docs.python.org/3/license.html │ ╚─────────────────────────────────────────────────────────────────────────────*/ #define PY_SSIZE_T_CLEAN +#include "third_party/python/Modules/unicodedata.h" #include "libc/fmt/fmt.h" #include "libc/intrin/bits.h" #include "libc/nexgen32e/kompressor.h" @@ -20,7 +21,6 @@ #include "third_party/python/Include/structmember.h" #include "third_party/python/Include/ucnhash.h" #include "third_party/python/Include/yoink.h" -#include "third_party/python/Modules/unicodedata.h" #include "third_party/python/Modules/unicodedata_unidata.h" /* clang-format off */ @@ -646,7 +646,12 @@ PyInit_unicodedata(void) return m; } -_Section(".rodata.pytab.1 //") const struct _inittab _PyImport_Inittab_unicodedata = { +#ifdef __aarch64__ +_Section(".rodata.pytab.1 //") +#else +_Section(".rodata.pytab.1") +#endif + const struct _inittab _PyImport_Inittab_unicodedata = { "unicodedata", PyInit_unicodedata, }; diff --git a/third_party/python/Modules/zipimport.c b/third_party/python/Modules/zipimport.c index dbae3aaf9..b29df6edf 100644 --- a/third_party/python/Modules/zipimport.c +++ b/third_party/python/Modules/zipimport.c @@ -4,9 +4,9 @@ │ Python 3 │ │ https://docs.python.org/3/license.html │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/intrin/bits.h" #include "libc/calls/calls.h" #include "libc/calls/weirdtypes.h" +#include "libc/intrin/bits.h" #include "libc/sysv/consts/s.h" #include "libc/time/struct/tm.h" #include "libc/time/time.h" @@ -1601,7 +1601,12 @@ PyInit_zipimport(void) return mod; } -_Section(".rodata.pytab.1 //") const struct _inittab _PyImport_Inittab_zipimport = { +#ifdef __aarch64__ +_Section(".rodata.pytab.1 //") +#else +_Section(".rodata.pytab.1") +#endif + const struct _inittab _PyImport_Inittab_zipimport = { "zipimport", PyInit_zipimport, }; diff --git a/third_party/python/Modules/zlibmodule.c b/third_party/python/Modules/zlibmodule.c index 4a9be6d2e..7801e3809 100644 --- a/third_party/python/Modules/zlibmodule.c +++ b/third_party/python/Modules/zlibmodule.c @@ -1453,7 +1453,12 @@ PyInit_zlib(void) return m; } -_Section(".rodata.pytab.1 //") const struct _inittab _PyImport_Inittab_zlib = { +#ifdef __aarch64__ +_Section(".rodata.pytab.1 //") +#else +_Section(".rodata.pytab.1") +#endif + const struct _inittab _PyImport_Inittab_zlib = { "zlib", PyInit_zlib, }; diff --git a/third_party/python/Python/cosmomodule.c b/third_party/python/Python/cosmomodule.c index 1a25b835e..7953014e4 100644 --- a/third_party/python/Python/cosmomodule.c +++ b/third_party/python/Python/cosmomodule.c @@ -412,7 +412,12 @@ PyInit_cosmo(void) return !PyErr_Occurred() ? m : 0; } -_Section(".rodata.pytab.1 //") const struct _inittab _PyImport_Inittab_cosmo = { +#ifdef __aarch64__ +_Section(".rodata.pytab.1 //") +#else +_Section(".rodata.pytab.1") +#endif + const struct _inittab _PyImport_Inittab_cosmo = { "cosmo", PyInit_cosmo, }; diff --git a/third_party/python/Python/xedmodule.c b/third_party/python/Python/xedmodule.c index 0803a6782..00ed73b5a 100644 --- a/third_party/python/Python/xedmodule.c +++ b/third_party/python/Python/xedmodule.c @@ -75,7 +75,12 @@ PyInit_xed(void) return PyModule_Create(&xedmodule); } -_Section(".rodata.pytab.1 //") const struct _inittab _PyImport_Inittab_xed = { +#ifdef __aarch64__ +_Section(".rodata.pytab.1 //") +#else +_Section(".rodata.pytab.1") +#endif + const struct _inittab _PyImport_Inittab_xed = { "xed", PyInit_xed, }; diff --git a/third_party/python/Python/xtermmodule.c b/third_party/python/Python/xtermmodule.c index 8245c2556..e8fa34fff 100644 --- a/third_party/python/Python/xtermmodule.c +++ b/third_party/python/Python/xtermmodule.c @@ -89,7 +89,12 @@ PyInit_xterm(void) return PyModule_Create(&xtermmodule); } -_Section(".rodata.pytab.1 //") const struct _inittab _PyImport_Inittab_xterm = { +#ifdef __aarch64__ +_Section(".rodata.pytab.1 //") +#else +_Section(".rodata.pytab.1") +#endif + const struct _inittab _PyImport_Inittab_xterm = { "xterm", PyInit_xterm, };