mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-24 14:22:28 +00:00
Introduce Python objectifier (#259)
This commit is contained in:
parent
34b68f1945
commit
81287b7ec0
13 changed files with 1702 additions and 1564 deletions
14
third_party/python/Include/yoink.h
vendored
14
third_party/python/Include/yoink.h
vendored
|
@ -2,17 +2,9 @@
|
|||
#define COSMOPOLITAN_THIRD_PARTY_PYTHON_INCLUDE_YOINK_H_
|
||||
#include "libc/dce.h"
|
||||
|
||||
#if !IsTiny()
|
||||
#define PYTHON_YOINK(s) \
|
||||
__asm__(".section .yoink\n\t" \
|
||||
"nopl\t\"" s "\"\n\t" \
|
||||
"nopl\t\"" s "c\"\n\t" \
|
||||
#define PYTHON_YOINK(s) \
|
||||
__asm__(".section .yoink\n\t" \
|
||||
"nopl\t\"py:" s "\"\n\t" \
|
||||
".previous")
|
||||
#else
|
||||
#define PYTHON_YOINK(s) \
|
||||
__asm__(".section .yoink\n\t" \
|
||||
"nopl\t\"" s "c\"\n\t" \
|
||||
".previous")
|
||||
#endif
|
||||
|
||||
#endif /* COSMOPOLITAN_THIRD_PARTY_PYTHON_INCLUDE_YOINK_H_ */
|
||||
|
|
1139
third_party/python/Programs/python.c
vendored
1139
third_party/python/Programs/python.c
vendored
File diff suppressed because it is too large
Load diff
1271
third_party/python/Programs/pythontester.c
vendored
1271
third_party/python/Programs/pythontester.c
vendored
File diff suppressed because it is too large
Load diff
16
third_party/python/pycomp.c
vendored
16
third_party/python/pycomp.c
vendored
|
@ -38,6 +38,7 @@
|
|||
#include "third_party/python/Include/pylifecycle.h"
|
||||
#include "third_party/python/Include/pymacro.h"
|
||||
#include "third_party/python/Include/pythonrun.h"
|
||||
#include "tool/build/lib/stripcomponents.h"
|
||||
/* clang-format off */
|
||||
|
||||
#define MANUAL "\
|
||||
|
@ -67,21 +68,6 @@ int optimize;
|
|||
char *inpath;
|
||||
char *outpath;
|
||||
|
||||
char *
|
||||
StripComponents(const char *path, int n)
|
||||
{
|
||||
const char *p;
|
||||
while (n-- > 0) {
|
||||
for (p = path; *p; ++p) {
|
||||
if (*p == '/') {
|
||||
path = p + 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return (char *)path;
|
||||
}
|
||||
|
||||
void
|
||||
GetOpts(int argc, char *argv[])
|
||||
{
|
||||
|
|
251
third_party/python/pyobj.c
vendored
Normal file
251
third_party/python/pyobj.c
vendored
Normal file
|
@ -0,0 +1,251 @@
|
|||
/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│
|
||||
│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│
|
||||
╞══════════════════════════════════════════════════════════════════════════════╡
|
||||
│ Copyright 2021 Justine Alexandra Roberts Tunney │
|
||||
│ │
|
||||
│ Permission to use, copy, modify, and/or distribute this software for │
|
||||
│ any purpose with or without fee is hereby granted, provided that the │
|
||||
│ above copyright notice and this permission notice appear in all copies. │
|
||||
│ │
|
||||
│ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL │
|
||||
│ WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED │
|
||||
│ WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE │
|
||||
│ AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL │
|
||||
│ DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR │
|
||||
│ PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER │
|
||||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/assert.h"
|
||||
#include "libc/bits/bits.h"
|
||||
#include "libc/calls/calls.h"
|
||||
#include "libc/calls/struct/iovec.h"
|
||||
#include "libc/calls/struct/stat.h"
|
||||
#include "libc/elf/def.h"
|
||||
#include "libc/fmt/conv.h"
|
||||
#include "libc/log/check.h"
|
||||
#include "libc/log/log.h"
|
||||
#include "libc/runtime/gc.internal.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/sysv/consts/o.h"
|
||||
#include "libc/x/x.h"
|
||||
#include "third_party/getopt/getopt.h"
|
||||
#include "third_party/python/Include/bytesobject.h"
|
||||
#include "third_party/python/Include/compile.h"
|
||||
#include "third_party/python/Include/fileutils.h"
|
||||
#include "third_party/python/Include/import.h"
|
||||
#include "third_party/python/Include/marshal.h"
|
||||
#include "third_party/python/Include/pydebug.h"
|
||||
#include "third_party/python/Include/pylifecycle.h"
|
||||
#include "third_party/python/Include/pymacro.h"
|
||||
#include "third_party/python/Include/pythonrun.h"
|
||||
#include "tool/build/lib/elfwriter.h"
|
||||
#include "tool/build/lib/stripcomponents.h"
|
||||
/* clang-format off */
|
||||
|
||||
#define MANUAL "\
|
||||
SYNOPSIS\n\
|
||||
\n\
|
||||
pyobj.com [FLAGS] SOURCE\n\
|
||||
\n\
|
||||
OVERVIEW\n\
|
||||
\n\
|
||||
Python Objectifier\n\
|
||||
\n\
|
||||
FLAGS\n\
|
||||
\n\
|
||||
-o PATH output elf object file\n\
|
||||
-P STR prefix fake directory in zip\n\
|
||||
-C INT strip directory components from src in zip\n\
|
||||
-O0 don't optimize [default]\n\
|
||||
-O1 remove debug statements\n\
|
||||
-O2 remove debug statements and docstrings\n\
|
||||
-b binary only (don't include .py file)\n\
|
||||
-0 zip uncompressed\n\
|
||||
-n do nothing\n\
|
||||
-h help\n\
|
||||
\n"
|
||||
|
||||
bool binonly;
|
||||
int optimize;
|
||||
char *pyfile;
|
||||
char *outpath;
|
||||
bool nocompress;
|
||||
uint64_t image_base;
|
||||
int strip_components;
|
||||
const char *path_prefix;
|
||||
|
||||
static void
|
||||
GetOpts(int argc, char *argv[])
|
||||
{
|
||||
int opt;
|
||||
while ((opt = getopt(argc, argv, "hn0Bb:O:o:C:P:")) != -1) {
|
||||
switch (opt) {
|
||||
case 'O':
|
||||
optimize = atoi(optarg);
|
||||
break;
|
||||
case 'o':
|
||||
outpath = optarg;
|
||||
break;
|
||||
case 'P':
|
||||
path_prefix = optarg;
|
||||
break;
|
||||
case 'C':
|
||||
strip_components = atoi(optarg);
|
||||
break;
|
||||
case 'b':
|
||||
image_base = strtoul(optarg, NULL, 0);
|
||||
break;
|
||||
case 'B':
|
||||
binonly = true;
|
||||
break;
|
||||
case '0':
|
||||
nocompress = true;
|
||||
break;
|
||||
case 'n':
|
||||
exit(0);
|
||||
case 'h':
|
||||
fputs(MANUAL, stdout);
|
||||
exit(0);
|
||||
default:
|
||||
fputs(MANUAL, stderr);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
if (argc - optind != 1) {
|
||||
fputs("error: need one input file\n", stderr);
|
||||
exit(1);
|
||||
}
|
||||
pyfile = argv[optind];
|
||||
if (!outpath) {
|
||||
outpath = xstrcat(pyfile, ".o");
|
||||
}
|
||||
}
|
||||
|
||||
static char *
|
||||
Dotify(char *s)
|
||||
{
|
||||
size_t i;
|
||||
for (i = 0; s[i]; ++i) {
|
||||
if (s[i] == '/') {
|
||||
s[i] = '.';
|
||||
}
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
static void
|
||||
Yoink(struct ElfWriter *elf, const char *symbol)
|
||||
{
|
||||
elfwriter_align(elf, 1, 0);
|
||||
elfwriter_startsection(elf, ".yoink", SHT_PROGBITS,
|
||||
SHF_ALLOC | SHF_EXECINSTR);
|
||||
elfwriter_yoink(elf, symbol);
|
||||
elfwriter_finishsection(elf);
|
||||
}
|
||||
|
||||
static char *
|
||||
GetZipFile(void)
|
||||
{
|
||||
const char *zipfile;
|
||||
zipfile = pyfile;
|
||||
zipfile = StripComponents(zipfile, strip_components);
|
||||
if (path_prefix) {
|
||||
zipfile = gc(xjoinpaths(path_prefix, zipfile));
|
||||
}
|
||||
return strdup(zipfile);
|
||||
}
|
||||
|
||||
static char *
|
||||
GetZipDir(void)
|
||||
{
|
||||
return xstrcat(gc(xdirname(gc(GetZipFile()))), '/');
|
||||
}
|
||||
|
||||
static char *
|
||||
GetSynFile(void)
|
||||
{
|
||||
return xstrcat("/zip/", gc(GetZipFile()));
|
||||
}
|
||||
|
||||
static char *
|
||||
GetModName(bool *ispkg)
|
||||
{
|
||||
char *mod;
|
||||
mod = Dotify(xstripexts(StripComponents(pyfile, strip_components)));
|
||||
if ((*ispkg = endswith(mod, ".__init__"))) {
|
||||
mod[strlen(mod) - strlen(".__init__")] = 0;
|
||||
}
|
||||
return mod;
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
char t[12];
|
||||
bool ispkg;
|
||||
ssize_t rc;
|
||||
struct stat st;
|
||||
struct ElfWriter *elf;
|
||||
struct timespec timestamp;
|
||||
PyObject *code, *marshalled;
|
||||
size_t i, pysize, pycsize, marsize;
|
||||
char *s, *pydata, *pycdata, *mardata, *zipfile, *zipdir, *synfile, *modname;
|
||||
ShowCrashReports();
|
||||
GetOpts(argc, argv);
|
||||
marshalled = 0;
|
||||
if (stat(pyfile, &st) == -1) perror(pyfile), exit(1);
|
||||
CHECK_NOTNULL((pydata = gc(xslurp(pyfile, &pysize))));
|
||||
Py_NoUserSiteDirectory++;
|
||||
Py_NoSiteFlag++;
|
||||
Py_IgnoreEnvironmentFlag++;
|
||||
Py_FrozenFlag++;
|
||||
Py_SetProgramName(gc(utf8toutf32(argv[0], -1, 0)));
|
||||
_Py_InitializeEx_Private(1, 0);
|
||||
zipdir = gc(GetZipDir());
|
||||
zipfile = gc(GetZipFile());
|
||||
synfile = gc(GetSynFile());
|
||||
modname = gc(GetModName(&ispkg));
|
||||
code = Py_CompileStringExFlags(pydata, synfile, Py_file_input, NULL, optimize);
|
||||
if (!code) goto error;
|
||||
marshalled = PyMarshal_WriteObjectToString(code, Py_MARSHAL_VERSION);
|
||||
Py_CLEAR(code);
|
||||
if (!marshalled) goto error;
|
||||
memset(×tamp, 0, sizeof(timestamp));
|
||||
assert(PyBytes_CheckExact(marshalled));
|
||||
mardata = PyBytes_AS_STRING(marshalled);
|
||||
marsize = PyBytes_GET_SIZE(marshalled);
|
||||
elf = elfwriter_open(outpath, 0644);
|
||||
elfwriter_cargoculting(elf);
|
||||
WRITE16LE(t+0, 3379); /* Python 3.6rc1 */
|
||||
WRITE16LE(t+2, READ16LE("\r\n"));
|
||||
WRITE32LE(t+4, timestamp.tv_sec);
|
||||
WRITE32LE(t+8, marsize);
|
||||
pycsize = sizeof(t) + marsize;
|
||||
pycdata = gc(malloc(pycsize));
|
||||
memcpy(pycdata, t, sizeof(t));
|
||||
memcpy(pycdata + sizeof(t), mardata, marsize);
|
||||
if (ispkg) {
|
||||
elfwriter_zip(elf, zipdir, zipdir, strlen(zipdir),
|
||||
pydata, pysize, 040755, timestamp, timestamp,
|
||||
timestamp, nocompress, image_base);
|
||||
}
|
||||
if (!binonly) {
|
||||
elfwriter_zip(elf, gc(xstrcat("py:", modname)), zipfile,
|
||||
strlen(zipfile), pydata, pysize, st.st_mode, timestamp,
|
||||
timestamp, timestamp, nocompress, image_base);
|
||||
}
|
||||
elfwriter_zip(elf, gc(xstrcat("pyc:", modname)), gc(xstrcat(zipfile, 'c')),
|
||||
strlen(zipfile) + 1, pycdata, pycsize, st.st_mode, timestamp,
|
||||
timestamp, timestamp, nocompress, image_base);
|
||||
Yoink(elf, "__zip_start");
|
||||
elfwriter_close(elf);
|
||||
Py_CLEAR(marshalled);
|
||||
Py_Finalize();
|
||||
return 0;
|
||||
error:
|
||||
PyErr_Print();
|
||||
Py_Finalize();
|
||||
if (marshalled) Py_DECREF(marshalled);
|
||||
return 1;
|
||||
}
|
127
third_party/python/python.mk
vendored
127
third_party/python/python.mk
vendored
|
@ -11,8 +11,6 @@ THIRD_PARTY_PYTHON_STAGE2 = \
|
|||
$(THIRD_PARTY_PYTHON_STAGE2_A_DEPS) \
|
||||
$(THIRD_PARTY_PYTHON_STAGE2_A) \
|
||||
$(THIRD_PARTY_PYTHON_STDLIB_PYS_A) \
|
||||
$(THIRD_PARTY_PYTHON_STDLIB_PYCS_A) \
|
||||
$(THIRD_PARTY_PYTHON_STDLIB_DIRS_A) \
|
||||
$(THIRD_PARTY_PYTHON_STDLIB_DATA_A)
|
||||
|
||||
THIRD_PARTY_PYTHON_ARTIFACTS = \
|
||||
|
@ -26,6 +24,7 @@ THIRD_PARTY_PYTHON_BINS = \
|
|||
THIRD_PARTY_PYTHON_COMS = \
|
||||
o/$(MODE)/third_party/python/python.com \
|
||||
o/$(MODE)/third_party/python/freeze.com \
|
||||
o/$(MODE)/third_party/python/pyobj.com \
|
||||
o/$(MODE)/third_party/python/pycomp.com \
|
||||
o/$(MODE)/third_party/python/pythontester.com
|
||||
|
||||
|
@ -37,17 +36,12 @@ THIRD_PARTY_PYTHON_CHECKS = \
|
|||
THIRD_PARTY_PYTHON_STAGE1_A = o/$(MODE)/third_party/python/python-stage1.a
|
||||
THIRD_PARTY_PYTHON_STAGE2_A = o/$(MODE)/third_party/python/python-stage2.a
|
||||
THIRD_PARTY_PYTHON_STDLIB_PYS_A = o/$(MODE)/third_party/python/python-stdlib-pys.a
|
||||
THIRD_PARTY_PYTHON_STDLIB_PYCS_A = o/$(MODE)/third_party/python/python-stdlib-pycs.a
|
||||
THIRD_PARTY_PYTHON_STDLIB_DIRS_A = o/$(MODE)/third_party/python/python-stdlib-dirs.a
|
||||
THIRD_PARTY_PYTHON_STDLIB_DATA_A = o/$(MODE)/third_party/python/python-stdlib-data.a
|
||||
|
||||
THIRD_PARTY_PYTHON_STAGE1_A_OBJS = $(THIRD_PARTY_PYTHON_STAGE1_A_SRCS:%.c=o/$(MODE)/%.o)
|
||||
THIRD_PARTY_PYTHON_STAGE2_A_OBJS = $(THIRD_PARTY_PYTHON_STAGE2_A_SRCS:%.c=o/$(MODE)/%.o)
|
||||
THIRD_PARTY_PYTHON_STDLIB_PYS_OBJS = $(THIRD_PARTY_PYTHON_STDLIB_PYS:%=o/$(MODE)/%.zip.o)
|
||||
THIRD_PARTY_PYTHON_STDLIB_PYCS_OBJS = $(THIRD_PARTY_PYTHON_STDLIB_PYCS:%=%.zip.o)
|
||||
THIRD_PARTY_PYTHON_STDLIB_DIRS_OBJS = $(THIRD_PARTY_PYTHON_STDLIB_DIRS:%=o/$(MODE)/%.zip.o)
|
||||
THIRD_PARTY_PYTHON_STDLIB_PYS_OBJS = $(THIRD_PARTY_PYTHON_STDLIB_PYS:%.py=o/$(MODE)/%.o)
|
||||
THIRD_PARTY_PYTHON_STDLIB_DATA_OBJS = $(THIRD_PARTY_PYTHON_STDLIB_DATA:%=o/$(MODE)/%.zip.o)
|
||||
THIRD_PARTY_PYTHON_STDLIB_PYCS = $(THIRD_PARTY_PYTHON_STDLIB_PYS:%=o/$(MODE)/%c)
|
||||
|
||||
THIRD_PARTY_PYTHON_HDRS = \
|
||||
third_party/python/Include/yoink.h \
|
||||
|
@ -71,7 +65,7 @@ THIRD_PARTY_PYTHON_HDRS = \
|
|||
third_party/python/Include/codecs.h \
|
||||
third_party/python/Include/compile.h \
|
||||
third_party/python/Include/complexobject.h \
|
||||
third_party/python/Include/cosmo.h \
|
||||
third_party/python/Include/cosmo.h \
|
||||
third_party/python/Include/datetime.h \
|
||||
third_party/python/Include/descrobject.h \
|
||||
third_party/python/Include/dictobject.h \
|
||||
|
@ -533,98 +527,8 @@ THIRD_PARTY_PYTHON_STAGE2_A_SRCS = \
|
|||
third_party/python/Python/pyfpe.c \
|
||||
third_party/python/Python/sigcheck.c
|
||||
|
||||
THIRD_PARTY_PYTHON_STDLIB_DIRS = \
|
||||
third_party/python/Lib/ \
|
||||
third_party/python/Lib/asyncio/ \
|
||||
third_party/python/Lib/collections/ \
|
||||
third_party/python/Lib/dbm/ \
|
||||
third_party/python/Lib/distutils/ \
|
||||
third_party/python/Lib/distutils/command/ \
|
||||
third_party/python/Lib/distutils/tests/ \
|
||||
third_party/python/Lib/email/ \
|
||||
third_party/python/Lib/email/mime/ \
|
||||
third_party/python/Lib/encodings/ \
|
||||
third_party/python/Lib/ensurepip/ \
|
||||
third_party/python/Lib/ensurepip/_bundled/ \
|
||||
third_party/python/Lib/html/ \
|
||||
third_party/python/Lib/http/ \
|
||||
third_party/python/Lib/importlib/ \
|
||||
third_party/python/Lib/json/ \
|
||||
third_party/python/Lib/logging/ \
|
||||
third_party/python/Lib/msilib/ \
|
||||
third_party/python/Lib/multiprocessing/ \
|
||||
third_party/python/Lib/multiprocessing/dummy/ \
|
||||
third_party/python/Lib/sqlite3/ \
|
||||
third_party/python/Lib/unittest/ \
|
||||
third_party/python/Lib/urllib/ \
|
||||
third_party/python/Lib/venv/ \
|
||||
third_party/python/Lib/venv/scripts/common/ \
|
||||
third_party/python/Lib/venv/scripts/nt/ \
|
||||
third_party/python/Lib/venv/scripts/posix/ \
|
||||
third_party/python/Lib/wsgiref/ \
|
||||
third_party/python/Lib/xml/ \
|
||||
third_party/python/Lib/xml/dom/ \
|
||||
third_party/python/Lib/xml/etree/ \
|
||||
third_party/python/Lib/xml/parsers/ \
|
||||
third_party/python/Lib/xml/sax/ \
|
||||
third_party/python/Lib/xmlrpc/ \
|
||||
third_party/python/Lib/test/ \
|
||||
third_party/python/Lib/test/xmltestdata/ \
|
||||
third_party/python/Lib/test/test_email/ \
|
||||
third_party/python/Lib/test/test_email/data/ \
|
||||
third_party/python/Lib/test/sndhdrdata/ \
|
||||
third_party/python/Lib/test/test_asyncio/ \
|
||||
third_party/python/Lib/test/audiodata/ \
|
||||
third_party/python/Lib/test/imghdrdata/ \
|
||||
third_party/python/Lib/test/decimaltestdata/ \
|
||||
third_party/python/Lib/test/test_import/ \
|
||||
third_party/python/Lib/test/test_import/data/ \
|
||||
third_party/python/Lib/test/test_import/data/package/ \
|
||||
third_party/python/Lib/test/test_import/data/package2/ \
|
||||
third_party/python/Lib/test/test_import/data/circular_imports/ \
|
||||
third_party/python/Lib/test/test_import/data/circular_imports/subpkg/ \
|
||||
third_party/python/Lib/test/libregrtest/ \
|
||||
third_party/python/Lib/test/leakers/ \
|
||||
third_party/python/Lib/test/test_json/ \
|
||||
third_party/python/Lib/test/eintrdata/ \
|
||||
third_party/python/Lib/test/support/ \
|
||||
third_party/python/Lib/test/test_importlib/ \
|
||||
third_party/python/Lib/test/test_importlib/extension/ \
|
||||
third_party/python/Lib/test/test_importlib/frozen/ \
|
||||
third_party/python/Lib/test/test_importlib/import_/ \
|
||||
third_party/python/Lib/test/test_importlib/builtin/ \
|
||||
third_party/python/Lib/test/test_importlib/source/ \
|
||||
third_party/python/Lib/test/test_importlib/namespace_pkgs/ \
|
||||
third_party/python/Lib/test/test_importlib/namespace_pkgs/project2/ \
|
||||
third_party/python/Lib/test/test_importlib/namespace_pkgs/project2/parent/ \
|
||||
third_party/python/Lib/test/test_importlib/namespace_pkgs/project2/parent/child/ \
|
||||
third_party/python/Lib/test/test_importlib/namespace_pkgs/portion2/ \
|
||||
third_party/python/Lib/test/test_importlib/namespace_pkgs/portion2/foo/ \
|
||||
third_party/python/Lib/test/test_importlib/namespace_pkgs/project3/ \
|
||||
third_party/python/Lib/test/test_importlib/namespace_pkgs/project3/parent/ \
|
||||
third_party/python/Lib/test/test_importlib/namespace_pkgs/project3/parent/child/ \
|
||||
third_party/python/Lib/test/test_importlib/namespace_pkgs/portion1/ \
|
||||
third_party/python/Lib/test/test_importlib/namespace_pkgs/portion1/foo/ \
|
||||
third_party/python/Lib/test/test_importlib/namespace_pkgs/both_portions/ \
|
||||
third_party/python/Lib/test/test_importlib/namespace_pkgs/both_portions/foo/ \
|
||||
third_party/python/Lib/test/test_importlib/namespace_pkgs/project1/ \
|
||||
third_party/python/Lib/test/test_importlib/namespace_pkgs/project1/parent/ \
|
||||
third_party/python/Lib/test/test_importlib/namespace_pkgs/project1/parent/child/ \
|
||||
third_party/python/Lib/test/test_importlib/namespace_pkgs/not_a_namespace_pkg/ \
|
||||
third_party/python/Lib/test/test_importlib/namespace_pkgs/not_a_namespace_pkg/foo/ \
|
||||
third_party/python/Lib/test/test_importlib/namespace_pkgs/module_and_namespace_package/ \
|
||||
third_party/python/Lib/test/test_importlib/namespace_pkgs/module_and_namespace_package/a_test/ \
|
||||
third_party/python/Lib/test/test_warnings/ \
|
||||
third_party/python/Lib/test/test_warnings/data/ \
|
||||
third_party/python/Lib/test/capath/ \
|
||||
third_party/python/Lib/test/dtracedata/ \
|
||||
third_party/python/Lib/test/subprocessdata/ \
|
||||
third_party/python/Lib/test/crashers/ \
|
||||
third_party/python/Lib/test/cjkencodings/ \
|
||||
third_party/python/Lib/test/test_tools/ \
|
||||
third_party/python/Lib/test/tracedmodules/
|
||||
|
||||
THIRD_PARTY_PYTHON_STDLIB_DATA = \
|
||||
third_party/python/Lib/ \
|
||||
third_party/python/Lib/distutils/command/command_template \
|
||||
third_party/python/Lib/distutils/tests/Setup.sample \
|
||||
third_party/python/Lib/email/architecture.rst \
|
||||
|
@ -2181,6 +2085,7 @@ THIRD_PARTY_PYTHON_STAGE1_A_DIRECTDEPS = \
|
|||
LIBC_TINYMATH \
|
||||
LIBC_UNICODE \
|
||||
LIBC_X \
|
||||
TOOL_BUILD_LIB \
|
||||
THIRD_PARTY_GETOPT
|
||||
|
||||
THIRD_PARTY_PYTHON_STAGE1_A_DEPS = \
|
||||
|
@ -2220,6 +2125,14 @@ THIRD_PARTY_PYTHON_STAGE2_A_DIRECTDEPS = \
|
|||
THIRD_PARTY_PYTHON_STAGE2_A_DEPS = \
|
||||
$(call uniq,$(foreach x,$(THIRD_PARTY_PYTHON_STAGE2_A_DIRECTDEPS),$($(x))))
|
||||
|
||||
o/$(MODE)/third_party/python/pyobj.com.dbg: \
|
||||
$(THIRD_PARTY_PYTHON_STAGE1) \
|
||||
$(THIRD_PARTY_PYTHON_STAGE1_A).pkg \
|
||||
o/$(MODE)/third_party/python/pyobj.o \
|
||||
$(CRT) \
|
||||
$(APE)
|
||||
@$(APELINK)
|
||||
|
||||
o/$(MODE)/third_party/python/pycomp.com.dbg: \
|
||||
$(THIRD_PARTY_PYTHON_STAGE1) \
|
||||
$(THIRD_PARTY_PYTHON_STAGE1_A).pkg \
|
||||
|
@ -2256,6 +2169,11 @@ o/$(MODE)/third_party/python/pythontester.com.dbg: \
|
|||
$(APE)
|
||||
@$(APELINK)
|
||||
|
||||
o/$(MODE)/third_party/python/pyobj: \
|
||||
o/$(MODE)/third_party/python/pyobj.com
|
||||
@cp -f $< $@
|
||||
@$@ -n
|
||||
|
||||
o/$(MODE)/third_party/python/pycomp: \
|
||||
o/$(MODE)/third_party/python/pycomp.com
|
||||
@cp -f $< $@
|
||||
|
@ -2287,9 +2205,7 @@ $(THIRD_PARTY_PYTHON_STAGE2_A): \
|
|||
$(THIRD_PARTY_PYTHON_STAGE2_A_OBJS)
|
||||
|
||||
$(THIRD_PARTY_PYTHON_STDLIB_PYS_A): $(THIRD_PARTY_PYTHON_STDLIB_PYS_OBJS)
|
||||
$(THIRD_PARTY_PYTHON_STDLIB_DIRS_A): $(THIRD_PARTY_PYTHON_STDLIB_DIRS_OBJS)
|
||||
$(THIRD_PARTY_PYTHON_STDLIB_DATA_A): $(THIRD_PARTY_PYTHON_STDLIB_DATA_OBJS)
|
||||
$(THIRD_PARTY_PYTHON_STDLIB_PYCS_A): $(THIRD_PARTY_PYTHON_STDLIB_PYCS_OBJS)
|
||||
|
||||
$(THIRD_PARTY_PYTHON_STAGE1_A).pkg: \
|
||||
$(THIRD_PARTY_PYTHON_STAGE1_A_OBJS) \
|
||||
|
@ -2332,11 +2248,8 @@ o/$(MODE)/third_party/python/Modules/faulthandler.o: \
|
|||
OVERRIDE_CFLAGS += \
|
||||
-fno-optimize-sibling-calls
|
||||
|
||||
$(THIRD_PARTY_PYTHON_STDLIB_PYS_OBJS): ZIPOBJ_FLAGS += -P.python -C3
|
||||
$(THIRD_PARTY_PYTHON_STDLIB_DIRS_OBJS): ZIPOBJ_FLAGS += -P.python -C3
|
||||
$(THIRD_PARTY_PYTHON_STDLIB_PYS_OBJS): PYFLAGS += -P.python -C3
|
||||
$(THIRD_PARTY_PYTHON_STDLIB_DATA_OBJS): ZIPOBJ_FLAGS += -P.python -C3
|
||||
$(THIRD_PARTY_PYTHON_STDLIB_PYCS_OBJS): ZIPOBJ_FLAGS += -P.python -C5
|
||||
.PRECIOUS: $(THIRD_PARTY_PYTHON_STDLIB_PYCS)
|
||||
|
||||
o/$(MODE)/third_party/python/Python/ceval.o: QUOTA = -M512m
|
||||
o/$(MODE)/third_party/python/Objects/unicodeobject.o: QUOTA += -C16
|
||||
|
@ -2352,6 +2265,7 @@ THIRD_PARTY_PYTHON_LIBS = \
|
|||
|
||||
THIRD_PARTY_PYTHON_OBJS = \
|
||||
$(foreach x,$(THIRD_PARTY_PYTHON_ARTIFACTS),$($(x)_OBJS)) \
|
||||
o/$(MODE)/third_party/python/pyobj.o \
|
||||
o/$(MODE)/third_party/python/pycomp.o \
|
||||
o/$(MODE)/third_party/python/Programs/freeze.o \
|
||||
o/$(MODE)/third_party/python/Programs/python.o \
|
||||
|
@ -2359,6 +2273,7 @@ THIRD_PARTY_PYTHON_OBJS = \
|
|||
|
||||
THIRD_PARTY_PYTHON_SRCS = \
|
||||
$(foreach x,$(THIRD_PARTY_PYTHON_ARTIFACTS),$($(x)_SRCS)) \
|
||||
third_party/python/pyobj.c \
|
||||
third_party/python/pycomp.c \
|
||||
third_party/python/Programs/freeze.c \
|
||||
third_party/python/Programs/python.c \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue