diff -ruwN source/configure source-new/configure --- source/configure 2025-10-09 18:07:00.000000000 +0700 +++ source-new/configure 2025-12-09 22:14:30.781035339 +0700 @@ -4283,6 +4283,9 @@ *-*-wasi) ac_sys_system=WASI ;; + *-*-redox*) + ac_sys_system=Redox + ;; *) # for now, limit cross builds to known configurations MACHDEP="unknown" @@ -4307,6 +4310,7 @@ case $MACHDEP in aix*) MACHDEP="aix";; linux*) MACHDEP="linux";; + redox*) MACHDEP="redox";; cygwin*) MACHDEP="cygwin";; darwin*) MACHDEP="darwin";; '') MACHDEP="unknown";; @@ -4327,7 +4331,7 @@ if test "$cross_compiling" = yes; then case "$host" in - *-*-linux*) + *-*-linux*|*-*-redox*) case "$host_cpu" in arm*) _host_cpu=arm @@ -6762,6 +6766,7 @@ #undef cris #undef fr30 #undef linux +#undef redox #undef hppa #undef hpux #undef i386 @@ -6907,6 +6912,18 @@ # endif #elif defined(__gnu_hurd__) i386-gnu +#elif defined(__redox__) +# if defined(__x86_64__) + x86_64-redox +# elif defined(__i386__) + i386-redox +# elif defined(__aarch64__) + aarch64-redox +# elif defined(__riscv) + riscv64-redox +# else +# error unknown platform triplet +# endif #elif defined(__APPLE__) darwin #elif defined(__VXWORKS__) @@ -7507,7 +7524,7 @@ PY3LIBRARY=libpython3.so fi ;; - Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*|VxWorks*) + Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*|VxWorks*|Redox*) LDLIBRARY='libpython$(LDVERSION).so' BLDLIBRARY='-L. -lpython$(LDVERSION)' RUNSHARED=LD_LIBRARY_PATH=`pwd`${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} @@ -12815,7 +12832,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*) @@ -12901,7 +12918,7 @@ else CCSHARED="+z"; fi;; Linux-android*) ;; - Linux*|GNU*) CCSHARED="-fPIC";; + Linux*|GNU*|Redox*) CCSHARED="-fPIC";; Emscripten*|WASI*) if test "x$enable_wasm_dynamic_linking" = xyes then : @@ -12939,7 +12956,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/*) LINKFORSHARED="$extra_undefs -framework CoreFoundation" diff -ruwN source/Include/pyport.h source-new/Include/pyport.h --- source/Include/pyport.h 2025-10-09 18:07:00.000000000 +0700 +++ source-new/Include/pyport.h 2025-12-09 22:14:30.781035339 +0700 @@ -684,7 +684,7 @@ # error "Py_TRACE_REFS ABI is not compatible with release and debug ABI" #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/_cryptmodule.c source-new/Modules/_cryptmodule.c --- source/Modules/_cryptmodule.c 2025-10-09 18:07:00.000000000 +0700 +++ source-new/Modules/_cryptmodule.c 2025-12-09 22:14:30.781035339 +0700 @@ -38,13 +38,7 @@ /*[clinic end generated code: output=0512284a03d2803c input=0e8edec9c364352b]*/ { char *crypt_result; -#ifdef HAVE_CRYPT_R - struct crypt_data data; - memset(&data, 0, sizeof(data)); - crypt_result = crypt_r(word, salt, &data); -#else crypt_result = crypt(word, salt); -#endif if (crypt_result == NULL) { return PyErr_SetFromErrno(PyExc_OSError); } diff -ruwN source/Modules/resource.c source-new/Modules/resource.c --- source/Modules/resource.c 2025-10-09 18:07:00.000000000 +0700 +++ source-new/Modules/resource.c 2025-12-09 22:14:30.781035339 +0700 @@ -216,7 +216,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; @@ -244,7 +244,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; @@ -292,7 +292,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;