Unbreak the x86-64 build

This commit is contained in:
Justine Tunney 2023-06-16 20:05:24 -07:00
parent 7bc20bff3e
commit 207e18a060
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
66 changed files with 443 additions and 117 deletions

View file

@ -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);
}

View file

@ -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 {

View file

@ -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,
};

View file

@ -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,
};

View file

@ -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,
};

View file

@ -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,
};

View file

@ -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,
};

View file

@ -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,
};

View file

@ -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,
};

View file

@ -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,
};

View file

@ -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,
};

View file

@ -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,
};

View file

@ -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,
};

View file

@ -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,
};

View file

@ -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,
};

View file

@ -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,
};

View file

@ -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,
};

View file

@ -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,
};

View file

@ -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,
};

View file

@ -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,
};

View file

@ -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,
};

View file

@ -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,
};

View file

@ -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,
};

View file

@ -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,
};

View file

@ -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,
};

View file

@ -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,
};

View file

@ -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,
};

View file

@ -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,
};

View file

@ -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,
};

View file

@ -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,
};

View file

@ -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,
};

View file

@ -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,
};

View file

@ -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,
};

View file

@ -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,
};

View file

@ -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,
};

View file

@ -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,
};

View file

@ -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,
};

View file

@ -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,
};

View file

@ -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,
};

View file

@ -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,
};

View file

@ -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,
};

View file

@ -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,
};

View file

@ -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,
};

View file

@ -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,
};

View file

@ -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,
};

View file

@ -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,
};

View file

@ -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,
};

View file

@ -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,
};

View file

@ -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,
};

View file

@ -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,
};

View file

@ -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,
};

View file

@ -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,
};

View file

@ -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,
};

View file

@ -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,
};

View file

@ -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,
};

View file

@ -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,
};

View file

@ -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,
};

View file

@ -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,
};

View file

@ -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,
};

View file

@ -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,
};

View file

@ -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,
};

View file

@ -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,
};

View file

@ -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,
};

View file

@ -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,
};

View file

@ -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,
};

View file

@ -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,
};