这是indexloc提供的服务,不要输入任何密码
Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
--- a/lib_pypy/_resource_build.py
+++ b/lib_pypy/_resource_build.py
@@ -75,2 +75,4 @@

@@ -73,6 +73,8 @@ static int my_setrlimit(int resource, long long cur, long long max)
rl.rlim_max = max & RLIM_INFINITY;
return setrlimit(resource, &rl);
}
+/* Termux addition: Add wait3() declaration used by busybox. Available in libc for 32-bit only. */
+static pid_t wait3(int* status, int options, struct rusage* rusage) { return wait4(-1, status, options, rusage); }
""".replace('$RLIMIT_CONSTS', ''.join(rlimit_consts)))
""".replace('$RLIMIT_CONSTS', ''.join(rlimit_consts))


62 changes: 35 additions & 27 deletions packages/pypy3/0004-fix-loaded-libs.patch
Original file line number Diff line number Diff line change
@@ -1,26 +1,34 @@
diff --git a/lib_pypy/_audioop_build.py b/lib_pypy/_audioop_build.py
index 64d32f4e9e..3c19353671 100644
--- a/lib_pypy/_audioop_build.py
+++ b/lib_pypy/_audioop_build.py
@@ -629,3 +629,3 @@

@@ -665,7 +665,7 @@ void adcpm2lin(unsigned char* ncp, unsigned char* cp, size_t len,
}
"""

-ffi.set_source("_audioop_cffi", C_SOURCE)
+ffi.set_source("_audioop_cffi", C_SOURCE, libraries=["m"])


if __name__ == "__main__":
import sys
diff --git a/lib_pypy/_syslog_build.py b/lib_pypy/_syslog_build.py
index 86c9533240..1cf5ac9e3e 100644
--- a/lib_pypy/_syslog_build.py
+++ b/lib_pypy/_syslog_build.py
@@ -23,7 +23,7 @@
@@ -23,7 +23,7 @@ ffi.set_source("_syslog_cffi", """
#ifndef LOG_NEWS
#define LOG_NEWS LOG_MAIL
#endif
-""")
+""", libraries=['log'])

ffi.cdef("""
/* mandatory constants */


diff --git a/lib_pypy/_dbm.py b/lib_pypy/_dbm.py
index 3c8f64317d..d94714cc9a 100644
--- a/lib_pypy/_dbm.py
+++ b/lib_pypy/_dbm.py
@@ -123,7 +123,9 @@
@@ -145,7 +145,9 @@ def _init_func(name, argtypes=None, restype=None):
func.restype = restype

if sys.platform != 'darwin':
Expand All @@ -31,23 +39,24 @@
if not libpath:
# XXX this is hopeless...
for c in ['5.3', '5.2', '5.1', '5.0', '4.9', '4.8', '4.7', '4.6', '4.5']:


diff --git a/pypy/module/_multiprocessing/interp_semaphore.py b/pypy/module/_multiprocessing/interp_semaphore.py
index 769aea073b..dce52ae983 100644
--- a/pypy/module/_multiprocessing/interp_semaphore.py
+++ b/pypy/module/_multiprocessing/interp_semaphore.py
@@ -43,7 +43,7 @@
@@ -43,7 +43,7 @@ else:
if sys.platform == 'darwin':
libraries = []
else:
- libraries = ['rt']
+ libraries = ['android-posix-semaphore']

eci = ExternalCompilationInfo(
includes = ['sys/time.h',

diff --git a/rpython/rlib/rposix.py b/rpython/rlib/rposix.py
index e96571e342..e3d68c7056 100644
--- a/rpython/rlib/rposix.py
+++ b/rpython/rlib/rposix.py
@@ -212,7 +212,7 @@
@@ -212,7 +212,7 @@ else:
includes.append('sys/sysmacros.h')
if sys.platform.startswith('freebsd') or sys.platform.startswith('openbsd'):
includes.append('sys/ttycom.h')
Expand All @@ -56,40 +65,40 @@

eci = ExternalCompilationInfo(
includes=includes,

@@ -2094,6 +2094,8 @@
locals()['HAVE_%s' % _name.upper()] = rffi_platform.Has(_name)
cConfig = rffi_platform.configure(CConfig)
@@ -2179,6 +2179,8 @@ if _LINUX:
# always returns an error.
cConfig["HAVE_LCHMOD"] = False
globals().update(cConfig)
+# Remove faccessat, linkat
+HAVE_FACCESSAT = HAVE_LINKAT = False

if not _WIN32:
class CConfig:

diff --git a/rpython/rlib/rtime.py b/rpython/rlib/rtime.py
index 2cc070daef..4fcc1a311c 100644
--- a/rpython/rlib/rtime.py
+++ b/rpython/rlib/rtime.py
@@ -29,10 +29,6 @@
@@ -29,10 +29,6 @@ else:
'sys/types.h', 'unistd.h',
'sys/time.h', 'sys/resource.h']

- if not sys.platform.startswith("openbsd") and \
- not sys.platform.startswith("freebsd"):
- includes.append('sys/timeb.h')
-
need_rusage = True


@@ -51,7 +47,7 @@
@@ -58,7 +54,7 @@ class CConfig:
if sys.platform.startswith('freebsd') or sys.platform.startswith('netbsd'):
libraries = ['compat']
elif sys.platform == 'linux2':
- libraries = ['rt']
+ libraries = ['c']
else:
libraries = []

@@ -198,7 +194,7 @@
@@ -209,7 +205,7 @@ if HAS_CLOCK_GETTIME_RUNTIME:
# do we need to add -lrt?
eciclock = CConfigForClockGetTime._compilation_info_
if not _NO_MISSING_RT:
Expand All @@ -98,4 +107,3 @@
# the functions:
c_clock_getres = external("clock_getres",
[lltype.Signed, lltype.Ptr(TIMESPEC)],

114 changes: 53 additions & 61 deletions packages/pypy3/0005-fix-unavailable-functions.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
diff --git a/lib-python/3/http/server.py b/lib-python/3/http/server.py
index da07f110f1..f87045d8c9 100644
--- a/lib-python/3/http/server.py
+++ b/lib-python/3/http/server.py
@@ -1161,10 +1161,6 @@
@@ -1182,10 +1182,6 @@ class CGIHTTPRequestHandler(SimpleHTTPRequestHandler):
return
# Child
try:
Expand All @@ -11,58 +13,58 @@
os.dup2(self.rfile.fileno(), 0)
os.dup2(self.wfile.fileno(), 1)
os.execve(scriptfile, args, env)

diff --git a/lib_pypy/_pwdgrp_build.py b/lib_pypy/_pwdgrp_build.py
index ddd32f3956..a70106ddae 100644
--- a/lib_pypy/_pwdgrp_build.py
+++ b/lib_pypy/_pwdgrp_build.py
@@ -35,9 +35,9 @@
@@ -35,10 +35,6 @@ struct group {
struct passwd *getpwuid(uid_t uid);
struct passwd *getpwnam(const char *name);

-struct passwd *getpwent(void);
-void setpwent(void);
-void endpwent(void);
+// struct passwd *getpwent(void);
+// void setpwent(void);
+// void endpwent(void);

-
struct group *getgrgid(gid_t gid);
struct group *getgrnam(const char *name);


diff --git a/lib-python/3/smtpd.py b/lib-python/3/smtpd.py
index b23579f120..dcf8c502dd 100755
--- a/lib-python/3/smtpd.py
+++ b/lib-python/3/smtpd.py
@@ -9,7 +9,8 @@
@@ -9,7 +9,8 @@ Options:
-n
This program generally tries to setuid `nobody', unless this flag is
set. The setuid call will fail if this program is not run as root (in
- which case, use this flag).
+ which case, use this flag). Ignored in Termux as no setuid done on this
+ platform.

--version
-V
@@ -861,7 +862,7 @@


@@ -781,7 +782,7 @@ class PureProxy(SMTPServer):
class Options:
- setuid = True
+ setuid = False
classname = 'PureProxy'
size_limit = None
enable_SMTPUTF8 = False


diff --git a/pypy/module/pwd/interp_pwd.py b/pypy/module/pwd/interp_pwd.py
index 413aa41056..3d07f5459f 100644
--- a/pypy/module/pwd/interp_pwd.py
+++ b/pypy/module/pwd/interp_pwd.py
@@ -19,18 +19,25 @@
@@ -19,18 +19,25 @@ config = rffi_platform.configure(CConfig)
uid_t = config['uid_t']
gid_t = config['gid_t']

-class CConfig:
- _compilation_info_ = eci
+# Android bionic libc has a different define for passwd.
+# On LP32, it defines pw_gecos to pw_passwd since they're both NULL.
+DEFINED__LP64__ = rffi_platform.getdefined('__LP64__', '')

- passwd = rffi_platform.Struct(
- 'struct passwd',
- [('pw_name', rffi.CCHARP),
Expand All @@ -82,11 +84,11 @@
+ _compilation_info_ = eci
+
+ passwd = rffi_platform.Struct('struct passwd', fields)

config = rffi_platform.configure(CConfig)

@@ -42,9 +49,10 @@

@@ -42,9 +49,10 @@ def external(name, args, result, **kwargs):
c_getpwuid = external("getpwuid", [uid_t], passwd_p)
c_getpwnam = external("getpwnam", [rffi.CCHARP], passwd_p)
-c_setpwent = external("setpwent", [], lltype.Void)
Expand All @@ -96,10 +98,10 @@
+# c_setpwent = external("setpwent", [], lltype.Void)
+# c_getpwent = external("getpwent", [], passwd_p)
+# c_endpwent = external("endpwent", [], lltype.Void)


def uid_converter(space, w_uid):
@@ -80,7 +88,7 @@
@@ -80,7 +88,7 @@ def make_struct_passwd(space, pw):
space.newtext(rffi.charp2str(pw.c_pw_passwd)),
space.int(space.newint(pw.c_pw_uid)),
space.int(space.newint(pw.c_pw_gid)),
Expand All @@ -108,10 +110,10 @@
space.newtext(rffi.charp2str(pw.c_pw_dir)),
space.newtext(rffi.charp2str(pw.c_pw_shell)),
])
@@ -120,15 +128,15 @@
@@ -120,15 +128,3 @@ def getpwnam(space, name):
raise oefmt(space.w_KeyError, "getpwnam(): name not found: %s", name)
return make_struct_passwd(space, pw)

-def getpwall(space):
- users_w = []
- c_setpwent()
Expand All @@ -124,63 +126,51 @@
- finally:
- c_endpwent()
- return space.newlist(users_w)
+# def getpwall(space):
+# users_w = []
+# c_setpwent()
+# try:
+# while True:
+# pw = c_getpwent()
+# if not pw:
+# break
+# users_w.append(make_struct_passwd(space, pw))
+# finally:
+# c_endpwent()
+# return space.newlist(users_w)

diff --git a/pypy/module/pwd/moduledef.py b/pypy/module/pwd/moduledef.py
index b9c3f7114a..d7dc42847c 100644
--- a/pypy/module/pwd/moduledef.py
+++ b/pypy/module/pwd/moduledef.py
@@ -15,11 +15,11 @@
@@ -15,11 +15,9 @@ class Module(MixedModule):
interpleveldefs = {
'getpwuid': 'interp_pwd.getpwuid',
'getpwnam': 'interp_pwd.getpwnam',
- 'getpwall': 'interp_pwd.getpwall',
+ # 'getpwall': 'interp_pwd.getpwall',
}

appleveldefs = {
'struct_passwd': 'app_pwd.struct_passwd',
- 'struct_pwent': 'app_pwd.struct_passwd',
+ # 'struct_pwent': 'app_pwd.struct_passwd',
}


diff --git a/rpython/rlib/rvmprof/cintf.py b/rpython/rlib/rvmprof/cintf.py
index 4486fd0196..a2b1385710 100644
--- a/rpython/rlib/rvmprof/cintf.py
+++ b/rpython/rlib/rvmprof/cintf.py
@@ -16,14 +16,14 @@
@@ -18,18 +18,9 @@ from rpython.jit.backend import detect_cpu
class VMProfPlatformUnsupported(Exception):
pass

-# vmprof works only on x86 for now
+# vmprof cannot compile on termux due to no dlinfo on Bionic Libc
IS_SUPPORTED = False
NATIVE_PROFILING_SUPPORTED = False
-if sys.platform in ('darwin', 'linux', 'linux2') or sys.platform.startswith('freebsd'):
- try:
- proc = detect_cpu.autodetect()
- IS_SUPPORTED = proc.startswith('x86') or proc == 'aarch64'
- IS_SUPPORTED = (proc.startswith('x86')
- or proc == 'aarch64'
- or proc == 'riscv64')
- NATIVE_PROFILING_SUPPORTED = proc.startswith('x86')
- except detect_cpu.ProcessorAutodetectError:
- print("PROCESSOR NOT DETECTED, SKIPPING VMPROF")
+# if sys.platform in ('darwin', 'linux', 'linux2') or sys.platform.startswith('freebsd'):
+# try:
+# proc = detect_cpu.autodetect()
+# IS_SUPPORTED = proc.startswith('x86') or proc == 'aarch64'
+# except detect_cpu.ProcessorAutodetectError:
+# print("PROCESSOR NOT DETECTED, SKIPPING VMPROF")


ROOT = py.path.local(rpythonroot).join('rpython', 'rlib', 'rvmprof')
SRC = ROOT.join('src')

diff --git a/pypy/module/posix/moduledef.py b/pypy/module/posix/moduledef.py
index 6e92b3199d..7b5b81559f 100644
--- a/pypy/module/posix/moduledef.py
+++ b/pypy/module/posix/moduledef.py
@@ -140,12 +140,12 @@
@@ -142,12 +142,12 @@ corresponding Unix manual entries for more information on calls."""
interpleveldefs['pathconf_names'] = 'space.wrap(interp_posix.pathconf_names())'
if hasattr(os, 'pathconf'):
interpleveldefs['pathconf'] = 'interp_posix.pathconf'
Expand All @@ -195,14 +185,16 @@
interpleveldefs['getloadavg'] = 'interp_posix.getloadavg'
if hasattr(os, 'makedev'):
interpleveldefs['makedev'] = 'interp_posix.makedev'
diff --git a/rpython/rlib/rposix.py b/rpython/rlib/rposix.py
index e96571e342..1dd8055a12 100644
--- a/rpython/rlib/rposix.py
+++ b/rpython/rlib/rposix.py
@@ -3049,7 +3049,7 @@
@@ -3096,7 +3098,7 @@ elif not _WIN32:
# ____________________________________________________________
# Support for *xattr functions

-if sys.platform.startswith('linux'):
+if False:

class CConfig:
_compilation_info_ = ExternalCompilationInfo(
11 changes: 11 additions & 0 deletions packages/pypy3/0006-do-not-try-to-get-L2-cache-on-aarch64.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/rpython/memory/gc/env.py
+++ b/rpython/memory/gc/env.py
@@ -140,7 +140,7 @@
return get_L2cache_linux2_cpuinfo(label='L2 cache')
#if arch == 's390x': untested
# return get_L2cache_linux2_cpuinfo_s390x()
- if arch in ('ia64', 'aarch64'):
+ if arch in ('ia64'):
return get_L2cache_linux2_system_cpu_index()
if arch in ('parisc', 'parisc64'):
return get_L2cache_linux2_cpuinfo(label='D-cache')
Loading