Attempt to build Python compiler program

This commit is contained in:
Justine Tunney 2021-08-17 06:28:23 -07:00
parent d522a88def
commit 0c6581f912
27 changed files with 9780 additions and 2536 deletions

View file

@ -16,6 +16,24 @@
#include "third_party/python/Include/pythonrun.h"
/* clang-format off */
#define HEADER "\
/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│\n\
vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi\n\
\n\
Python 3 \n\
https://docs.python.org/3/license.html \n\
*/\n\
/* clang-format off */\n\
\n\
/*\n\
* Auto-generated by\n\
* %s \\\n\
* %s \\\n\
* %s\n\
*/\n\
\n\
"
/* This is built as a stand-alone executable by the Makefile, and helps turn
Lib/importlib/_bootstrap.py into a frozen module in Python/importlib.h
*/
@ -35,23 +53,25 @@ static const struct _frozen _PyImport_FrozenModules[] = {
const struct _frozen *PyImport_FrozenModules;
#endif
#define HEADER "\
/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│\n\
vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi\n\
\n\
Python 3 \n\
https://docs.python.org/3/license.html \n\
*/\n\
/* clang-format off */\n\
\n\
/*\n\
* Auto-generated by\n\
* %s \\\n\
* %s \\\n\
* %s\n\
*/\n\
\n\
"
PyObject *PyMarshal_Init(void);
PyObject *PyInit_gc(void);
PyObject *PyInit__ast(void);
PyObject *_PyWarnings_Init(void);
PyObject *PyInit__string(void);
struct _inittab _PyImport_Inittab[] = {
{"marshal", PyMarshal_Init},
{"_imp", PyInit_imp},
{"_ast", PyInit__ast},
{"builtins"},
{"sys"},
{"gc", PyInit_gc},
{"_warnings", _PyWarnings_Init},
{"_string", PyInit__string},
{0}
};
struct _inittab *PyImport_Inittab = _PyImport_Inittab;
int
main(int argc, char *argv[])

View file

@ -27,6 +27,9 @@
#include "third_party/python/Include/unicodeobject.h"
/* clang-format off */
extern struct _inittab _PyImport_Inittab[];
struct _inittab *PyImport_Inittab = _PyImport_Inittab;
static jmp_buf jbuf;
static void