Skip to content

Commit

Permalink
Merge pull request #8953 from naveen521kk/python-git
Browse files Browse the repository at this point in the history
python3.9: autogenerate patches from git
  • Loading branch information
lazka authored Jun 18, 2021
2 parents 59ab137 + bcad250 commit 606a9f0
Show file tree
Hide file tree
Showing 146 changed files with 3,775 additions and 1,975 deletions.
1 change: 1 addition & 0 deletions mingw-w64-python3.9/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cpython/
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
diff -Naur Python-3.8.0-orig/Lib/sysconfig.py Python-3.8.0/Lib/sysconfig.py
--- Python-3.8.0-orig/Lib/sysconfig.py 2019-10-14 16:34:47.000000000 +0300
+++ Python-3.8.0/Lib/sysconfig.py 2019-10-22 10:00:17.317067000 +0300
From 6a1ea73cdc8c8d00b196fa6319b352d1a7196e2f Mon Sep 17 00:00:00 2001
From: Ray Donnelly <mingw.android@gmail.com>
Date: Thu, 17 Jun 2021 18:51:10 +0530
Subject: [PATCH 01/N] make _sysconfigdata.py relocatable
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Co-authored-by: Алексей <alexey.pawlow@gmail.com>
Co-authored-by: lovetox <8661218+lovetox@users.noreply.github.com>
---
Lib/sysconfig.py | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)

diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py
index e3f79bf..505d538 100644
--- a/Lib/sysconfig.py
+++ b/Lib/sysconfig.py
@@ -2,6 +2,7 @@

import os
Expand All @@ -9,7 +24,7 @@ diff -Naur Python-3.8.0-orig/Lib/sysconfig.py Python-3.8.0/Lib/sysconfig.py
from os.path import pardir, realpath

__all__ = [
@@ -405,11 +406,29 @@
@@ -413,11 +414,29 @@ def _generate_posix_vars():
os.makedirs(pybuilddir, exist_ok=True)
destfile = os.path.join(pybuilddir, name + '.py')

Expand Down Expand Up @@ -39,3 +54,6 @@ diff -Naur Python-3.8.0-orig/Lib/sysconfig.py Python-3.8.0/Lib/sysconfig.py

# Create file used for sys.path fixup -- see Modules/getpath.c
with open('pybuilddir.txt', 'w', encoding='utf8') as f:
--
2.32.0

80 changes: 50 additions & 30 deletions mingw-w64-python3.9/0002-restore-setup-config.patch
Original file line number Diff line number Diff line change
@@ -1,28 +1,21 @@
diff -Naur Python-3.8.0-orig/configure.ac Python-3.8.0/configure.ac
--- Python-3.8.0-orig/configure.ac 2019-10-14 16:34:47.000000000 +0300
+++ Python-3.8.0/configure.ac 2019-10-22 10:00:26.817483700 +0300
@@ -5624,7 +5624,7 @@


# generate output files
-AC_CONFIG_FILES(Makefile.pre Misc/python.pc Misc/python-embed.pc Misc/python-config.sh)
+AC_CONFIG_FILES(Makefile.pre Modules/Setup.config Misc/python.pc Misc/python-embed.pc Misc/python-config.sh)
AC_CONFIG_FILES([Modules/ld_so_aix], [chmod +x Modules/ld_so_aix])
AC_OUTPUT

@@ -5636,7 +5636,7 @@

echo "creating Makefile" >&AS_MESSAGE_FD
$SHELL $srcdir/Modules/makesetup -c $srcdir/Modules/config.c.in \
- -s Modules \
+ -s Modules Modules/Setup.config \
Modules/Setup.local $srcdir/Modules/Setup
mv config.c Modules

diff -Naur Python-3.8.0-orig/Makefile.pre.in Python-3.8.0/Makefile.pre.in
--- Python-3.8.0-orig/Makefile.pre.in 2019-10-14 16:34:47.000000000 +0300
+++ Python-3.8.0/Makefile.pre.in 2019-10-22 10:00:27.207484400 +0300
@@ -683,10 +683,12 @@
From 4116e31a23d6b32e61ccae0b444a03aa581a6348 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9?=
<alexey.pawlow@gmail.com>
Date: Thu, 17 Jun 2021 18:51:12 +0530
Subject: [PATCH 02/N] restore setup config

---
Makefile.pre.in | 4 ++++
Modules/Setup.config.in | 5 +++++
configure.ac | 4 ++--
3 files changed, 11 insertions(+), 2 deletions(-)
create mode 100644 Modules/Setup.config.in

diff --git a/Makefile.pre.in b/Makefile.pre.in
index 0c3981c..7f591e3 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -714,10 +714,12 @@ oldsharedmods: $(SHAREDMODS)
Makefile Modules/config.c: Makefile.pre \
$(srcdir)/Modules/config.c.in \
$(MAKESETUP) \
Expand All @@ -35,28 +28,55 @@ diff -Naur Python-3.8.0-orig/Makefile.pre.in Python-3.8.0/Makefile.pre.in
Modules/Setup.local \
$(srcdir)/Modules/Setup
@mv config.c Modules
@@ -1574,6 +1576,7 @@
@@ -1669,6 +1671,7 @@ libainstall: @DEF_MAKE_RULE@ python-config
$(INSTALL_DATA) Makefile $(DESTDIR)$(LIBPL)/Makefile
$(INSTALL_DATA) $(srcdir)/Modules/Setup $(DESTDIR)$(LIBPL)/Setup
$(INSTALL_DATA) Modules/Setup.local $(DESTDIR)$(LIBPL)/Setup.local
+ $(INSTALL_DATA) Modules/Setup.config $(DESTDIR)$(LIBPL)/Setup.config
$(INSTALL_DATA) Misc/python.pc $(DESTDIR)$(LIBPC)/python-$(VERSION).pc
$(INSTALL_DATA) Misc/python-embed.pc $(DESTDIR)$(LIBPC)/python-$(VERSION)-embed.pc
$(INSTALL_SCRIPT) $(srcdir)/Modules/makesetup $(DESTDIR)$(LIBPL)/makesetup
@@ -1789,6 +1792,7 @@
@@ -1895,6 +1898,7 @@ distclean: clobber
if test "$$file" != "$(srcdir)/Lib/test/data/README"; then rm "$$file"; fi; \
done
-rm -f core Makefile Makefile.pre config.status Modules/Setup.local \
+ Modules/Setup.config \
Modules/ld_so_aix Modules/python.exp Misc/python.pc \
Misc/python-embed.pc Misc/python-config.sh
-rm -f python*-gdb.py
diff -Naur Python-3.8.0-orig/Modules/Setup.config.in Python-3.8.0/Modules/Setup.config.in
--- Python-3.8.0-orig/Modules/Setup.config.in 1970-01-01 03:00:00.000000000 +0300
+++ Python-3.8.0/Modules/Setup.config.in 2019-10-22 10:00:27.613085100 +0300
diff --git a/Modules/Setup.config.in b/Modules/Setup.config.in
new file mode 100644
index 0000000..5c1299d
--- /dev/null
+++ b/Modules/Setup.config.in
@@ -0,0 +1,5 @@
+# This file is transmogrified into Setup.config by config.status.
+
+# The purpose of this file is to conditionally enable certain modules
+# based on configure-time options.
+
diff --git a/configure.ac b/configure.ac
index b1e4c6c..a5ca784 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5825,7 +5825,7 @@ AC_DEFINE_UNQUOTED(PY_BUILTIN_HASHLIB_HASHES, "$default_hashlib_hashes")
])

# generate output files
-AC_CONFIG_FILES(Makefile.pre Misc/python.pc Misc/python-embed.pc Misc/python-config.sh)
+AC_CONFIG_FILES(Makefile.pre Modules/Setup.config Misc/python.pc Misc/python-embed.pc Misc/python-config.sh)
AC_CONFIG_FILES([Modules/ld_so_aix], [chmod +x Modules/ld_so_aix])
AC_OUTPUT

@@ -5837,7 +5837,7 @@ fi

echo "creating Makefile" >&AS_MESSAGE_FD
$SHELL $srcdir/Modules/makesetup -c $srcdir/Modules/config.c.in \
- -s Modules \
+ -s Modules Modules/Setup.config \
Modules/Setup.local $srcdir/Modules/Setup
mv config.c Modules

--
2.32.0

Original file line number Diff line number Diff line change
@@ -1,7 +1,39 @@
diff -Naur Python-3.8.0-orig/configure.ac Python-3.8.0/configure.ac
--- Python-3.8.0-orig/configure.ac 2019-10-22 10:00:29.329088100 +0300
+++ Python-3.8.0/configure.ac 2019-10-22 10:00:31.778292400 +0300
@@ -1960,6 +1960,46 @@
From 40e31674ce05a531746af50cac90b53ad0bb7cab Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9?=
<alexey.pawlow@gmail.com>
Date: Thu, 17 Jun 2021 18:51:12 +0530
Subject: [PATCH 03/N] MINGW BASE use NT thread model
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Co-authored-by: Алексей <alexey.pawlow@gmail.com>
Co-authored-by: Christoph Reiter <reiter.christoph@gmail.com>
---
Modules/_multiprocessing/multiprocessing.h | 3 +
configure.ac | 94 +++++++++++++++++++++-
pyconfig.h.in | 3 +
3 files changed, 98 insertions(+), 2 deletions(-)

diff --git a/Modules/_multiprocessing/multiprocessing.h b/Modules/_multiprocessing/multiprocessing.h
index fe78135..344b76e 100644
--- a/Modules/_multiprocessing/multiprocessing.h
+++ b/Modules/_multiprocessing/multiprocessing.h
@@ -21,6 +21,9 @@
# endif
# define SEM_HANDLE HANDLE
# define SEM_VALUE_MAX LONG_MAX
+# if defined(HAVE_SEM_OPEN) && defined(_POSIX_THREADS)
+# include <semaphore.h>
+# endif
#else
# include <fcntl.h> /* O_CREAT and O_EXCL */
# if defined(HAVE_SEM_OPEN) && !defined(POSIX_SEMAPHORES_NOT_ENABLED)
diff --git a/configure.ac b/configure.ac
index a5ca784..ff84557 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2037,6 +2037,46 @@ then
BASECFLAGS="$BASECFLAGS $ac_arch_flags"
fi

Expand Down Expand Up @@ -48,7 +80,7 @@ diff -Naur Python-3.8.0-orig/configure.ac Python-3.8.0/configure.ac
# On some compilers, pthreads are available without further options
# (e.g. MacOS X). On some of these systems, the compiler will not
# complain if unaccepted options are passed (e.g. gcc on Mac OS X).
@@ -2078,6 +2118,8 @@
@@ -2155,6 +2195,8 @@ CC="$ac_save_cc"])
AC_MSG_RESULT($ac_cv_pthread)
fi

Expand All @@ -57,7 +89,7 @@ diff -Naur Python-3.8.0-orig/configure.ac Python-3.8.0/configure.ac
# If we have set a CC compiler flag for thread support then
# check if it works for CXX, too.
ac_cv_cxx_thread=no
@@ -2098,6 +2140,10 @@
@@ -2175,6 +2217,10 @@ elif test "$ac_cv_pthread" = "yes"
then
CXX="$CXX -pthread"
ac_cv_cxx_thread=yes
Expand All @@ -68,7 +100,7 @@ diff -Naur Python-3.8.0-orig/configure.ac Python-3.8.0/configure.ac
fi

if test $ac_cv_cxx_thread = yes
@@ -2130,8 +2176,8 @@
@@ -2207,8 +2253,8 @@ dnl AC_MSG_RESULT($cpp_type)
AC_HEADER_STDC
AC_CHECK_HEADERS(asm/types.h crypt.h conio.h direct.h dlfcn.h errno.h \
fcntl.h grp.h \
Expand All @@ -79,7 +111,7 @@ diff -Naur Python-3.8.0-orig/configure.ac Python-3.8.0/configure.ac
utime.h \
poll.h sys/devpoll.h sys/epoll.h sys/poll.h \
sys/audioio.h sys/xattr.h sys/bsdtty.h sys/event.h sys/file.h sys/ioctl.h \
@@ -2145,6 +2191,14 @@
@@ -2222,6 +2268,14 @@ sys/endian.h sys/sysmacros.h linux/memfd.h linux/wait.h sys/memfd.h sys/mman.h)
AC_HEADER_DIRENT
AC_HEADER_MAJOR

Expand All @@ -94,7 +126,7 @@ diff -Naur Python-3.8.0-orig/configure.ac Python-3.8.0/configure.ac
# bluetooth/bluetooth.h has been known to not compile with -std=c99.
# http://permalink.gmane.org/gmane.linux.bluez.kernel/22294
SAVE_CFLAGS=$CFLAGS
@@ -2342,6 +2396,10 @@
@@ -2419,6 +2473,10 @@ fi

AC_MSG_CHECKING(for pthread_t)
have_pthread_t=no
Expand All @@ -105,15 +137,15 @@ diff -Naur Python-3.8.0-orig/configure.ac Python-3.8.0/configure.ac
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[#include <pthread.h>]], [[pthread_t x; x = *(pthread_t*)0;]])
],[have_pthread_t=yes],[])
@@ -2372,6 +2430,7 @@
@@ -2449,6 +2507,7 @@ if test "$ac_cv_sizeof_pthread_key_t" -eq "$ac_cv_sizeof_int" ; then
else
AC_MSG_RESULT(no)
fi
+fi
CC="$ac_save_cc"

AC_SUBST(OTHER_LIBTOOL_OPT)
@@ -2814,10 +2873,15 @@
@@ -2894,10 +2953,15 @@ void *x = uuid_enc_be
[AC_MSG_RESULT(no)]
)

Expand All @@ -129,7 +161,7 @@ diff -Naur Python-3.8.0-orig/configure.ac Python-3.8.0/configure.ac

# check if we need libintl for locale functions
AC_CHECK_LIB(intl, textdomain,
@@ -3087,6 +3151,11 @@
@@ -3229,6 +3293,11 @@ then
CXX="$CXX -pthread"
fi
posix_threads=yes
Expand All @@ -141,7 +173,7 @@ diff -Naur Python-3.8.0-orig/configure.ac Python-3.8.0/configure.ac
else
if test ! -z "$withval" -a -d "$withval"
then LDFLAGS="$LDFLAGS -L$withval"
@@ -3538,6 +3607,15 @@
@@ -3689,6 +3758,15 @@ else
fi

# checks for library functions
Expand All @@ -157,7 +189,7 @@ diff -Naur Python-3.8.0-orig/configure.ac Python-3.8.0/configure.ac
AC_CHECK_FUNCS(alarm accept4 setitimer getitimer bind_textdomain_codeset chown \
clock confstr copy_file_range ctermid dup3 execv explicit_bzero explicit_memset \
faccessat fchmod fchmodat fchown fchownat \
@@ -4462,6 +4540,10 @@
@@ -4610,6 +4688,10 @@ AC_CHECK_DECLS([isinf, isnan, isfinite], [], [], [[#include <math.h>]])
# the kernel module that provides POSIX semaphores
# isn't loaded by default, so an attempt to call
# sem_open results in a 'Signal 12' error.
Expand All @@ -168,7 +200,7 @@ diff -Naur Python-3.8.0-orig/configure.ac Python-3.8.0/configure.ac
AC_MSG_CHECKING(whether POSIX semaphores are enabled)
AC_CACHE_VAL(ac_cv_posix_semaphores_enabled,
AC_RUN_IFELSE([AC_LANG_SOURCE([[
@@ -4495,6 +4577,14 @@
@@ -4643,6 +4725,14 @@ fi

# Multiprocessing check for broken sem_getvalue
AC_MSG_CHECKING(for broken sem_getvalue)
Expand All @@ -183,23 +215,11 @@ diff -Naur Python-3.8.0-orig/configure.ac Python-3.8.0/configure.ac
AC_CACHE_VAL(ac_cv_broken_sem_getvalue,
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <unistd.h>
diff -Naur Python-3.8.0-orig/Modules/_multiprocessing/multiprocessing.h Python-3.8.0/Modules/_multiprocessing/multiprocessing.h
--- Python-3.8.0-orig/Modules/_multiprocessing/multiprocessing.h 2019-10-14 16:34:47.000000000 +0300
+++ Python-3.8.0/Modules/_multiprocessing/multiprocessing.h 2019-10-22 10:00:32.168293100 +0300
@@ -21,6 +21,9 @@
# endif
# define SEM_HANDLE HANDLE
# define SEM_VALUE_MAX LONG_MAX
+# if defined(HAVE_SEM_OPEN) && defined(_POSIX_THREADS)
+# include <semaphore.h>
+# endif
#else
# include <fcntl.h> /* O_CREAT and O_EXCL */
# if defined(HAVE_SEM_OPEN) && !defined(POSIX_SEMAPHORES_NOT_ENABLED)
diff -Naur Python-3.8.0-orig/pyconfig.h.in Python-3.8.0/pyconfig.h.in
--- Python-3.8.0-orig/pyconfig.h.in 2019-10-14 16:34:47.000000000 +0300
+++ Python-3.8.0/pyconfig.h.in 2019-10-22 10:00:32.558293800 +0300
@@ -1352,6 +1352,9 @@
diff --git a/pyconfig.h.in b/pyconfig.h.in
index 8510c87..e84708e 100644
--- a/pyconfig.h.in
+++ b/pyconfig.h.in
@@ -1355,6 +1355,9 @@
/* Define if mvwdelch in curses.h is an expression. */
#undef MVWDELCH_IS_EXPRESSION

Expand All @@ -209,3 +229,6 @@ diff -Naur Python-3.8.0-orig/pyconfig.h.in Python-3.8.0/pyconfig.h.in
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT

--
2.32.0

Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
From c0de4a6d61bbf0d860b2b0fa619a229e26147bd6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9?=
<alexey.pawlow@gmail.com>
Date: Thu, 17 Jun 2021 18:51:13 +0530
Subject: [PATCH 04/N] MINGW translate gcc internal defines to python platf
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Co-authored-by: Алексей <alexey.pawlow@gmail.com>
Co-authored-by: Christoph Reiter <reiter.christoph@gmail.com>
---
Include/pyport.h | 15 +++++++++++++++
1 file changed, 15 insertions(+)

diff --git a/Include/pyport.h b/Include/pyport.h
index 4bd4eb4..475c2a8 100644
--- a/Include/pyport.h
+++ b/Include/pyport.h
@@ -26,6 +26,21 @@
#endif


+#ifdef __MINGW32__
+/* Translate GCC[mingw*] platform specific defines to those
+ * used in python code.
+ */
+#if !defined(MS_WIN64) && defined(_WIN64)
+# define MS_WIN64
+#endif
+#if !defined(MS_WIN32) && defined(_WIN32)
+# define MS_WIN32
+#endif
+#if !defined(MS_WINDOWS) && defined(MS_WIN32)
+# define MS_WINDOWS
+#endif
+#endif /* __MINGW32__*/
+
/**************************************************************************
Symbols and macros to supply platform-independent interfaces to basic
C language & library operations whose spellings vary across platforms.
--
2.32.0

Loading

0 comments on commit 606a9f0

Please sign in to comment.