redox/recipes/wip/dev/python315/redox.patch
2026-05-07 13:10:21 +07:00

135 lines
4.5 KiB
Diff

diff -ruwN source/configure source-new/configure
--- source/configure 2026-04-07 18:24:03.000000000 +0700
+++ source-new/configure 2026-05-07 12:19:48.765197728 +0700
@@ -4163,6 +4163,9 @@
*-*-wasi*)
ac_sys_system=WASI
;;
+ *-*-redox*)
+ ac_sys_system=Redox
+ ;;
*)
# for now, limit cross builds to known configurations
MACHDEP="unknown"
@@ -4189,6 +4192,7 @@
freebsd*) MACHDEP="freebsd";;
linux-android*) MACHDEP="android";;
linux*) MACHDEP="linux";;
+ redox*) MACHDEP="redox";;
cygwin*) MACHDEP="cygwin";;
darwin*) MACHDEP="darwin";;
'') MACHDEP="unknown";;
@@ -4615,7 +4619,7 @@
if test "$cross_compiling" = yes; then
case "$host" in
- *-*-linux*)
+ *-*-linux*|*-*-redox*)
case "$host_cpu" in
arm*)
_host_ident=arm
@@ -7771,7 +7775,7 @@
PY3LIBRARY=libpython3.so
fi
;;
- Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*|VxWorks*)
+ Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*|Redox*|VxWorks*)
LDLIBRARY='libpython$(LDVERSION).so'
BLDLIBRARY='-L. -lpython$(LDVERSION)'
RUNSHARED=LD_LIBRARY_PATH=`pwd`${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
@@ -13777,7 +13781,7 @@
Emscripten*|WASI*)
LDSHARED='$(CC) -shared'
LDCXXSHARED='$(CXX) -shared';;
- Linux*|GNU*|QNX*|VxWorks*|Haiku*)
+ Linux*|GNU*|QNX*|VxWorks*|Haiku*|Redox*)
LDSHARED='$(CC) -shared'
LDCXXSHARED='$(CXX) -shared';;
FreeBSD*)
@@ -13862,7 +13866,7 @@
then CCSHARED="-fPIC";
else CCSHARED="+z";
fi;;
- Linux*|GNU*) CCSHARED="-fPIC";;
+ Linux*|GNU*|Redox*) CCSHARED="-fPIC";;
Emscripten*|WASI*)
if test "x$enable_wasm_dynamic_linking" = xyes
then :
@@ -13900,7 +13904,7 @@
LINKFORSHARED="-Wl,-E -Wl,+s";;
# LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";;
Linux-android*) LINKFORSHARED="-pie -Xlinker -export-dynamic";;
- Linux*|GNU*) LINKFORSHARED="-Xlinker -export-dynamic";;
+ Linux*|GNU*|Redox*) LINKFORSHARED="-Xlinker -export-dynamic";;
# -u libsys_s pulls in all symbols in libsys
Darwin/*|iOS/*)
LINKFORSHARED="$extra_undefs -framework CoreFoundation"
diff -ruwN source/Include/internal/pycore_time.h source-new/Include/internal/pycore_time.h
--- source/Include/internal/pycore_time.h 2026-04-07 18:24:03.000000000 +0700
+++ source-new/Include/internal/pycore_time.h 2026-05-07 12:55:06.797297037 +0700
@@ -49,6 +49,10 @@
#ifndef Py_INTERNAL_TIME_H
#define Py_INTERNAL_TIME_H
+
+// FIXME: where timeval should be declared from?
+# include <sys/time.h>
+
#ifdef __cplusplus
extern "C" {
#endif
diff -ruwN source/Include/pyport.h source-new/Include/pyport.h
--- source/Include/pyport.h 2026-04-07 18:24:03.000000000 +0700
+++ source-new/Include/pyport.h 2026-05-07 12:16:56.305047939 +0700
@@ -541,7 +541,7 @@
# endif
#endif
-#if defined(__ANDROID__) || defined(__VXWORKS__)
+#if defined(__ANDROID__) || defined(__VXWORKS__) || defined(__redox__)
// Use UTF-8 as the locale encoding, ignore the LC_CTYPE locale.
// See _Py_GetLocaleEncoding(), PyUnicode_DecodeLocale()
// and PyUnicode_EncodeLocale().
diff -ruwN source/Modules/posixmodule.c source-new/Modules/posixmodule.c
--- source/Modules/posixmodule.c 2026-04-07 18:24:03.000000000 +0700
+++ source-new/Modules/posixmodule.c 2026-05-07 12:57:16.208883903 +0700
@@ -11253,7 +11253,7 @@
struct tms process;
clock_t elapsed;
errno = 0;
- elapsed = times(&process);
+ elapsed = (clock_t) -1;
if (elapsed == (clock_t) -1) {
return posix_error();
}
diff -ruwN source/Modules/resource.c source-new/Modules/resource.c
--- source/Modules/resource.c 2026-04-07 18:24:03.000000000 +0700
+++ source-new/Modules/resource.c 2026-05-07 12:16:56.305184305 +0700
@@ -245,7 +245,7 @@
{
struct rlimit rl;
- if (resource < 0 || resource >= RLIM_NLIMITS) {
+ if (resource < 0 || resource >= RLIMIT_NLIMITS) {
PyErr_SetString(PyExc_ValueError,
"invalid resource specified");
return NULL;
@@ -273,7 +273,7 @@
{
struct rlimit rl;
- if (resource < 0 || resource >= RLIM_NLIMITS) {
+ if (resource < 0 || resource >= RLIMIT_NLIMITS) {
PyErr_SetString(PyExc_ValueError,
"invalid resource specified");
return NULL;
@@ -321,7 +321,7 @@
struct rlimit old_limit, new_limit;
int retval;
- if (resource < 0 || resource >= RLIM_NLIMITS) {
+ if (resource < 0 || resource >= RLIMIT_NLIMITS) {
PyErr_SetString(PyExc_ValueError,
"invalid resource specified");
return NULL;