From 51b426c2703e4f12616b14a9315cb024b5c2d16e Mon Sep 17 00:00:00 2001 From: archibate <1931127624@qq.com> Date: Sat, 27 Aug 2022 01:00:44 +0800 Subject: [PATCH 01/17] j --- cmake/ConfigureChecks.cmake | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/cmake/ConfigureChecks.cmake b/cmake/ConfigureChecks.cmake index a57ee8315..30748dba4 100644 --- a/cmake/ConfigureChecks.cmake +++ b/cmake/ConfigureChecks.cmake @@ -2768,16 +2768,17 @@ endif() ########################################################## if(ZLIB_LIBRARIES) - cmake_push_check_state() - set(CFG_HEADERS_SAVE ${CFG_HEADERS}) + #cmake_push_check_state() + #set(CFG_HEADERS_SAVE ${CFG_HEADERS}) - set(CFG_HEADERS ${CFG_HEADERS} zlib.h) - add_cond(CMAKE_REQUIRED_INCLUDES ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIRS}) - add_cond(CMAKE_REQUIRED_LIBRARIES ZLIB_LIBRARIES ${ZLIB_LIBRARIES}) - check_symbol_exists(inflateCopy "${CFG_HEADERS}" HAVE_ZLIB_COPY) + #set(CFG_HEADERS ${CFG_HEADERS} zlib.h) + #add_cond(CMAKE_REQUIRED_INCLUDES ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIRS}) + #add_cond(CMAKE_REQUIRED_LIBRARIES ZLIB_LIBRARIES ${ZLIB_LIBRARIES}) + #check_symbol_exists(inflateCopy "${CFG_HEADERS}" HAVE_ZLIB_COPY) +set(HAVE_ZLIB_COPY ON CACHE BOOL "ZENOCIHOUPYTHON" FORCE) - set(CFG_HEADERS ${CFG_HEADERS_SAVE}) - cmake_pop_check_state() + #set(CFG_HEADERS ${CFG_HEADERS_SAVE}) + #cmake_pop_check_state() endif() # Check if tirpc static library and its dependencies can be linked statically From 8ce42ce18c984368036eededc83a8d31ecd19b8c Mon Sep 17 00:00:00 2001 From: archibate <1931127624@qq.com> Date: Tue, 6 Sep 2022 00:50:56 +0800 Subject: [PATCH 02/17] mabillgatespiyan --- cmake/ConfigureChecks.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmake/ConfigureChecks.cmake b/cmake/ConfigureChecks.cmake index 30748dba4..31bceee0f 100644 --- a/cmake/ConfigureChecks.cmake +++ b/cmake/ConfigureChecks.cmake @@ -270,6 +270,9 @@ check_include_files(grp.h HAVE_GRP_H) check_include_files(ieeefp.h HAVE_IEEEFP_H) check_include_files(inttypes.h HAVE_INTTYPES_H) # libffi and cpython check_include_files(io.h HAVE_IO_H) +if (WIN32) + set(HAVE_IO_H ON CACHE BOOL "ZENOCIHOUPYTHON" FORCE) +endif() check_include_files(langinfo.h HAVE_LANGINFO_H) check_include_files(libintl.h HAVE_LIBINTL_H) check_include_files(libutil.h HAVE_LIBUTIL_H) From e8e46ee32125256c0fe807aae86c0146bf99ac6d Mon Sep 17 00:00:00 2001 From: archibate <1931127624@qq.com> Date: Tue, 6 Sep 2022 14:51:56 +0800 Subject: [PATCH 03/17] add 3.9 msi patch --- ...event-missing-include-of-io.h-found-in-msi-.patch | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 patches/3.9/0001-Prevent-missing-include-of-io.h-found-in-msi-.patch diff --git a/patches/3.9/0001-Prevent-missing-include-of-io.h-found-in-msi-.patch b/patches/3.9/0001-Prevent-missing-include-of-io.h-found-in-msi-.patch new file mode 100644 index 000000000..8f28f88c4 --- /dev/null +++ b/patches/3.9/0001-Prevent-missing-include-of-io.h-found-in-msi-.patch @@ -0,0 +1,12 @@ +--- a/PC/_msi.c ++++ b/PC/_msi.c +@@ -4,6 +4,9 @@ + */ + + #include ++#ifdef _WIN32 ++#include ++#endif + #include + #include + #include From aaee2340f1649ca842d210a91026981fdb390165 Mon Sep 17 00:00:00 2001 From: archibate <1931127624@qq.com> Date: Tue, 6 Sep 2022 23:11:26 +0800 Subject: [PATCH 04/17] update patch --- ...missing-include-of-io.h-found-in-msi-.patch | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/patches/3.9/0001-Prevent-missing-include-of-io.h-found-in-msi-.patch b/patches/3.9/0001-Prevent-missing-include-of-io.h-found-in-msi-.patch index 8f28f88c4..af07a6471 100644 --- a/patches/3.9/0001-Prevent-missing-include-of-io.h-found-in-msi-.patch +++ b/patches/3.9/0001-Prevent-missing-include-of-io.h-found-in-msi-.patch @@ -1,12 +1,12 @@ --- a/PC/_msi.c +++ b/PC/_msi.c -@@ -4,6 +4,9 @@ - */ +@@ -174,8 +174,8 @@ + FileTimeToLocalFileTime(&bhfi.ftLastWriteTime, &filetime); + FileTimeToDosDateTime(&filetime, pdate, ptime); - #include -+#ifdef _WIN32 -+#include -+#endif - #include - #include - #include +- *pattribs = (int)(bhfi.dwFileAttributes & +- (_A_RDONLY | _A_SYSTEM | _A_HIDDEN | _A_ARCH)); ++ *pattribs = (int)(bhfi.dwFileAttributes & 39; ++ /*(_A_RDONLY | _A_SYSTEM | _A_HIDDEN | _A_ARCH));*/ + + CloseHandle(handle); From 7a2a5b27ad9d8ae1a35811cd4c8b29bb196a24c3 Mon Sep 17 00:00:00 2001 From: archibate <1931127624@qq.com> Date: Wed, 7 Sep 2022 03:07:20 +0800 Subject: [PATCH 05/17] mabidediff --- .../3.9/0001-Prevent-missing-include-of-io.h-found-in-msi-.patch | 1 + 1 file changed, 1 insertion(+) diff --git a/patches/3.9/0001-Prevent-missing-include-of-io.h-found-in-msi-.patch b/patches/3.9/0001-Prevent-missing-include-of-io.h-found-in-msi-.patch index af07a6471..63aba7077 100644 --- a/patches/3.9/0001-Prevent-missing-include-of-io.h-found-in-msi-.patch +++ b/patches/3.9/0001-Prevent-missing-include-of-io.h-found-in-msi-.patch @@ -10,3 +10,4 @@ + /*(_A_RDONLY | _A_SYSTEM | _A_HIDDEN | _A_ARCH));*/ CloseHandle(handle); + From 9da01e88becc2dc7e1848f6a19638322d811d0a5 Mon Sep 17 00:00:00 2001 From: archibate <1931127624@qq.com> Date: Wed, 7 Sep 2022 15:04:35 +0800 Subject: [PATCH 06/17] fuckpatch --- .../0001-Prevent-missing-include-of-io.h-found-in-msi-.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patches/3.9/0001-Prevent-missing-include-of-io.h-found-in-msi-.patch b/patches/3.9/0001-Prevent-missing-include-of-io.h-found-in-msi-.patch index 63aba7077..6e3648cd0 100644 --- a/patches/3.9/0001-Prevent-missing-include-of-io.h-found-in-msi-.patch +++ b/patches/3.9/0001-Prevent-missing-include-of-io.h-found-in-msi-.patch @@ -6,7 +6,7 @@ - *pattribs = (int)(bhfi.dwFileAttributes & - (_A_RDONLY | _A_SYSTEM | _A_HIDDEN | _A_ARCH)); -+ *pattribs = (int)(bhfi.dwFileAttributes & 39; ++ *pattribs = (int)(bhfi.dwFileAttributes & 39); + /*(_A_RDONLY | _A_SYSTEM | _A_HIDDEN | _A_ARCH));*/ CloseHandle(handle); From ba5e86206031036f22ef25fbab2efe266ff20bc2 Mon Sep 17 00:00:00 2001 From: archibate <1931127624@qq.com> Date: Wed, 7 Sep 2022 15:18:26 +0800 Subject: [PATCH 07/17] updatepatch --- cmake/ConfigureChecks.cmake | 3 --- ...vent-missing-include-of-io.h-found-in-msi-.patch | 13 +++++++++++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/cmake/ConfigureChecks.cmake b/cmake/ConfigureChecks.cmake index 31bceee0f..30748dba4 100644 --- a/cmake/ConfigureChecks.cmake +++ b/cmake/ConfigureChecks.cmake @@ -270,9 +270,6 @@ check_include_files(grp.h HAVE_GRP_H) check_include_files(ieeefp.h HAVE_IEEEFP_H) check_include_files(inttypes.h HAVE_INTTYPES_H) # libffi and cpython check_include_files(io.h HAVE_IO_H) -if (WIN32) - set(HAVE_IO_H ON CACHE BOOL "ZENOCIHOUPYTHON" FORCE) -endif() check_include_files(langinfo.h HAVE_LANGINFO_H) check_include_files(libintl.h HAVE_LIBINTL_H) check_include_files(libutil.h HAVE_LIBUTIL_H) diff --git a/patches/3.9/0001-Prevent-missing-include-of-io.h-found-in-msi-.patch b/patches/3.9/0001-Prevent-missing-include-of-io.h-found-in-msi-.patch index 6e3648cd0..014ff452e 100644 --- a/patches/3.9/0001-Prevent-missing-include-of-io.h-found-in-msi-.patch +++ b/patches/3.9/0001-Prevent-missing-include-of-io.h-found-in-msi-.patch @@ -11,3 +11,16 @@ CloseHandle(handle); +--- a/Modules/posixmodule.c ++++ b/Modules/posixmodule.c +@@ -414,9 +414,7 @@ + # ifdef HAVE_DIRECT_H + # include + # endif +-# ifdef HAVE_IO_H +-# include +-# endif ++# include + # ifdef HAVE_PROCESS_H + # include + # endif From fe2ca66a54e13ffb6c1d10ae3ce33c34b2e80035 Mon Sep 17 00:00:00 2001 From: archibate <1931127624@qq.com> Date: Wed, 7 Sep 2022 15:50:15 +0800 Subject: [PATCH 08/17] fuckwendous --- ...issing-include-of-io.h-found-in-msi-.patch | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/patches/3.9/0001-Prevent-missing-include-of-io.h-found-in-msi-.patch b/patches/3.9/0001-Prevent-missing-include-of-io.h-found-in-msi-.patch index 014ff452e..5bedc913a 100644 --- a/patches/3.9/0001-Prevent-missing-include-of-io.h-found-in-msi-.patch +++ b/patches/3.9/0001-Prevent-missing-include-of-io.h-found-in-msi-.patch @@ -13,14 +13,14 @@ --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c -@@ -414,9 +414,7 @@ - # ifdef HAVE_DIRECT_H - # include - # endif --# ifdef HAVE_IO_H --# include --# endif -+# include - # ifdef HAVE_PROCESS_H - # include - # endif +@@ -308,8 +308,8 @@ + # define HAVE_PIPE 1 + # define HAVE_SYSTEM 1 + # define HAVE_CWAIT 1 +-/*# define HAVE_FSYNC 1*/ +-/*# define fsync _commit*/ ++# define HAVE_FSYNC 1 ++# define fsync _commit + # else + /* Unix functions that the configure script doesn't check for */ + # ifndef __VXWORKS__ From d018f66b133b22da1f8eba7d43f540600c99eb78 Mon Sep 17 00:00:00 2001 From: archibate <1931127624@qq.com> Date: Wed, 7 Sep 2022 15:53:27 +0800 Subject: [PATCH 09/17] 1 --- ...01-Prevent-missing-include-of-io.h-found-in-msi-.patch | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/patches/3.9/0001-Prevent-missing-include-of-io.h-found-in-msi-.patch b/patches/3.9/0001-Prevent-missing-include-of-io.h-found-in-msi-.patch index 5bedc913a..ae41c948a 100644 --- a/patches/3.9/0001-Prevent-missing-include-of-io.h-found-in-msi-.patch +++ b/patches/3.9/0001-Prevent-missing-include-of-io.h-found-in-msi-.patch @@ -17,10 +17,10 @@ # define HAVE_PIPE 1 # define HAVE_SYSTEM 1 # define HAVE_CWAIT 1 --/*# define HAVE_FSYNC 1*/ --/*# define fsync _commit*/ -+# define HAVE_FSYNC 1 -+# define fsync _commit +-# define HAVE_FSYNC 1 +-# define fsync _commit ++/*# define HAVE_FSYNC 1*/ ++/*# define fsync _commit*/ # else /* Unix functions that the configure script doesn't check for */ # ifndef __VXWORKS__ From 85d427f99de15596de9d1b9172e7554d72ff681b Mon Sep 17 00:00:00 2001 From: archibate <1931127624@qq.com> Date: Thu, 8 Sep 2022 01:27:40 +0800 Subject: [PATCH 10/17] updpatch --- ...revent-missing-include-of-io.h-found-in-msi-.patch | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/patches/3.9/0001-Prevent-missing-include-of-io.h-found-in-msi-.patch b/patches/3.9/0001-Prevent-missing-include-of-io.h-found-in-msi-.patch index ae41c948a..ae05b1703 100644 --- a/patches/3.9/0001-Prevent-missing-include-of-io.h-found-in-msi-.patch +++ b/patches/3.9/0001-Prevent-missing-include-of-io.h-found-in-msi-.patch @@ -24,3 +24,14 @@ # else /* Unix functions that the configure script doesn't check for */ # ifndef __VXWORKS__ +--- a/Modules/_winapi.c ++++ a/Modules/_winapi.c +@@ -304,7 +304,7 @@ + {NULL} + }; + +-PyTypeObject OverlappedType = { ++static PyTypeObject OverlappedType = { + PyVarObject_HEAD_INIT(NULL, 0) + /* tp_name */ "_winapi.Overlapped", + /* tp_basicsize */ sizeof(OverlappedObject), From aed056979d6675a076ce17880b334abf8aecc7f8 Mon Sep 17 00:00:00 2001 From: archibate <1931127624@qq.com> Date: Thu, 8 Sep 2022 16:02:48 +0800 Subject: [PATCH 11/17] updatepatch --- ...issing-include-of-io.h-found-in-msi-.patch | 70 +++++++++++++++---- 1 file changed, 58 insertions(+), 12 deletions(-) diff --git a/patches/3.9/0001-Prevent-missing-include-of-io.h-found-in-msi-.patch b/patches/3.9/0001-Prevent-missing-include-of-io.h-found-in-msi-.patch index ae05b1703..8b6c2dca8 100644 --- a/patches/3.9/0001-Prevent-missing-include-of-io.h-found-in-msi-.patch +++ b/patches/3.9/0001-Prevent-missing-include-of-io.h-found-in-msi-.patch @@ -1,18 +1,17 @@ ---- a/PC/_msi.c -+++ b/PC/_msi.c -@@ -174,8 +174,8 @@ +--- a/PC/_msi.c 2022-09-08 15:57:12.205510328 +0800 ++++ b/PC/_msi.c 2022-09-08 15:57:42.597842635 +0800 +@@ -174,8 +174,7 @@ FileTimeToLocalFileTime(&bhfi.ftLastWriteTime, &filetime); FileTimeToDosDateTime(&filetime, pdate, ptime); - + - *pattribs = (int)(bhfi.dwFileAttributes & - (_A_RDONLY | _A_SYSTEM | _A_HIDDEN | _A_ARCH)); -+ *pattribs = (int)(bhfi.dwFileAttributes & 39); -+ /*(_A_RDONLY | _A_SYSTEM | _A_HIDDEN | _A_ARCH));*/ - ++ *pattribs = (int)(bhfi.dwFileAttributes & 39); /* _A_RDONLY | _A_SYSTEM | _A_HIDDEN | _A_ARCH = 39 */ + CloseHandle(handle); ---- a/Modules/posixmodule.c -+++ b/Modules/posixmodule.c +--- a/Modules/posixmodule.c 2022-09-08 15:56:51.851881539 +0800 ++++ b/Modules/posixmodule.c 2022-09-08 15:57:05.029367072 +0800 @@ -308,8 +308,8 @@ # define HAVE_PIPE 1 # define HAVE_SYSTEM 1 @@ -24,14 +23,61 @@ # else /* Unix functions that the configure script doesn't check for */ # ifndef __VXWORKS__ ---- a/Modules/_winapi.c -+++ a/Modules/_winapi.c +--- a/Modules/_winapi.c 2022-09-08 15:54:25.084773865 +0800 ++++ b/Modules/_winapi.c 2022-09-08 15:54:50.474541290 +0800 +@@ -145,7 +145,7 @@ + + /*[clinic input] + module _winapi +-class _winapi.Overlapped "OverlappedObject *" "&OverlappedType" ++class _winapi.Overlapped "OverlappedObject *" "&WinApiOverlappedType" + [clinic start generated code]*/ + /*[clinic end generated code: output=da39a3ee5e6b4b0d input=c13d3f5fd1dabb84]*/ + @@ -304,7 +304,7 @@ {NULL} }; -PyTypeObject OverlappedType = { -+static PyTypeObject OverlappedType = { ++PyTypeObject WinApiOverlappedType = { PyVarObject_HEAD_INIT(NULL, 0) /* tp_name */ "_winapi.Overlapped", /* tp_basicsize */ sizeof(OverlappedObject), +@@ -350,7 +350,7 @@ + { + OverlappedObject *self; + +- self = PyObject_New(OverlappedObject, &OverlappedType); ++ self = PyObject_New(OverlappedObject, &WinApiOverlappedType); + if (!self) + return NULL; + self->handle = handle; +@@ -1941,7 +1941,7 @@ + PyObject *d; + PyObject *m; + +- if (PyType_Ready(&OverlappedType) < 0) ++ if (PyType_Ready(&WinApiOverlappedType) < 0) + return NULL; + + m = PyModule_Create(&winapi_module); +@@ -1949,7 +1949,7 @@ + return NULL; + d = PyModule_GetDict(m); + +- PyDict_SetItemString(d, "Overlapped", (PyObject *) &OverlappedType); ++ PyDict_SetItemString(d, "Overlapped", (PyObject *) &WinApiOverlappedType); + + /* constants */ + WINAPI_CONSTANT(F_DWORD, CREATE_NEW_CONSOLE); +--- a/Modules/_decimal/libmpdec/mpdecimal.c 2022-09-08 15:59:03.704908109 +0800 ++++ b/Modules/_decimal/libmpdec/mpdecimal.c 2022-09-08 15:59:15.807383050 +0800 +@@ -63,7 +63,7 @@ + + + #if defined(_MSC_VER) +- #define ALWAYS_INLINE __forceinline ++ #define ALWAYS_INLINE extern __forceinline + #elif defined(__IBMC__) || defined(LEGACY_COMPILER) + #define ALWAYS_INLINE + #undef inline From 9fd7e09ecd1a10dd2c594e172d07dee4a9dfa385 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BD=AD=E4=BA=8E=E6=96=8C?= <1931127624@qq.com> Date: Thu, 8 Sep 2022 16:09:09 +0800 Subject: [PATCH 12/17] Update cmake/ConfigureChecks.cmake --- cmake/ConfigureChecks.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/ConfigureChecks.cmake b/cmake/ConfigureChecks.cmake index 30748dba4..c2ffaa9bf 100644 --- a/cmake/ConfigureChecks.cmake +++ b/cmake/ConfigureChecks.cmake @@ -2775,7 +2775,7 @@ if(ZLIB_LIBRARIES) #add_cond(CMAKE_REQUIRED_INCLUDES ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIRS}) #add_cond(CMAKE_REQUIRED_LIBRARIES ZLIB_LIBRARIES ${ZLIB_LIBRARIES}) #check_symbol_exists(inflateCopy "${CFG_HEADERS}" HAVE_ZLIB_COPY) -set(HAVE_ZLIB_COPY ON CACHE BOOL "ZENOCIHOUPYTHON" FORCE) + set(HAVE_ZLIB_COPY ON CACHE BOOL "Assume Zlib have inflateCopy since checking inflateCopy would result in error during CMake configure" FORCE) #set(CFG_HEADERS ${CFG_HEADERS_SAVE}) #cmake_pop_check_state() From 19aeb68319ef69bdefe1ffeedd3ba97fb33329a0 Mon Sep 17 00:00:00 2001 From: archibate <1931127624@qq.com> Date: Thu, 8 Sep 2022 17:07:33 +0800 Subject: [PATCH 13/17] reupdatepatchforstaticalwaysinline --- ...1-Prevent-missing-include-of-io.h-found-in-msi-.patch | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/patches/3.9/0001-Prevent-missing-include-of-io.h-found-in-msi-.patch b/patches/3.9/0001-Prevent-missing-include-of-io.h-found-in-msi-.patch index 8b6c2dca8..124410231 100644 --- a/patches/3.9/0001-Prevent-missing-include-of-io.h-found-in-msi-.patch +++ b/patches/3.9/0001-Prevent-missing-include-of-io.h-found-in-msi-.patch @@ -81,3 +81,12 @@ #elif defined(__IBMC__) || defined(LEGACY_COMPILER) #define ALWAYS_INLINE #undef inline +@@ -517,7 +517,7 @@ + } + + /* Same as mpd_qresize, but do not set the result no NaN on failure. */ +-static ALWAYS_INLINE int ++ALWAYS_INLINE int + mpd_qresize_cxx(mpd_t *result, mpd_ssize_t nwords) + { + assert(!mpd_isconst_data(result)); /* illegal operation for a const */ From 8604daabf8958647b3f4c4faa83f358ad6697259 Mon Sep 17 00:00:00 2001 From: archibate <1931127624@qq.com> Date: Fri, 9 Sep 2022 02:57:38 +0800 Subject: [PATCH 14/17] tryfixviapr242 --- cmake/libpython/CMakeLists.txt | 16 +++++++--------- cmake/libpython/frozenmodules.c | 8 ++++++++ 2 files changed, 15 insertions(+), 9 deletions(-) create mode 100644 cmake/libpython/frozenmodules.c diff --git a/cmake/libpython/CMakeLists.txt b/cmake/libpython/CMakeLists.txt index 40d32f8c5..7b2b236bd 100644 --- a/cmake/libpython/CMakeLists.txt +++ b/cmake/libpython/CMakeLists.txt @@ -311,10 +311,6 @@ if(UNIX) list(APPEND PYTHON_COMMON_SOURCES ${SRC_DIR}/Python/frozenmain.c ) -else() - list(APPEND PYTHON_COMMON_SOURCES - ${SRC_DIR}/Python/frozen.c - ) endif() if(UNIX OR MINGW) @@ -457,10 +453,16 @@ endif() set(LIBPYTHON_FROZEN_SOURCES ) if(IS_PY3) +# Windows needs PyImport_FrozenModules declared... +if(WIN32) + set(FROZENMODULES_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/frozenmodules.c) +endif() + # Build _freeze_importlib executable add_executable(_freeze_importlib ${SRC_DIR}/Programs/_freeze_importlib.c ${LIBPYTHON_OMIT_FROZEN_SOURCES} + ${FROZENMODULES_SOURCE} ) target_link_libraries(_freeze_importlib ${LIBPYTHON_TARGET_LIBRARIES}) if(builtin_compile_definitions_without_py_limited_api) @@ -542,12 +544,8 @@ endif() set(LIBPYTHON_SOURCES ${LIBPYTHON_OMIT_FROZEN_SOURCES} ${LIBPYTHON_FROZEN_SOURCES} + ${SRC_DIR}/Python/frozen.c ) -if(UNIX) - list(APPEND LIBPYTHON_SOURCES - ${SRC_DIR}/Python/frozen.c - ) -endif() # Build python libraries function(add_libpython name type install component) diff --git a/cmake/libpython/frozenmodules.c b/cmake/libpython/frozenmodules.c new file mode 100644 index 000000000..821c10650 --- /dev/null +++ b/cmake/libpython/frozenmodules.c @@ -0,0 +1,8 @@ +/* Dummy frozen modules initializer for building _freeze_importlib + under MS Windows, as using the frozen.c from the Python + distribution results in a circular include of importlib.h +*/ +#include +#include + +const struct _frozen *PyImport_FrozenModules; From 18921e6c11c7c962374c09670f78269359ae8119 Mon Sep 17 00:00:00 2001 From: archibate <1931127624@qq.com> Date: Fri, 9 Sep 2022 15:52:45 +0800 Subject: [PATCH 15/17] cihoumpdecial --- ...vent-missing-include-of-io.h-found-in-msi-.patch | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/patches/3.9/0001-Prevent-missing-include-of-io.h-found-in-msi-.patch b/patches/3.9/0001-Prevent-missing-include-of-io.h-found-in-msi-.patch index 124410231..1eafc0118 100644 --- a/patches/3.9/0001-Prevent-missing-include-of-io.h-found-in-msi-.patch +++ b/patches/3.9/0001-Prevent-missing-include-of-io.h-found-in-msi-.patch @@ -90,3 +90,16 @@ mpd_qresize_cxx(mpd_t *result, mpd_ssize_t nwords) { assert(!mpd_isconst_data(result)); /* illegal operation for a const */ +--- a/Modules/_decimal/libmpdec/mpdecimal.h 2022-09-09 15:51:38.202653415 +0800 ++++ b/Modules/_decimal/libmpdec/mpdecimal.h 2022-09-09 15:52:07.611967326 +0800 +@@ -105,6 +105,10 @@ + /* Configuration */ + /******************************************************************************/ + ++#if !defined(CONFIG_64) && !defined(CONFIG_32) && !defined(UNIVERSAL) ++#define UNIVERSAL 1 ++#endif ++ + #if defined(UNIVERSAL) + #if defined(CONFIG_64) || defined(CONFIG_32) + #error "cannot use CONFIG_64 or CONFIG_32 with UNIVERSAL." From 4c4ae0dd559d31851a27c02347ce8587c6cfa906 Mon Sep 17 00:00:00 2001 From: archibate <1931127624@qq.com> Date: Fri, 9 Sep 2022 23:26:37 +0800 Subject: [PATCH 16/17] config64 --- .../0001-Prevent-missing-include-of-io.h-found-in-msi-.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patches/3.9/0001-Prevent-missing-include-of-io.h-found-in-msi-.patch b/patches/3.9/0001-Prevent-missing-include-of-io.h-found-in-msi-.patch index 1eafc0118..9bcf599ed 100644 --- a/patches/3.9/0001-Prevent-missing-include-of-io.h-found-in-msi-.patch +++ b/patches/3.9/0001-Prevent-missing-include-of-io.h-found-in-msi-.patch @@ -97,7 +97,7 @@ /******************************************************************************/ +#if !defined(CONFIG_64) && !defined(CONFIG_32) && !defined(UNIVERSAL) -+#define UNIVERSAL 1 ++#define CONFIG_64 1 +#endif + #if defined(UNIVERSAL) From b28c748e9d2e313c78fb055e33fcf0ba7552de33 Mon Sep 17 00:00:00 2001 From: archibate <1931127624@qq.com> Date: Thu, 16 Feb 2023 17:01:56 +0800 Subject: [PATCH 17/17] mabi --- cmake/Extensions.cmake | 2 ++ cmake/python/CMakeLists.txt | 3 +++ 2 files changed, 5 insertions(+) diff --git a/cmake/Extensions.cmake b/cmake/Extensions.cmake index d9adc80b1..a1d74ad39 100644 --- a/cmake/Extensions.cmake +++ b/cmake/Extensions.cmake @@ -65,6 +65,8 @@ function(add_python_extension name) # libraries that we might want to link against (eg. readline) set(target_name extension_${pretty_name}) + set_property(GLOBAL APPEND PROPERTY FUCKING_PYTHON_EXTENSION_TARGETS ${target_name}) + set(enable_default ON) if(ADD_PYTHON_EXTENSION_NEVER_BUILTIN AND WITH_STATIC_DEPENDENCIES) set(enable_default OFF) diff --git a/cmake/python/CMakeLists.txt b/cmake/python/CMakeLists.txt index 7850be5ae..592c205bf 100644 --- a/cmake/python/CMakeLists.txt +++ b/cmake/python/CMakeLists.txt @@ -77,6 +77,9 @@ if(UNIX AND PY_VERSION VERSION_GREATER "2.7.4") ) install(FILES ${EXTENSION_BUILD_DIR}/${_sysconfigdata_py} DESTINATION ${PYTHONHOME}/) + set_property(GLOBAL PROPERTY FUCK_PYTHON_SYSCONFIG_NIMABI ${EXTENSION_BUILD_DIR}/${_sysconfigdata_py}) + set_property(GLOBAL PROPERTY FUCK_PYTHON_SYSCONFIG_NIMABI2 ${PYTHONHOME}/${_sysconfigdata_py}) + set_property(GLOBAL PROPERTY FUCK_PYTHON_SYSCONFIG_NIMABI3 ${PROJECT_BINARY_DIR}) endif() if(UNIX AND NOT CMAKE_CROSSCOMPILING)