All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] libxml2: Backport patch to fix Python3.9 syntax
@ 2020-10-24 21:20 Alejandro Hernandez Samaniego
  2020-10-24 21:20 ` [PATCH 2/2] python3: upgrade to python 3.9.0 Alejandro Hernandez Samaniego
  0 siblings, 1 reply; 6+ messages in thread
From: Alejandro Hernandez Samaniego @ 2020-10-24 21:20 UTC (permalink / raw)
  To: openembedded-core; +Cc: Alejandro Enedino Hernandez Samaniego

Building against python 3.9 causes some errors while compiling,
this has been fixed upstream, but hasnt been released yet:

upstream tracker:
https://gitlab.gnome.org/GNOME/libxml2/-/issues/149

Signed-off-by: Alejandro Enedino Hernandez Samaniego <alejandro.hernandez@linux.microsoft.com>
---
 ...1-Parenthesize-Py-type-_Check-in-ifs.patch | 96 +++++++++++++++++++
 meta/recipes-core/libxml/libxml2_2.9.10.bb    |  1 +
 2 files changed, 97 insertions(+)
 create mode 100644 meta/recipes-core/libxml/libxml2/0001-Parenthesize-Py-type-_Check-in-ifs.patch

diff --git a/meta/recipes-core/libxml/libxml2/0001-Parenthesize-Py-type-_Check-in-ifs.patch b/meta/recipes-core/libxml/libxml2/0001-Parenthesize-Py-type-_Check-in-ifs.patch
new file mode 100644
index 0000000000..bee8ab2cf6
--- /dev/null
+++ b/meta/recipes-core/libxml/libxml2/0001-Parenthesize-Py-type-_Check-in-ifs.patch
@@ -0,0 +1,96 @@
+From e4fb36841800038c289997432ca547c9bfef9db1 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
+Date: Fri, 28 Feb 2020 12:48:14 +0100
+Subject: [PATCH] Parenthesize Py<type>_Check() in ifs
+
+In C, if expressions should be parenthesized.
+PyLong_Check, PyUnicode_Check etc. happened to expand to a parenthesized
+expression before, but that's not API to rely on.
+
+Since Python 3.9.0a4 it needs to be parenthesized explicitly.
+
+Fixes https://gitlab.gnome.org/GNOME/libxml2/issues/149
+
+Upstream-Status: Backport
+Signed-off-by: Alejandro Enedino Hernandez Samaniego <alejandro.hernandez@linux.microsoft.com>
+
+---
+ python/libxml.c |  4 ++--
+ python/types.c  | 12 ++++++------
+ 2 files changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/python/libxml.c b/python/libxml.c
+index bc676c4e..81e709f3 100644
+--- a/python/libxml.c
++++ b/python/libxml.c
+@@ -294,7 +294,7 @@ xmlPythonFileReadRaw (void * context, char * buffer, int len) {
+ 	lenread = PyBytes_Size(ret);
+ 	data = PyBytes_AsString(ret);
+ #ifdef PyUnicode_Check
+-    } else if PyUnicode_Check (ret) {
++    } else if (PyUnicode_Check (ret)) {
+ #if PY_VERSION_HEX >= 0x03030000
+         Py_ssize_t size;
+ 	const char *tmp;
+@@ -359,7 +359,7 @@ xmlPythonFileRead (void * context, char * buffer, int len) {
+ 	lenread = PyBytes_Size(ret);
+ 	data = PyBytes_AsString(ret);
+ #ifdef PyUnicode_Check
+-    } else if PyUnicode_Check (ret) {
++    } else if (PyUnicode_Check (ret)) {
+ #if PY_VERSION_HEX >= 0x03030000
+         Py_ssize_t size;
+ 	const char *tmp;
+diff --git a/python/types.c b/python/types.c
+index c2bafeb1..ed284ec7 100644
+--- a/python/types.c
++++ b/python/types.c
+@@ -602,16 +602,16 @@ libxml_xmlXPathObjectPtrConvert(PyObject *obj)
+     if (obj == NULL) {
+         return (NULL);
+     }
+-    if PyFloat_Check (obj) {
++    if (PyFloat_Check (obj)) {
+         ret = xmlXPathNewFloat((double) PyFloat_AS_DOUBLE(obj));
+-    } else if PyLong_Check(obj) {
++    } else if (PyLong_Check(obj)) {
+ #ifdef PyLong_AS_LONG
+         ret = xmlXPathNewFloat((double) PyLong_AS_LONG(obj));
+ #else
+         ret = xmlXPathNewFloat((double) PyInt_AS_LONG(obj));
+ #endif
+ #ifdef PyBool_Check
+-    } else if PyBool_Check (obj) {
++    } else if (PyBool_Check (obj)) {
+ 
+         if (obj == Py_True) {
+           ret = xmlXPathNewBoolean(1);
+@@ -620,14 +620,14 @@ libxml_xmlXPathObjectPtrConvert(PyObject *obj)
+           ret = xmlXPathNewBoolean(0);
+         }
+ #endif
+-    } else if PyBytes_Check (obj) {
++    } else if (PyBytes_Check (obj)) {
+         xmlChar *str;
+ 
+         str = xmlStrndup((const xmlChar *) PyBytes_AS_STRING(obj),
+                          PyBytes_GET_SIZE(obj));
+         ret = xmlXPathWrapString(str);
+ #ifdef PyUnicode_Check
+-    } else if PyUnicode_Check (obj) {
++    } else if (PyUnicode_Check (obj)) {
+ #if PY_VERSION_HEX >= 0x03030000
+         xmlChar *str;
+ 	const char *tmp;
+@@ -650,7 +650,7 @@ libxml_xmlXPathObjectPtrConvert(PyObject *obj)
+ 	ret = xmlXPathWrapString(str);
+ #endif
+ #endif
+-    } else if PyList_Check (obj) {
++    } else if (PyList_Check (obj)) {
+         int i;
+         PyObject *node;
+         xmlNodePtr cur;
+-- 
+2.25.1
+
diff --git a/meta/recipes-core/libxml/libxml2_2.9.10.bb b/meta/recipes-core/libxml/libxml2_2.9.10.bb
index 90890ffaed..2034eaf36e 100644
--- a/meta/recipes-core/libxml/libxml2_2.9.10.bb
+++ b/meta/recipes-core/libxml/libxml2_2.9.10.bb
@@ -23,6 +23,7 @@ SRC_URI = "http://www.xmlsoft.org/sources/libxml2-${PV}.tar.gz;name=libtar \
            file://CVE-2020-7595.patch \
            file://CVE-2019-20388.patch \
            file://CVE-2020-24977.patch \
+           file://0001-Parenthesize-Py-type-_Check-in-ifs.patch \
            "
 
 SRC_URI[libtar.md5sum] = "10942a1dc23137a8aa07f0639cbfece5"
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] python3: upgrade to python 3.9.0
  2020-10-24 21:20 [PATCH 1/2] libxml2: Backport patch to fix Python3.9 syntax Alejandro Hernandez Samaniego
@ 2020-10-24 21:20 ` Alejandro Hernandez Samaniego
  2020-10-24 21:35   ` [OE-core] " Alexander Kanavin
  0 siblings, 1 reply; 6+ messages in thread
From: Alejandro Hernandez Samaniego @ 2020-10-24 21:20 UTC (permalink / raw)
  To: openembedded-core; +Cc: Alejandro Enedino Hernandez Samaniego

AFAIC the upstream fix to use --with-platlibdir can now replace the
functinoality we put in place for multilib builds, this patch uses
such config as well as removes some of the patches for that.

- Fixes fuzz on patches
- Rebased the rest to work on 3.9.0
- License changedm, it now includes BSD Clause 0

Signed-off-by: Alejandro Enedino Hernandez Samaniego <alejandro.hernandez@linux.microsoft.com>
---
 meta/classes/python3-dir.bbclass              |   2 +-
 ...ib-termcap-to-linker-flags-to-avoid-.patch |   6 +-
 ...lib-as-location-for-site-packages-an.patch | 214 ------------------
 ...hell-version-of-python-config-that-w.patch |   7 +-
 ...-search-system-for-headers-libraries.patch |   6 +-
 ...-fix-another-place-where-lib-is-hard.patch |  18 +-
 ...file-do-not-compile-.pyc-in-parallel.patch |   7 +-
 ...sue36464-parallel-build-race-problem.patch |  10 +-
 ...-qemu-wrapper-when-gathering-profile.patch |   7 +-
 ...FLAG_REF-always-for-interned-strings.patch |  12 +-
 ...-detection-of-mips-architecture-for-.patch |  11 +-
 .../python3/0001-configure.ac-fix-LIBPL.patch |  35 ---
 ...fig-append-STAGING_LIBDIR-python-sys.patch |  10 +-
 ...n3-Do-not-hardcode-lib-for-distutils.patch |  43 ----
 ...asename-to-replace-CC-for-checking-c.patch |  26 +--
 ...ssing-libraries-to-Extension-for-mul.patch |   7 +-
 ...le.py-correct-the-test-output-format.patch |  10 +-
 ...report-missing-dependencies-for-disa.patch |  14 +-
 ...up.py-do-not-add-a-curses-include-pa.patch |  11 +-
 ...tutils-prefix-is-inside-staging-area.patch |  25 +-
 .../python3/avoid_warning_about_tkinter.patch |   6 +-
 .../python/python3/cgi_py.patch               |   4 +-
 .../python/python3/crosspythonpath.patch      |  13 +-
 .../python/python3/python-config.patch        |   8 +-
 .../{python3_3.8.5.bb => python3_3.9.0.bb}    |  17 +-
 25 files changed, 123 insertions(+), 406 deletions(-)
 delete mode 100644 meta/recipes-devtools/python/python3/0001-Do-not-hardcode-lib-as-location-for-site-packages-an.patch
 delete mode 100644 meta/recipes-devtools/python/python3/0001-configure.ac-fix-LIBPL.patch
 delete mode 100644 meta/recipes-devtools/python/python3/0001-python3-Do-not-hardcode-lib-for-distutils.patch
 rename meta/recipes-devtools/python/{python3_3.8.5.bb => python3_3.9.0.bb} (95%)

diff --git a/meta/classes/python3-dir.bbclass b/meta/classes/python3-dir.bbclass
index 036d7140d9..f51f971fc5 100644
--- a/meta/classes/python3-dir.bbclass
+++ b/meta/classes/python3-dir.bbclass
@@ -1,4 +1,4 @@
-PYTHON_BASEVERSION = "3.8"
+PYTHON_BASEVERSION = "3.9"
 PYTHON_ABI = ""
 PYTHON_DIR = "python${PYTHON_BASEVERSION}"
 PYTHON_PN = "python3"
diff --git a/meta/recipes-devtools/python/python3/0001-Do-not-add-usr-lib-termcap-to-linker-flags-to-avoid-.patch b/meta/recipes-devtools/python/python3/0001-Do-not-add-usr-lib-termcap-to-linker-flags-to-avoid-.patch
index 59592821d7..44354f44d4 100644
--- a/meta/recipes-devtools/python/python3/0001-Do-not-add-usr-lib-termcap-to-linker-flags-to-avoid-.patch
+++ b/meta/recipes-devtools/python/python3/0001-Do-not-add-usr-lib-termcap-to-linker-flags-to-avoid-.patch
@@ -1,4 +1,4 @@
-From 039c53dd5baddec3359a05be0bff46a3b32bbb84 Mon Sep 17 00:00:00 2001
+From 2b122b1e664a91b14a8d8074d342439c1892700a Mon Sep 17 00:00:00 2001
 From: Alexander Kanavin <alex.kanavin@gmail.com>
 Date: Fri, 25 Jan 2019 19:04:13 +0100
 Subject: [PATCH] Do not add /usr/lib/termcap to linker flags to avoid host
@@ -12,10 +12,10 @@ Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
  1 file changed, 1 deletion(-)
 
 diff --git a/setup.py b/setup.py
-index 20d7f35..ab18ff0 100644
+index 770866b..d3ccc6c 100644
 --- a/setup.py
 +++ b/setup.py
-@@ -957,7 +957,6 @@ class PyBuildExt(build_ext):
+@@ -1058,7 +1058,6 @@ class PyBuildExt(build_ext):
                                                       'termcap'):
                  readline_libs.append('termcap')
              self.add(Extension('readline', ['readline.c'],
diff --git a/meta/recipes-devtools/python/python3/0001-Do-not-hardcode-lib-as-location-for-site-packages-an.patch b/meta/recipes-devtools/python/python3/0001-Do-not-hardcode-lib-as-location-for-site-packages-an.patch
deleted file mode 100644
index 112c979441..0000000000
--- a/meta/recipes-devtools/python/python3/0001-Do-not-hardcode-lib-as-location-for-site-packages-an.patch
+++ /dev/null
@@ -1,214 +0,0 @@
-From a078b6ff1492e848ad1055764fb9a414abaf3e12 Mon Sep 17 00:00:00 2001
-From: Alexander Kanavin <alex.kanavin@gmail.com>
-Date: Tue, 5 Feb 2019 15:52:02 +0100
-Subject: [PATCH] Do not hardcode "lib" as location for modules, site-packages
- and lib-dynload
-
-Upstream-Status: Inappropriate [oe-core specific]
-Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
-
----
- Include/pythonrun.h  |  2 ++
- Lib/site.py          |  4 ++--
- Makefile.pre.in      |  5 +++--
- Modules/getpath.c    | 22 ++++++++++++++--------
- Python/getplatform.c | 10 ++++++++++
- Python/sysmodule.c   |  2 ++
- 6 files changed, 33 insertions(+), 12 deletions(-)
-
-diff --git a/Include/pythonrun.h b/Include/pythonrun.h
-index 46091e0..61b2e15 100644
---- a/Include/pythonrun.h
-+++ b/Include/pythonrun.h
-@@ -7,6 +7,8 @@
- extern "C" {
- #endif
- 
-+PyAPI_FUNC(const char *) Py_GetLib(void);
-+
- #ifndef Py_LIMITED_API
- PyAPI_FUNC(int) PyRun_SimpleStringFlags(const char *, PyCompilerFlags *);
- PyAPI_FUNC(int) PyRun_AnyFileExFlags(
-diff --git a/Lib/site.py b/Lib/site.py
-index a065ab0..1d720ef 100644
---- a/Lib/site.py
-+++ b/Lib/site.py
-@@ -335,12 +335,12 @@ def getsitepackages(prefixes=None):
-         seen.add(prefix)
- 
-         if os.sep == '/':
--            sitepackages.append(os.path.join(prefix, "lib",
-+            sitepackages.append(os.path.join(prefix, sys.lib,
-                                         "python%d.%d" % sys.version_info[:2],
-                                         "site-packages"))
-         else:
-             sitepackages.append(prefix)
--            sitepackages.append(os.path.join(prefix, "lib", "site-packages"))
-+            sitepackages.append(os.path.join(prefix, sys.lib, "site-packages"))
-     return sitepackages
- 
- def addsitepackages(known_paths, prefixes=None):
-diff --git a/Makefile.pre.in b/Makefile.pre.in
-index 65665df..be49140 100644
---- a/Makefile.pre.in
-+++ b/Makefile.pre.in
-@@ -143,7 +143,7 @@ LIBDIR=		@libdir@
- MANDIR=		@mandir@
- INCLUDEDIR=	@includedir@
- CONFINCLUDEDIR=	$(exec_prefix)/include
--SCRIPTDIR=	$(prefix)/lib
-+SCRIPTDIR=	@libdir@
- ABIFLAGS=	@ABIFLAGS@
- 
- # Detailed destination directories
-@@ -753,6 +753,7 @@ Modules/getpath.o: $(srcdir)/Modules/getpath.c Makefile
- 		-DEXEC_PREFIX='"$(exec_prefix)"' \
- 		-DVERSION='"$(VERSION)"' \
- 		-DVPATH='"$(VPATH)"' \
-+		-DLIB='"$(LIB)"' \
- 		-o $@ $(srcdir)/Modules/getpath.c
- 
- Programs/python.o: $(srcdir)/Programs/python.c
-@@ -868,7 +869,7 @@ regen-symbol: $(srcdir)/Include/graminit.h
- Python/compile.o Python/symtable.o Python/ast_unparse.o Python/ast.o Python/future.o Parser/parsetok.o: $(srcdir)/Include/graminit.h $(srcdir)/Include/Python-ast.h
- 
- Python/getplatform.o: $(srcdir)/Python/getplatform.c
--		$(CC) -c $(PY_CORE_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c
-+		$(CC) -c $(PY_CORE_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -DLIB='"$(LIB)"' -o $@ $(srcdir)/Python/getplatform.c
- 
- Python/importdl.o: $(srcdir)/Python/importdl.c
- 		$(CC) -c $(PY_CORE_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c
-diff --git a/Modules/getpath.c b/Modules/getpath.c
-index b727f66..c003e46 100644
---- a/Modules/getpath.c
-+++ b/Modules/getpath.c
-@@ -128,6 +128,7 @@ typedef struct {
-     wchar_t *exec_prefix;              /* EXEC_PREFIX macro */
- 
-     wchar_t *lib_python;               /* "lib/pythonX.Y" */
-+    wchar_t *multilib_python;               /* "lib[suffix]/pythonX.Y" */
- 
-     int prefix_found;         /* found platform independent libraries? */
-     int exec_prefix_found;    /* found the platform dependent libraries? */
-@@ -386,7 +387,7 @@ search_for_prefix(PyCalculatePath *calculate, _PyPathConfig *pathconfig,
-         if (delim) {
-             *delim = L'\0';
-         }
--        status = joinpath(prefix, calculate->lib_python, prefix_len);
-+        status = joinpath(prefix, calculate->multilib_python, prefix_len);
-         if (_PyStatus_EXCEPTION(status)) {
-             return status;
-         }
-@@ -444,7 +445,7 @@ search_for_prefix(PyCalculatePath *calculate, _PyPathConfig *pathconfig,
-     do {
-         /* Path: <argv0_path or substring> / <lib_python> / LANDMARK */
-         size_t n = wcslen(prefix);
--        status = joinpath(prefix, calculate->lib_python, prefix_len);
-+        status = joinpath(prefix, calculate->multilib_python, prefix_len);
-         if (_PyStatus_EXCEPTION(status)) {
-             return status;
-         }
-@@ -467,7 +468,7 @@ search_for_prefix(PyCalculatePath *calculate, _PyPathConfig *pathconfig,
-     if (safe_wcscpy(prefix, calculate->prefix, prefix_len) < 0) {
-         return PATHLEN_ERR();
-     }
--    status = joinpath(prefix, calculate->lib_python, prefix_len);
-+    status = joinpath(prefix, calculate->multilib_python, prefix_len);
-     if (_PyStatus_EXCEPTION(status)) {
-         return status;
-     }
-@@ -510,7 +511,7 @@ calculate_prefix(PyCalculatePath *calculate, _PyPathConfig *pathconfig,
-         if (safe_wcscpy(prefix, calculate->prefix, prefix_len) < 0) {
-             return PATHLEN_ERR();
-         }
--        status = joinpath(prefix, calculate->lib_python, prefix_len);
-+        status = joinpath(prefix, calculate->multilib_python, prefix_len);
-         if (_PyStatus_EXCEPTION(status)) {
-             return status;
-         }
-@@ -635,7 +636,7 @@ search_for_exec_prefix(PyCalculatePath *calculate, _PyPathConfig *pathconfig,
-                 return PATHLEN_ERR();
-             }
-         }
--        status = joinpath(exec_prefix, calculate->lib_python, exec_prefix_len);
-+        status = joinpath(exec_prefix, calculate->multilib_python, exec_prefix_len);
-         if (_PyStatus_EXCEPTION(status)) {
-             return status;
-         }
-@@ -667,7 +668,7 @@ search_for_exec_prefix(PyCalculatePath *calculate, _PyPathConfig *pathconfig,
-     do {
-         /* Path: <argv0_path or substring> / <lib_python> / "lib-dynload" */
-         size_t n = wcslen(exec_prefix);
--        status = joinpath(exec_prefix, calculate->lib_python, exec_prefix_len);
-+        status = joinpath(exec_prefix, calculate->multilib_python, exec_prefix_len);
-         if (_PyStatus_EXCEPTION(status)) {
-             return status;
-         }
-@@ -689,7 +690,7 @@ search_for_exec_prefix(PyCalculatePath *calculate, _PyPathConfig *pathconfig,
-     if (safe_wcscpy(exec_prefix, calculate->exec_prefix, exec_prefix_len) < 0) {
-         return PATHLEN_ERR();
-     }
--    status = joinpath(exec_prefix, calculate->lib_python, exec_prefix_len);
-+    status = joinpath(exec_prefix, calculate->multilib_python, exec_prefix_len);
-     if (_PyStatus_EXCEPTION(status)) {
-         return status;
-     }
-@@ -928,7 +929,7 @@ calculate_argv0_path(PyCalculatePath *calculate, const wchar_t *program_full_pat
-             return PATHLEN_ERR();
-         }
-         reduce(argv0_path);
--        status = joinpath(argv0_path, calculate->lib_python, argv0_path_len);
-+        status = joinpath(argv0_path, calculate->multilib_python, argv0_path_len);
-         if (_PyStatus_EXCEPTION(status)) {
-             PyMem_RawFree(wbuf);
-             return status;
-@@ -1201,6 +1202,10 @@ calculate_init(PyCalculatePath *calculate, const PyConfig *config)
-     if (!calculate->lib_python) {
-         return DECODE_LOCALE_ERR("EXEC_PREFIX define", len);
-     }
-+    calculate->multilib_python = Py_DecodeLocale(LIB "/python" VERSION, &len);
-+    if (!calculate->multilib_python) {
-+        return DECODE_LOCALE_ERR("EXEC_PREFIX define", len);
-+    }
- 
-     calculate->warnings = config->pathconfig_warnings;
-     calculate->pythonpath_env = config->pythonpath_env;
-@@ -1216,6 +1221,7 @@ calculate_free(PyCalculatePath *calculate)
-     PyMem_RawFree(calculate->prefix);
-     PyMem_RawFree(calculate->exec_prefix);
-     PyMem_RawFree(calculate->lib_python);
-+    PyMem_RawFree(calculate->multilib_python);
-     PyMem_RawFree(calculate->path_env);
- }
- 
-diff --git a/Python/getplatform.c b/Python/getplatform.c
-index 81a0f7a..d55396b 100644
---- a/Python/getplatform.c
-+++ b/Python/getplatform.c
-@@ -10,3 +10,13 @@ Py_GetPlatform(void)
- {
-     return PLATFORM;
- }
-+
-+#ifndef LIB
-+#define LIB "lib"
-+#endif
-+
-+const char *
-+Py_GetLib(void)
-+{
-+	return LIB;
-+}
-diff --git a/Python/sysmodule.c b/Python/sysmodule.c
-index 5b0fb81..0dce754 100644
---- a/Python/sysmodule.c
-+++ b/Python/sysmodule.c
-@@ -2668,6 +2668,8 @@ _PySys_InitCore(_PyRuntimeState *runtime, PyInterpreterState *interp,
-                         PyUnicode_FromString(Py_GetCopyright()));
-     SET_SYS_FROM_STRING("platform",
-                         PyUnicode_FromString(Py_GetPlatform()));
-+    SET_SYS_FROM_STRING("lib",
-+                        PyUnicode_FromString(Py_GetLib()));
-     SET_SYS_FROM_STRING("maxsize",
-                         PyLong_FromSsize_t(PY_SSIZE_T_MAX));
-     SET_SYS_FROM_STRING("float_info",
diff --git a/meta/recipes-devtools/python/python3/0001-Do-not-use-the-shell-version-of-python-config-that-w.patch b/meta/recipes-devtools/python/python3/0001-Do-not-use-the-shell-version-of-python-config-that-w.patch
index 83fd52d87f..7113ce2138 100644
--- a/meta/recipes-devtools/python/python3/0001-Do-not-use-the-shell-version-of-python-config-that-w.patch
+++ b/meta/recipes-devtools/python/python3/0001-Do-not-use-the-shell-version-of-python-config-that-w.patch
@@ -1,4 +1,4 @@
-From 148861fa16f2aaacd518770f337ea54b5182f981 Mon Sep 17 00:00:00 2001
+From 980fcf1a36bcb3ab26d4e82a304e205f02cb376f Mon Sep 17 00:00:00 2001
 From: Alexander Kanavin <alex.kanavin@gmail.com>
 Date: Tue, 29 Jan 2019 15:03:01 +0100
 Subject: [PATCH] Do not use the shell version of python-config that was
@@ -9,15 +9,16 @@ outputs directories correctly.
 
 Upstream-Status: Inappropriate [oe-specific]
 Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+
 ---
  Makefile.pre.in | 9 +++------
  1 file changed, 3 insertions(+), 6 deletions(-)
 
 diff --git a/Makefile.pre.in b/Makefile.pre.in
-index 2d2e11f..cc19942 100644
+index 77f91e7..5259754 100644
 --- a/Makefile.pre.in
 +++ b/Makefile.pre.in
-@@ -1431,12 +1431,9 @@ python-config: $(srcdir)/Misc/python-config.in Misc/python-config.sh
+@@ -1568,12 +1568,9 @@ python-config: $(srcdir)/Misc/python-config.in Misc/python-config.sh
  	sed -e "s,@EXENAME@,$(BINDIR)/python$(LDVERSION)$(EXE)," < $(srcdir)/Misc/python-config.in >python-config.py
  	@ # Replace makefile compat. variable references with shell script compat. ones; $(VAR) -> ${VAR}
  	LC_ALL=C sed -e 's,\$$(\([A-Za-z0-9_]*\)),\$$\{\1\},g' < Misc/python-config.sh >python-config
diff --git a/meta/recipes-devtools/python/python3/0001-Don-t-search-system-for-headers-libraries.patch b/meta/recipes-devtools/python/python3/0001-Don-t-search-system-for-headers-libraries.patch
index 3e471b9a49..95b4969c09 100644
--- a/meta/recipes-devtools/python/python3/0001-Don-t-search-system-for-headers-libraries.patch
+++ b/meta/recipes-devtools/python/python3/0001-Don-t-search-system-for-headers-libraries.patch
@@ -1,4 +1,4 @@
-From b880e78bf4a1852e260188e6df3ec6034403d2fc Mon Sep 17 00:00:00 2001
+From 9325b9705046d5ad4ade0482f0020a0ae5c56eaf Mon Sep 17 00:00:00 2001
 From: Jeremy Puhlman <jpuhlman@mvista.com>
 Date: Wed, 4 Mar 2020 00:06:42 +0000
 Subject: [PATCH] Don't search system for headers/libraries
@@ -11,10 +11,10 @@ Signed-off-by: Jeremy Puhlman <jpuhlman@mvista.com>
  1 file changed, 2 insertions(+), 2 deletions(-)
 
 diff --git a/setup.py b/setup.py
-index 7208cd0..c0bd0ad 100644
+index a456e53..af194ee 100644
 --- a/setup.py
 +++ b/setup.py
-@@ -674,8 +674,8 @@ class PyBuildExt(build_ext):
+@@ -770,8 +770,8 @@ class PyBuildExt(build_ext):
              add_dir_to_list(self.compiler.include_dirs,
                              sysconfig.get_config_var("INCLUDEDIR"))
  
diff --git a/meta/recipes-devtools/python/python3/0001-Lib-sysconfig.py-fix-another-place-where-lib-is-hard.patch b/meta/recipes-devtools/python/python3/0001-Lib-sysconfig.py-fix-another-place-where-lib-is-hard.patch
index b97583682a..7aaa346c5d 100644
--- a/meta/recipes-devtools/python/python3/0001-Lib-sysconfig.py-fix-another-place-where-lib-is-hard.patch
+++ b/meta/recipes-devtools/python/python3/0001-Lib-sysconfig.py-fix-another-place-where-lib-is-hard.patch
@@ -6,22 +6,26 @@ Subject: [PATCH] Lib/sysconfig.py: fix another place where 'lib' is hardcoded
 
 Upstream-Status: Inappropriate [oe-core specific]
 Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+
+Rebased for 3.9 [10/2020]
+Signed-off-by: Alejandro Enedino Hernandez Samaniego <alejandro.hernandez@linux.microsoft.com>
+
 ---
  Lib/sysconfig.py | 8 ++++----
  1 file changed, 4 insertions(+), 4 deletions(-)
 
-diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py
-index d15cec8..87fa5e6 100644
---- a/Lib/sysconfig.py
-+++ b/Lib/sysconfig.py
+Index: Python-3.9.0/Lib/sysconfig.py
+===================================================================
+--- Python-3.9.0.orig/Lib/sysconfig.py
++++ Python-3.9.0/Lib/sysconfig.py
 @@ -20,10 +20,10 @@ __all__ = [
  
  _INSTALL_SCHEMES = {
      'posix_prefix': {
--        'stdlib': '{installed_base}/lib/python{py_version_short}',
--        'platstdlib': '{platbase}/lib/python{py_version_short}',
+-        'stdlib': '{installed_base}/{platlibdir}/python{py_version_short}',
+-        'platstdlib': '{platbase}/{platlibdir}/python{py_version_short}',
 -        'purelib': '{base}/lib/python{py_version_short}/site-packages',
--        'platlib': '{platbase}/lib/python{py_version_short}/site-packages',
+-        'platlib': '{platbase}/{platlibdir}/python{py_version_short}/site-packages',
 +        'stdlib': '{LIBDEST}',
 +        'platstdlib': '{LIBDEST}',
 +        'purelib': '{LIBDEST}/site-packages',
diff --git a/meta/recipes-devtools/python/python3/0001-Makefile-do-not-compile-.pyc-in-parallel.patch b/meta/recipes-devtools/python/python3/0001-Makefile-do-not-compile-.pyc-in-parallel.patch
index b1bceac512..fee0f45219 100644
--- a/meta/recipes-devtools/python/python3/0001-Makefile-do-not-compile-.pyc-in-parallel.patch
+++ b/meta/recipes-devtools/python/python3/0001-Makefile-do-not-compile-.pyc-in-parallel.patch
@@ -1,4 +1,4 @@
-From c501e121a872cbcef8ffe626c1de173a125be9f8 Mon Sep 17 00:00:00 2001
+From 04b5cbff2126339417763f908c89eba076e60c4e Mon Sep 17 00:00:00 2001
 From: Alexander Kanavin <alex.kanavin@gmail.com>
 Date: Thu, 16 Jan 2020 12:34:20 +0100
 Subject: [PATCH] Makefile: do not compile .pyc in parallel
@@ -11,15 +11,16 @@ https://github.com/python/cpython/commit/1a2dd82f56bd813aacc570e172cefe55a8a4150
 
 Upstream-Status: Pending
 Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+
 ---
  Makefile.pre.in | 12 ++++++------
  1 file changed, 6 insertions(+), 6 deletions(-)
 
 diff --git a/Makefile.pre.in b/Makefile.pre.in
-index 1241112..5dfdf44 100644
+index 09763f5..59b95be 100644
 --- a/Makefile.pre.in
 +++ b/Makefile.pre.in
-@@ -1457,30 +1457,30 @@ libinstall:	build_all $(srcdir)/Modules/xxmodule.c
+@@ -1529,30 +1529,30 @@ libinstall:	build_all $(srcdir)/Modules/xxmodule.c
  	fi
  	-PYTHONPATH=$(DESTDIR)$(LIBDEST)  $(RUNSHARED) \
  		$(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \
diff --git a/meta/recipes-devtools/python/python3/0001-Makefile-fix-Issue36464-parallel-build-race-problem.patch b/meta/recipes-devtools/python/python3/0001-Makefile-fix-Issue36464-parallel-build-race-problem.patch
index 237645bc60..bdce71f1c4 100644
--- a/meta/recipes-devtools/python/python3/0001-Makefile-fix-Issue36464-parallel-build-race-problem.patch
+++ b/meta/recipes-devtools/python/python3/0001-Makefile-fix-Issue36464-parallel-build-race-problem.patch
@@ -1,4 +1,4 @@
-From 840fda32c82550259d02a7a56a78a9c05162b1a1 Mon Sep 17 00:00:00 2001
+From 8da4539c32ba0eb36aae65a5cbd0a71082764ca9 Mon Sep 17 00:00:00 2001
 From: Changqing Li <changqing.li@windriver.com>
 Date: Wed, 8 May 2019 16:10:29 +0800
 Subject: [PATCH] Makefile: fix Issue36464 (parallel build race problem)
@@ -12,15 +12,16 @@ exists in the libainstall target.
 Upstream-Status: Submitted [https://github.com/python/cpython/pull/13186]
 
 Signed-off-by: Changqing Li <changqing.li@windriver.com>
+
 ---
  Makefile.pre.in | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/Makefile.pre.in b/Makefile.pre.in
-index 15f3687..7e9f173 100644
+index a87fe82..09763f5 100644
 --- a/Makefile.pre.in
 +++ b/Makefile.pre.in
-@@ -1456,7 +1456,7 @@ LIBPL=		@LIBPL@
+@@ -1618,7 +1618,7 @@ LIBPL=		@LIBPL@
  LIBPC=		$(LIBDIR)/pkgconfig
  
  libainstall:	@DEF_MAKE_RULE@ python-config
@@ -29,6 +30,3 @@ index 15f3687..7e9f173 100644
  	do \
  		if test ! -d $(DESTDIR)$$i; then \
  			echo "Creating directory $$i"; \
--- 
-2.7.4
-
diff --git a/meta/recipes-devtools/python/python3/0001-Makefile.pre-use-qemu-wrapper-when-gathering-profile.patch b/meta/recipes-devtools/python/python3/0001-Makefile.pre-use-qemu-wrapper-when-gathering-profile.patch
index fa7735ff93..5eb356ac6c 100644
--- a/meta/recipes-devtools/python/python3/0001-Makefile.pre-use-qemu-wrapper-when-gathering-profile.patch
+++ b/meta/recipes-devtools/python/python3/0001-Makefile.pre-use-qemu-wrapper-when-gathering-profile.patch
@@ -1,19 +1,20 @@
-From cf6a9100902484e4d028ee88742dd2487b014a98 Mon Sep 17 00:00:00 2001
+From f1f29d96b3d270656feb85bcc00ca29c27d8b77f Mon Sep 17 00:00:00 2001
 From: Alexander Kanavin <alex.kanavin@gmail.com>
 Date: Wed, 30 Jan 2019 12:41:04 +0100
 Subject: [PATCH] Makefile.pre: use qemu wrapper when gathering profile data
 
 Upstream-Status: Inappropriate [oe-core specific]
 Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+
 ---
  Makefile.pre.in | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)
 
 diff --git a/Makefile.pre.in b/Makefile.pre.in
-index a3a02a7..d5503dd 100644
+index 5259754..a87fe82 100644
 --- a/Makefile.pre.in
 +++ b/Makefile.pre.in
-@@ -507,8 +507,7 @@ build_all_generate_profile:
+@@ -519,8 +519,7 @@ build_all_generate_profile:
  	$(MAKE) @DEF_MAKE_RULE@ CFLAGS_NODIST="$(CFLAGS_NODIST) $(PGO_PROF_GEN_FLAG)" LDFLAGS_NODIST="$(LDFLAGS_NODIST) $(PGO_PROF_GEN_FLAG)" LIBS="$(LIBS)"
  
  run_profile_task:
diff --git a/meta/recipes-devtools/python/python3/0001-Use-FLAG_REF-always-for-interned-strings.patch b/meta/recipes-devtools/python/python3/0001-Use-FLAG_REF-always-for-interned-strings.patch
index 957839bf3e..5a49fff696 100644
--- a/meta/recipes-devtools/python/python3/0001-Use-FLAG_REF-always-for-interned-strings.patch
+++ b/meta/recipes-devtools/python/python3/0001-Use-FLAG_REF-always-for-interned-strings.patch
@@ -1,19 +1,20 @@
-From 6c8ea7c1dacd42f3ba00440231ec0e6b1a38300d Mon Sep 17 00:00:00 2001
+From 12d895a9a0c03dd872727434921118016176f561 Mon Sep 17 00:00:00 2001
 From: Inada Naoki <songofacandy@gmail.com>
 Date: Sat, 14 Jul 2018 00:46:11 +0900
 Subject: [PATCH] Use FLAG_REF always for interned strings
 
 Upstream-Status: Submitted [https://github.com/python/cpython/pull/8226]
 Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
+
 ---
  Python/marshal.c | 9 +++++++--
  1 file changed, 7 insertions(+), 2 deletions(-)
 
 diff --git a/Python/marshal.c b/Python/marshal.c
-index 6d06266c6a..51db2e3b2e 100644
+index c4538bd..2437160 100644
 --- a/Python/marshal.c
 +++ b/Python/marshal.c
-@@ -275,9 +275,14 @@ w_ref(PyObject *v, char *flag, WFILE *p)
+@@ -298,9 +298,14 @@ w_ref(PyObject *v, char *flag, WFILE *p)
      if (p->version < 3 || p->hashtable == NULL)
          return 0; /* not writing object references */
  
@@ -28,8 +29,5 @@ index 6d06266c6a..51db2e3b2e 100644
          return 0;
 +    }
  
-     entry = _Py_HASHTABLE_GET_ENTRY(p->hashtable, v);
+     entry = _Py_hashtable_get_entry(p->hashtable, v);
      if (entry != NULL) {
--- 
-2.21.0
-
diff --git a/meta/recipes-devtools/python/python3/0001-bpo-36852-proper-detection-of-mips-architecture-for-.patch b/meta/recipes-devtools/python/python3/0001-bpo-36852-proper-detection-of-mips-architecture-for-.patch
index c4fae09a5b..e8dc18277a 100644
--- a/meta/recipes-devtools/python/python3/0001-bpo-36852-proper-detection-of-mips-architecture-for-.patch
+++ b/meta/recipes-devtools/python/python3/0001-bpo-36852-proper-detection-of-mips-architecture-for-.patch
@@ -1,4 +1,4 @@
-From 1ad771d86728ee2ed30e202e9768d8d825f96467 Mon Sep 17 00:00:00 2001
+From 405703bc48271d7280c0281897d0e6a9752bbccc Mon Sep 17 00:00:00 2001
 From: Matthias Schoepfer <matthias.schoepfer@ithinx.io>
 Date: Fri, 31 May 2019 15:34:34 +0200
 Subject: [PATCH] bpo-36852: proper detection of mips architecture for soft
@@ -13,16 +13,16 @@ to do this in a more autoconf/autotools manner.
 Upstream-Status: Submitted [https://github.com/python/cpython/pull/13196]
 Signed-off-by: Matthias Schoepfer <matthias.schoepfer@ithinx.io>
 
-%% original patch: 0001-bpo-36852-proper-detection-of-mips-architecture-for-.patch
+
 ---
  configure.ac | 175 +++++++--------------------------------------------
  1 file changed, 21 insertions(+), 154 deletions(-)
 
 diff --git a/configure.ac b/configure.ac
-index ede710e..bc81b0b 100644
+index e491e24..784850b 100644
 --- a/configure.ac
 +++ b/configure.ac
-@@ -710,160 +710,27 @@ fi
+@@ -722,160 +722,27 @@ fi
  MULTIARCH=$($CC --print-multiarch 2>/dev/null)
  AC_SUBST(MULTIARCH)
  
@@ -204,6 +204,3 @@ index ede710e..bc81b0b 100644
  
  if test x$PLATFORM_TRIPLET != x && test x$MULTIARCH != x; then
    if test x$PLATFORM_TRIPLET != x$MULTIARCH; then
--- 
-2.24.1
-
diff --git a/meta/recipes-devtools/python/python3/0001-configure.ac-fix-LIBPL.patch b/meta/recipes-devtools/python/python3/0001-configure.ac-fix-LIBPL.patch
deleted file mode 100644
index 123ce3a2dc..0000000000
--- a/meta/recipes-devtools/python/python3/0001-configure.ac-fix-LIBPL.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From acce3d441e7eadadd2d3ce38654155dc43f1f607 Mon Sep 17 00:00:00 2001
-From: Changqing Li <changqing.li@windriver.com>
-Date: Fri, 7 Feb 2020 09:36:25 +0800
-Subject: [PATCH] configure.ac: fix LIBPL
-
-Use LIBDIR rather than prefix/lib, so that it would work when lib64.
-
-Upstream-Status: Inappropriate [oe-core specific]
-
-Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
-Signed-off-by: Li Zhou <li.zhou@windriver.c>
-Signed-off-by: Changqing Li <changqing.li@windriver.com>
----
- configure.ac | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index ce04258..915f475 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -4532,9 +4532,9 @@ fi
- dnl define LIBPL after ABIFLAGS and LDVERSION is defined.
- AC_SUBST(PY_ENABLE_SHARED)
- if test x$PLATFORM_TRIPLET = x; then
--  LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}"
-+  LIBPL='$(LIBDIR)'"/python${VERSION}/config-${LDVERSION}"
- else
--  LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}-${PLATFORM_TRIPLET}"
-+  LIBPL='$(LIBDIR)'"/python${VERSION}/config-${LDVERSION}-${PLATFORM_TRIPLET}"
- fi
- AC_SUBST(LIBPL)
-
---
-2.7.4
-
diff --git a/meta/recipes-devtools/python/python3/0001-distutils-sysconfig-append-STAGING_LIBDIR-python-sys.patch b/meta/recipes-devtools/python/python3/0001-distutils-sysconfig-append-STAGING_LIBDIR-python-sys.patch
index 2b68c0acc2..d8a296236f 100644
--- a/meta/recipes-devtools/python/python3/0001-distutils-sysconfig-append-STAGING_LIBDIR-python-sys.patch
+++ b/meta/recipes-devtools/python/python3/0001-distutils-sysconfig-append-STAGING_LIBDIR-python-sys.patch
@@ -1,4 +1,4 @@
-From bc59d49efff41051034d7fbf5d0c8505e4c3134b Mon Sep 17 00:00:00 2001
+From 5e3b6807b59ad9dbae0727b75a0e603f474d6451 Mon Sep 17 00:00:00 2001
 From: Alexander Kanavin <alex.kanavin@gmail.com>
 Date: Thu, 31 Jan 2019 16:46:30 +0100
 Subject: [PATCH] distutils/sysconfig: append
@@ -15,10 +15,10 @@ Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
  2 files changed, 4 insertions(+)
 
 diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
-index b51629e..2df348c 100644
+index 37feae5..4774e12 100644
 --- a/Lib/distutils/sysconfig.py
 +++ b/Lib/distutils/sysconfig.py
-@@ -438,6 +438,8 @@ def _init_posix():
+@@ -444,6 +444,8 @@ def _init_posix():
          platform=sys.platform,
          multiarch=getattr(sys.implementation, '_multiarch', ''),
      ))
@@ -28,10 +28,10 @@ index b51629e..2df348c 100644
      build_time_vars = _temp.build_time_vars
      global _config_vars
 diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py
-index b2d790b..405273c 100644
+index bf04ac5..010f9ef 100644
 --- a/Lib/sysconfig.py
 +++ b/Lib/sysconfig.py
-@@ -419,6 +419,8 @@ def _init_posix(vars):
+@@ -417,6 +417,8 @@ def _init_posix(vars):
      """Initialize the module as appropriate for POSIX systems."""
      # _sysconfigdata is generated at build time, see _generate_posix_vars()
      name = _get_sysconfigdata_name()
diff --git a/meta/recipes-devtools/python/python3/0001-python3-Do-not-hardcode-lib-for-distutils.patch b/meta/recipes-devtools/python/python3/0001-python3-Do-not-hardcode-lib-for-distutils.patch
deleted file mode 100644
index fe031b9983..0000000000
--- a/meta/recipes-devtools/python/python3/0001-python3-Do-not-hardcode-lib-for-distutils.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From bb711b53f10d32a90a27ccf4b0dc51e4a701d862 Mon Sep 17 00:00:00 2001
-From: Changqing Li <changqing.li@windriver.com>
-Date: Fri, 7 Feb 2020 09:42:09 +0800
-Subject: [PATCH] python3: Do not hardcode "lib" for distutils
-
-Get the sys.lib from python3 itself and do not use
-hardcoded value of 'lib' for distutils.
-
-Upstream-Status: Inappropriate [oe-core specific]
-
-Signed-off-by: Li Zhou <li.zhou@windriver.com>
-Signed-off-by: Changqing Li <changqing.li@windriver.com>
----
- Lib/distutils/command/install.py | 6 ++++--
- 1 file changed, 4 insertions(+), 2 deletions(-)
-
-diff --git a/Lib/distutils/command/install.py b/Lib/distutils/command/install.py
-index c625c95..8e32f54 100644
---- a/Lib/distutils/command/install.py
-+++ b/Lib/distutils/command/install.py
-@@ -19,6 +19,8 @@ from site import USER_BASE
- from site import USER_SITE
- HAS_USER_SITE = True
-
-+libname = sys.lib
-+
- WINDOWS_SCHEME = {
-     'purelib': '$base/Lib/site-packages',
-     'platlib': '$base/Lib/site-packages',
-@@ -29,8 +31,8 @@ WINDOWS_SCHEME = {
-
- INSTALL_SCHEMES = {
-     'unix_prefix': {
--        'purelib': '$base/lib/python$py_version_short/site-packages',
--        'platlib': '$platbase/lib/python$py_version_short/site-packages',
-+        'purelib': '$base/' + libname + '/python$py_version_short/site-packages',
-+        'platlib': '$platbase/' + libname + '/python$py_version_short/site-packages',
-         'headers': '$base/include/python$py_version_short$abiflags/$dist_name',
-         'scripts': '$base/bin',
-         'data'   : '$base',
---
-2.7.4
-
diff --git a/meta/recipes-devtools/python/python3/0001-python3-use-cc_basename-to-replace-CC-for-checking-c.patch b/meta/recipes-devtools/python/python3/0001-python3-use-cc_basename-to-replace-CC-for-checking-c.patch
index fb10ca94b3..4c182d2f9e 100644
--- a/meta/recipes-devtools/python/python3/0001-python3-use-cc_basename-to-replace-CC-for-checking-c.patch
+++ b/meta/recipes-devtools/python/python3/0001-python3-use-cc_basename-to-replace-CC-for-checking-c.patch
@@ -1,4 +1,4 @@
-From 994783da5c21cab81b6589ed2d4275e665a946f9 Mon Sep 17 00:00:00 2001
+From a1a529f61464a222ed0391e422a5824601178fc5 Mon Sep 17 00:00:00 2001
 From: Changqing Li <changqing.li@windriver.com>
 Date: Mon, 22 Oct 2018 15:19:51 +0800
 Subject: [PATCH] python3: use cc_basename to replace CC for checking compiler
@@ -27,7 +27,7 @@ Signed-off-by: Changqing Li <changqing.li@windriver.com>
  1 file changed, 10 insertions(+), 9 deletions(-)
 
 diff --git a/configure.ac b/configure.ac
-index a189d42..0f85486 100644
+index d60f052..e491e24 100644
 --- a/configure.ac
 +++ b/configure.ac
 @@ -54,6 +54,7 @@ AC_CONFIG_HEADER(pyconfig.h)
@@ -38,7 +38,7 @@ index a189d42..0f85486 100644
  
  # pybuilddir.txt will be created by --generate-posix-vars in the Makefile
  rm -f pybuilddir.txt
-@@ -671,7 +672,7 @@ AC_MSG_RESULT($with_cxx_main)
+@@ -689,7 +690,7 @@ AC_MSG_RESULT($with_cxx_main)
  preset_cxx="$CXX"
  if test -z "$CXX"
  then
@@ -47,7 +47,7 @@ index a189d42..0f85486 100644
          gcc)    AC_PATH_TOOL(CXX, [g++], [g++], [notfound]) ;;
          cc)     AC_PATH_TOOL(CXX, [c++], [c++], [notfound]) ;;
          clang|*/clang)     AC_PATH_TOOL(CXX, [clang++], [clang++], [notfound]) ;;
-@@ -957,7 +958,7 @@ rmdir CaseSensitiveTestDir
+@@ -975,7 +976,7 @@ rmdir CaseSensitiveTestDir
  
  case $ac_sys_system in
  hp*|HP*)
@@ -56,7 +56,7 @@ index a189d42..0f85486 100644
      cc|*/cc) CC="$CC -Ae";;
      esac;;
  esac
-@@ -1335,7 +1336,7 @@ else
+@@ -1366,7 +1367,7 @@ else
  fi],
  [AC_MSG_RESULT(no)])
  if test "$Py_LTO" = 'true' ; then
@@ -65,7 +65,7 @@ index a189d42..0f85486 100644
      *clang*)
        AC_SUBST(LLVM_AR)
        AC_PATH_TOOL(LLVM_AR, llvm-ar, '', ${llvm_path})
-@@ -1425,7 +1426,7 @@ then
+@@ -1456,7 +1457,7 @@ then
    fi
  fi
  LLVM_PROF_ERR=no
@@ -74,7 +74,7 @@ index a189d42..0f85486 100644
    *clang*)
      # Any changes made here should be reflected in the GCC+Darwin case below
      PGO_PROF_GEN_FLAG="-fprofile-instr-generate"
-@@ -1486,7 +1487,7 @@ esac
+@@ -1517,7 +1518,7 @@ esac
  # compiler and platform.  BASECFLAGS tweaks need to be made even if the
  # user set OPT.
  
@@ -83,7 +83,7 @@ index a189d42..0f85486 100644
      *clang*)
          cc_is_clang=1
          ;;
-@@ -1622,7 +1623,7 @@ yes)
+@@ -1653,7 +1654,7 @@ yes)
  
      # ICC doesn't recognize the option, but only emits a warning
      ## XXX does it emit an unused result warning and can it be disabled?
@@ -92,16 +92,16 @@ index a189d42..0f85486 100644
      *icc*)
      ac_cv_disable_unused_result_warning=no
      ;;
-@@ -1943,7 +1944,7 @@ yes)
+@@ -1993,7 +1994,7 @@ yes)
+     ;;
  esac
  
- # ICC needs -fp-model strict or floats behave badly
 -case "$CC" in
 +case "$cc_basename" in
  *icc*)
+     # ICC needs -fp-model strict or floats behave badly
      CFLAGS_NODIST="$CFLAGS_NODIST -fp-model strict"
-     ;;
-@@ -2711,7 +2712,7 @@ then
+@@ -2765,7 +2766,7 @@ then
  		then
  			LINKFORSHARED="-Wl,--export-dynamic"
  		fi;;
@@ -110,7 +110,7 @@ index a189d42..0f85486 100644
  		  *gcc*)
  		    if $CC -Xlinker --help 2>&1 | grep export-dynamic >/dev/null
  		    then
-@@ -5362,7 +5363,7 @@ if test "$have_gcc_asm_for_x87" = yes; then
+@@ -5507,7 +5508,7 @@ if test "$have_gcc_asm_for_x87" = yes; then
      # Some versions of gcc miscompile inline asm:
      # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46491
      # http://gcc.gnu.org/ml/gcc/2010-11/msg00366.html
diff --git a/meta/recipes-devtools/python/python3/0001-setup.py-pass-missing-libraries-to-Extension-for-mul.patch b/meta/recipes-devtools/python/python3/0001-setup.py-pass-missing-libraries-to-Extension-for-mul.patch
index ea0af02e72..7ca6753172 100644
--- a/meta/recipes-devtools/python/python3/0001-setup.py-pass-missing-libraries-to-Extension-for-mul.patch
+++ b/meta/recipes-devtools/python/python3/0001-setup.py-pass-missing-libraries-to-Extension-for-mul.patch
@@ -1,4 +1,4 @@
-From 7019ba184b828ed7253750cf409fc5760ef90a54 Mon Sep 17 00:00:00 2001
+From 1bf39bd881a73fd0b9564b46c9e5a126f8483b3d Mon Sep 17 00:00:00 2001
 From: Alexander Kanavin <alex.kanavin@gmail.com>
 Date: Thu, 9 Jan 2020 17:44:05 +0100
 Subject: [PATCH] setup.py: pass missing libraries to Extension for
@@ -50,15 +50,16 @@ Upstream-Status: Pending
 
 Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
 Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+
 ---
  setup.py | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/setup.py b/setup.py
-index ec3f2a4..b0f1541 100644
+index 8cf058c..9c1c33b 100644
 --- a/setup.py
 +++ b/setup.py
-@@ -1671,7 +1671,7 @@ class PyBuildExt(build_ext):
+@@ -1777,7 +1777,7 @@ class PyBuildExt(build_ext):
                                     libraries=libs,
                                     include_dirs=["Modules/_multiprocessing"]))
  
diff --git a/meta/recipes-devtools/python/python3/0001-test_locale.py-correct-the-test-output-format.patch b/meta/recipes-devtools/python/python3/0001-test_locale.py-correct-the-test-output-format.patch
index 35b7e0c480..bd5f406708 100644
--- a/meta/recipes-devtools/python/python3/0001-test_locale.py-correct-the-test-output-format.patch
+++ b/meta/recipes-devtools/python/python3/0001-test_locale.py-correct-the-test-output-format.patch
@@ -1,4 +1,4 @@
-From b94995e0c694ec9561efec0d1a59b323340e6105 Mon Sep 17 00:00:00 2001
+From b2d5ab7c71741bbf27ec4690243244a4de72cfc0 Mon Sep 17 00:00:00 2001
 From: Mingli Yu <mingli.yu@windriver.com>
 Date: Mon, 5 Aug 2019 15:57:39 +0800
 Subject: [PATCH] test_locale.py: correct the test output format
@@ -24,15 +24,16 @@ Before this patch:
 Upstream-Status: Submitted [https://github.com/python/cpython/pull/15132]
 
 Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
+
 ---
  Lib/test/test_locale.py | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/Lib/test/test_locale.py b/Lib/test/test_locale.py
-index e2c2178..558d63c 100644
+index 2863d20..2ed141c 100644
 --- a/Lib/test/test_locale.py
 +++ b/Lib/test/test_locale.py
-@@ -527,7 +527,7 @@ class TestMiscellaneous(unittest.TestCase):
+@@ -562,7 +562,7 @@ class TestMiscellaneous(unittest.TestCase):
              self.skipTest('test needs Turkish locale')
          loc = locale.getlocale(locale.LC_CTYPE)
          if verbose:
@@ -41,6 +42,3 @@ index e2c2178..558d63c 100644
          locale.setlocale(locale.LC_CTYPE, loc)
          self.assertEqual(loc, locale.getlocale(locale.LC_CTYPE))
  
--- 
-2.7.4
-
diff --git a/meta/recipes-devtools/python/python3/0017-setup.py-do-not-report-missing-dependencies-for-disa.patch b/meta/recipes-devtools/python/python3/0017-setup.py-do-not-report-missing-dependencies-for-disa.patch
index 4bd98f62fd..d0ff3219a6 100644
--- a/meta/recipes-devtools/python/python3/0017-setup.py-do-not-report-missing-dependencies-for-disa.patch
+++ b/meta/recipes-devtools/python/python3/0017-setup.py-do-not-report-missing-dependencies-for-disa.patch
@@ -1,4 +1,4 @@
-From a2dd127b4163aff6cc35af0d0251321964232ad4 Mon Sep 17 00:00:00 2001
+From 5d85a94fd0965aa26adf593b5f84948e9c502121 Mon Sep 17 00:00:00 2001
 From: Alexander Kanavin <alex.kanavin@gmail.com>
 Date: Mon, 7 Oct 2019 13:22:14 +0200
 Subject: [PATCH] setup.py: do not report missing dependencies for disabled
@@ -11,20 +11,24 @@ build completeness checker which relies on the report.
 Upstream-Status: Inappropriate [oe-core specific]
 Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
 
+Rebased for 3.9 [10/2020]
+Signed-off-by: Alejandro Enedino Hernandez Samaniego <alejandro.hernandez@linux.microsoft.com>
+
 ---
- setup.py | 4 ++++
- 1 file changed, 4 insertions(+)
+ setup.py | 5 +++++
+ 1 file changed, 5 insertions(+)
 
 diff --git a/setup.py b/setup.py
-index 7691258..ec3f2a4 100644
+index ab9fb8e..8cf058c 100644
 --- a/setup.py
 +++ b/setup.py
-@@ -408,6 +408,10 @@ class PyBuildExt(build_ext):
+@@ -495,6 +495,11 @@ class PyBuildExt(build_ext):
                  print("%-*s   %-*s   %-*s" % (longest, e, longest, f,
                                                longest, g))
  
 +        # There is no need to report missing module dependencies,
 +        # if the modules have been disabled in the first place.
++        sysconf_dis = sysconfig.get_config_var('MODDISABLED_NAMES').split()
 +        self.missing = list(set(self.missing) - set(sysconf_dis))
 +
          if self.missing:
diff --git a/meta/recipes-devtools/python/python3/0020-configure.ac-setup.py-do-not-add-a-curses-include-pa.patch b/meta/recipes-devtools/python/python3/0020-configure.ac-setup.py-do-not-add-a-curses-include-pa.patch
index e04a91605c..daa133e1e0 100644
--- a/meta/recipes-devtools/python/python3/0020-configure.ac-setup.py-do-not-add-a-curses-include-pa.patch
+++ b/meta/recipes-devtools/python/python3/0020-configure.ac-setup.py-do-not-add-a-curses-include-pa.patch
@@ -1,4 +1,4 @@
-From 863c09f640a5dfd33ff22915b0d5fee7bc5df70a Mon Sep 17 00:00:00 2001
+From 5e75ab6ff0e5714684d71a3e75d389cdc1c2e783 Mon Sep 17 00:00:00 2001
 From: Alexander Kanavin <alex.kanavin@gmail.com>
 Date: Sun, 16 Feb 2020 17:50:25 +0100
 Subject: [PATCH] configure.ac, setup.py: do not add a curses include path from
@@ -11,16 +11,17 @@ as dnf failures).
 
 Upstream-Status: Inappropriate [oe-core specific]
 Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+
 ---
  configure.ac | 6 ------
  setup.py     | 2 --
  2 files changed, 8 deletions(-)
 
 diff --git a/configure.ac b/configure.ac
-index 915f475..c911011 100644
+index 01ea772..7ee38f6 100644
 --- a/configure.ac
 +++ b/configure.ac
-@@ -4828,12 +4828,6 @@ then
+@@ -4977,12 +4977,6 @@ then
    [Define if you have struct stat.st_mtimensec])
  fi
  
@@ -34,10 +35,10 @@ index 915f475..c911011 100644
  
  # On Solaris, term.h requires curses.h
 diff --git a/setup.py b/setup.py
-index b0f1541..7208cd0 100644
+index 9c1c33b..a456e53 100644
 --- a/setup.py
 +++ b/setup.py
-@@ -973,8 +973,6 @@ class PyBuildExt(build_ext):
+@@ -1075,8 +1075,6 @@ class PyBuildExt(build_ext):
          panel_library = 'panel'
          if curses_library == 'ncursesw':
              curses_defines.append(('HAVE_NCURSESW', '1'))
diff --git a/meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch b/meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch
index 820fb98ed8..bacdfba5ef 100644
--- a/meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch
+++ b/meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch
@@ -1,4 +1,4 @@
-From 064187668fcbefdd39a8cde372bf651124c3e578 Mon Sep 17 00:00:00 2001
+From a05f77261dbabea29d05c249bfc2d8632e550b6a Mon Sep 17 00:00:00 2001
 From: Khem Raj <raj.khem@gmail.com>
 Date: Tue, 14 May 2013 15:00:26 -0700
 Subject: [PATCH] python3: Add target and native recipes
@@ -6,6 +6,7 @@ Subject: [PATCH] python3: Add target and native recipes
 Upstream-Status: Inappropriate [embedded specific]
 
 02/2015 Rebased for Python 3.4.2
+10/2020 Rebased for Python 3.9.0
 
 # The proper prefix is inside our staging area.
 # Signed-Off: Michael 'Mickey' Lauer <mickey@vanille-media.de>
@@ -18,10 +19,10 @@ Upstream-Status: Inappropriate [embedded specific]
  1 file changed, 11 insertions(+), 3 deletions(-)
 
 diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
-index 2df348c..4f8db84 100644
+index 4774e12..5468239 100644
 --- a/Lib/distutils/sysconfig.py
 +++ b/Lib/distutils/sysconfig.py
-@@ -96,7 +96,9 @@ def get_python_inc(plat_specific=0, prefix=None):
+@@ -95,7 +95,9 @@ def get_python_inc(plat_specific=0, prefix=None):
      If 'prefix' is supplied, use it instead of sys.base_prefix or
      sys.base_exec_prefix -- i.e., ignore 'plat_specific'.
      """
@@ -32,7 +33,7 @@ index 2df348c..4f8db84 100644
          prefix = plat_specific and BASE_EXEC_PREFIX or BASE_PREFIX
      if os.name == "posix":
          if python_build:
-@@ -139,7 +141,13 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
+@@ -138,7 +140,13 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
      If 'prefix' is supplied, use it instead of sys.base_prefix or
      sys.base_exec_prefix -- i.e., ignore 'plat_specific'.
      """
@@ -47,12 +48,12 @@ index 2df348c..4f8db84 100644
          if standard_lib:
              prefix = plat_specific and BASE_EXEC_PREFIX or BASE_PREFIX
          else:
-@@ -147,7 +155,7 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
- 
-     if os.name == "posix":
-         libpython = os.path.join(prefix,
--                                 "lib", "python" + get_python_version())
-+                                 lib_basename, "python" + get_python_version())
-         if standard_lib:
-             return libpython
+@@ -151,7 +159,7 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
+             libdir = sys.platlibdir
          else:
+             # Pure Python
+-            libdir = "lib"
++            libdir = "lib_basename"
+         libpython = os.path.join(prefix, libdir,
+                                  "python" + get_python_version())
+         if standard_lib:
diff --git a/meta/recipes-devtools/python/python3/avoid_warning_about_tkinter.patch b/meta/recipes-devtools/python/python3/avoid_warning_about_tkinter.patch
index 184540e794..4dfa639669 100644
--- a/meta/recipes-devtools/python/python3/avoid_warning_about_tkinter.patch
+++ b/meta/recipes-devtools/python/python3/avoid_warning_about_tkinter.patch
@@ -1,4 +1,4 @@
-From ba7202700578d435b07cfdfb7b57e83185752800 Mon Sep 17 00:00:00 2001
+From f0653707a6a310bd059fe4dc3146052bb38b5d83 Mon Sep 17 00:00:00 2001
 From: Andrei Gherzan <andrei@gherzan.ro>
 Date: Mon, 28 Jan 2019 15:57:54 +0000
 Subject: [PATCH] _tkinter module needs tk module along with tcl. tk is not yet
@@ -15,10 +15,10 @@ Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
  1 file changed, 2 insertions(+), 2 deletions(-)
 
 diff --git a/setup.py b/setup.py
-index ab18ff0..7691258 100644
+index d3ccc6c..ab9fb8e 100644
 --- a/setup.py
 +++ b/setup.py
-@@ -1706,8 +1706,8 @@ class PyBuildExt(build_ext):
+@@ -1811,8 +1811,8 @@ class PyBuildExt(build_ext):
          self.detect_decimal()
          self.detect_ctypes()
          self.detect_multiprocessing()
diff --git a/meta/recipes-devtools/python/python3/cgi_py.patch b/meta/recipes-devtools/python/python3/cgi_py.patch
index 6c4ba54320..493fdf0ab8 100644
--- a/meta/recipes-devtools/python/python3/cgi_py.patch
+++ b/meta/recipes-devtools/python/python3/cgi_py.patch
@@ -1,4 +1,4 @@
-From 62336285cba38017b35cb761c03f0c7e80a671a3 Mon Sep 17 00:00:00 2001
+From 5da956e20d53cfdb687b8b8c3c15cfe926961ada Mon Sep 17 00:00:00 2001
 From: Mark Hatle <mark.hatle@windriver.com>
 Date: Wed, 21 Sep 2011 20:55:33 -0500
 Subject: [PATCH] Lib/cgi.py: Update the script as mentioned in the comment
@@ -12,7 +12,7 @@ Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
  1 file changed, 1 insertion(+), 10 deletions(-)
 
 diff --git a/Lib/cgi.py b/Lib/cgi.py
-index 8cf6687..094c7b4 100755
+index 77ab703..3edaf60 100755
 --- a/Lib/cgi.py
 +++ b/Lib/cgi.py
 @@ -1,13 +1,4 @@
diff --git a/meta/recipes-devtools/python/python3/crosspythonpath.patch b/meta/recipes-devtools/python/python3/crosspythonpath.patch
index d789ab57d4..f4c3b93782 100644
--- a/meta/recipes-devtools/python/python3/crosspythonpath.patch
+++ b/meta/recipes-devtools/python/python3/crosspythonpath.patch
@@ -1,4 +1,8 @@
-configure.ac: add CROSSPYTHONPATH into PYTHONPATH for PYTHON_FOR_BUILD
+From 9dabb16c327211b8fb9327d06d66c7ef6baea4b2 Mon Sep 17 00:00:00 2001
+From: Ricardo Ribalda <ricardo@ribalda.com>
+Date: Tue, 18 Nov 2014 03:35:33 -0500
+Subject: [PATCH] configure.ac: add CROSSPYTHONPATH into PYTHONPATH for
+ PYTHON_FOR_BUILD
 
 When building x86->x86 the system will try to execute .so and related items
 from the default PYTHONPATH.  This will fail if the target CPU contains
@@ -10,8 +14,13 @@ Upstream-Status: Inappropriate [OE-Core integration specific]
 Credits-to: Mark Hatle <mark.hatle@windriver.com>
 Credits-to: Jackie Huang <jackie.huang@windriver.com>
 Signed-off-by: Ricardo Ribalda <ricardo@ribalda.com>
+
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
 diff --git a/configure.ac b/configure.ac
-index 4ab19a6..7036a53 100644
+index 784850b..01ea772 100644
 --- a/configure.ac
 +++ b/configure.ac
 @@ -76,7 +76,7 @@ if test "$cross_compiling" = yes; then
diff --git a/meta/recipes-devtools/python/python3/python-config.patch b/meta/recipes-devtools/python/python3/python-config.patch
index c8a8f3d4aa..98b28bcbde 100644
--- a/meta/recipes-devtools/python/python3/python-config.patch
+++ b/meta/recipes-devtools/python/python3/python-config.patch
@@ -1,4 +1,4 @@
-From 07df0ae0d70cba6d1847fe1c24a71063930bec60 Mon Sep 17 00:00:00 2001
+From bf238a78ec90671789c6498bede99928cb7244e5 Mon Sep 17 00:00:00 2001
 From: Tyler Hall <tylerwhall@gmail.com>
 Date: Sun, 4 May 2014 20:06:43 -0400
 Subject: [PATCH] python-config: Revert to using distutils.sysconfig
@@ -21,7 +21,7 @@ Signed-off-by: Tyler Hall <tylerwhall@gmail.com>
  1 file changed, 5 insertions(+), 5 deletions(-)
 
 diff --git a/Misc/python-config.in b/Misc/python-config.in
-index 727c4a8..c702829 100644
+index ebd99da..13e57ae 100644
 --- a/Misc/python-config.in
 +++ b/Misc/python-config.in
 @@ -6,7 +6,7 @@
@@ -37,11 +37,11 @@ index 727c4a8..c702829 100644
  
  for opt in opt_flags:
      if opt == '--prefix':
--        print(sysconfig.get_config_var('prefix'))
+-        print(getvar('prefix'))
 +        print(sysconfig.PREFIX)
  
      elif opt == '--exec-prefix':
--        print(sysconfig.get_config_var('exec_prefix'))
+-        print(getvar('exec_prefix'))
 +        print(sysconfig.EXEC_PREFIX)
  
      elif opt in ('--includes', '--cflags'):
diff --git a/meta/recipes-devtools/python/python3_3.8.5.bb b/meta/recipes-devtools/python/python3_3.9.0.bb
similarity index 95%
rename from meta/recipes-devtools/python/python3_3.8.5.bb
rename to meta/recipes-devtools/python/python3_3.9.0.bb
index 2a3c52a116..bd1d40edce 100644
--- a/meta/recipes-devtools/python/python3_3.8.5.bb
+++ b/meta/recipes-devtools/python/python3_3.9.0.bb
@@ -1,9 +1,9 @@
 SUMMARY = "The Python Programming Language"
 HOMEPAGE = "http://www.python.org"
-LICENSE = "PSFv2"
+LICENSE = "PSFv2 & BSD-0-Clause"
 SECTION = "devel/python"
 
-LIC_FILES_CHKSUM = "file://LICENSE;md5=203a6dbc802ee896020a47161e759642"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=33223c9ef60c31e3f0e866cb09b65e83"
 
 SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz \
            file://run-ptest \
@@ -17,7 +17,6 @@ SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz \
            file://0001-Do-not-use-the-shell-version-of-python-config-that-w.patch \
            file://python-config.patch \
            file://0001-Makefile.pre-use-qemu-wrapper-when-gathering-profile.patch \
-           file://0001-Do-not-hardcode-lib-as-location-for-site-packages-an.patch \
            file://0001-python3-use-cc_basename-to-replace-CC-for-checking-c.patch \
            file://0001-Lib-sysconfig.py-fix-another-place-where-lib-is-hard.patch \
            file://0001-Makefile-fix-Issue36464-parallel-build-race-problem.patch \
@@ -29,19 +28,17 @@ SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz \
            file://0017-setup.py-do-not-report-missing-dependencies-for-disa.patch \
            file://0001-setup.py-pass-missing-libraries-to-Extension-for-mul.patch \
            file://0001-Makefile-do-not-compile-.pyc-in-parallel.patch \
-           file://0001-configure.ac-fix-LIBPL.patch \
-           file://0001-python3-Do-not-hardcode-lib-for-distutils.patch \
            file://0020-configure.ac-setup.py-do-not-add-a-curses-include-pa.patch \
            "
 
+
 SRC_URI_append_class-native = " \
            file://0001-distutils-sysconfig-append-STAGING_LIBDIR-python-sys.patch \
            file://12-distutils-prefix-is-inside-staging-area.patch \
            file://0001-Don-t-search-system-for-headers-libraries.patch \
            "
 
-SRC_URI[md5sum] = "35b5a3d0254c1c59be9736373d429db7"
-SRC_URI[sha256sum] = "e3003ed57db17e617acb382b0cade29a248c6026b1bd8aad1f976e9af66a83b0"
+SRC_URI[sha256sum] = "9c73e63c99855709b9be0b3cc9e5b072cb60f37311e8c4e50f15576a0bf82854"
 
 # exclude pre-releases for both python 2.x and 3.x
 UPSTREAM_CHECK_REGEX = "[Pp]ython-(?P<pver>\d+(\.\d+)+).tar"
@@ -52,7 +49,7 @@ CVE_PRODUCT = "python"
 # This is not exploitable when glibc has CVE-2016-10739 fixed.
 CVE_CHECK_WHITELIST += "CVE-2019-18348"
 
-PYTHON_MAJMIN = "3.8"
+PYTHON_MAJMIN = "3.9"
 
 S = "${WORKDIR}/Python-${PV}"
 
@@ -71,7 +68,7 @@ DEPENDS = "bzip2-replacement-native libffi bzip2 openssl sqlite3 zlib virtual/li
 DEPENDS_append_class-target = " python3-native"
 DEPENDS_append_class-nativesdk = " python3-native"
 
-EXTRA_OECONF = " --without-ensurepip --enable-shared"
+EXTRA_OECONF = " --without-ensurepip --enable-shared --with-platlibdir=${baselib}"
 EXTRA_OECONF_append_class-native = " --bindir=${bindir}/${PN}"
 
 export CROSSPYTHONPATH="${STAGING_LIBDIR_NATIVE}/python${PYTHON_MAJMIN}/lib-dynload/"
@@ -115,7 +112,6 @@ CPPFLAGS_append = " -I${STAGING_INCDIR}/ncursesw -I${STAGING_INCDIR}/uuid"
 EXTRA_OEMAKE = '\
   STAGING_LIBDIR=${STAGING_LIBDIR} \
   STAGING_INCDIR=${STAGING_INCDIR} \
-  LIB=${baselib} \
 '
 
 do_compile_prepend_class-target() {
@@ -179,7 +175,6 @@ py_package_preprocess () {
                 -e 's:${RECIPE_SYSROOT_NATIVE}::g' \
                 -e 's:${RECIPE_SYSROOT}::g' \
                 -e 's:${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}::g' \
-                ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config-${PYTHON_MAJMIN}${PYTHON_ABI}*/Makefile \
                 ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata*.py \
                 ${PKGD}/${bindir}/python${PYTHON_MAJMIN}-config
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [OE-core] [PATCH 2/2] python3: upgrade to python 3.9.0
  2020-10-24 21:20 ` [PATCH 2/2] python3: upgrade to python 3.9.0 Alejandro Hernandez Samaniego
@ 2020-10-24 21:35   ` Alexander Kanavin
  2020-10-24 21:59     ` Alejandro Hernandez Samaniego
  2021-03-20  9:57     ` Martin Jansa
  0 siblings, 2 replies; 6+ messages in thread
From: Alexander Kanavin @ 2020-10-24 21:35 UTC (permalink / raw)
  To: Alejandro Hernandez Samaniego
  Cc: OE-core, Alejandro Enedino Hernandez Samaniego

[-- Attachment #1: Type: text/plain, Size: 57816 bytes --]

Haha, you beat me to it by a few minutes :)
http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/commit/?h=akanavin/package-version-updates&id=98049b60602b4bd3854e870e46705716e469277c

I have some additional fixes included though, coming from autobuilder runs.

Alex




On Sat, 24 Oct 2020 at 23:22, Alejandro Hernandez Samaniego <
alejandro@enedino.org> wrote:

> AFAIC the upstream fix to use --with-platlibdir can now replace the
> functinoality we put in place for multilib builds, this patch uses
> such config as well as removes some of the patches for that.
>
> - Fixes fuzz on patches
> - Rebased the rest to work on 3.9.0
> - License changedm, it now includes BSD Clause 0
>
> Signed-off-by: Alejandro Enedino Hernandez Samaniego <
> alejandro.hernandez@linux.microsoft.com>
> ---
>  meta/classes/python3-dir.bbclass              |   2 +-
>  ...ib-termcap-to-linker-flags-to-avoid-.patch |   6 +-
>  ...lib-as-location-for-site-packages-an.patch | 214 ------------------
>  ...hell-version-of-python-config-that-w.patch |   7 +-
>  ...-search-system-for-headers-libraries.patch |   6 +-
>  ...-fix-another-place-where-lib-is-hard.patch |  18 +-
>  ...file-do-not-compile-.pyc-in-parallel.patch |   7 +-
>  ...sue36464-parallel-build-race-problem.patch |  10 +-
>  ...-qemu-wrapper-when-gathering-profile.patch |   7 +-
>  ...FLAG_REF-always-for-interned-strings.patch |  12 +-
>  ...-detection-of-mips-architecture-for-.patch |  11 +-
>  .../python3/0001-configure.ac-fix-LIBPL.patch |  35 ---
>  ...fig-append-STAGING_LIBDIR-python-sys.patch |  10 +-
>  ...n3-Do-not-hardcode-lib-for-distutils.patch |  43 ----
>  ...asename-to-replace-CC-for-checking-c.patch |  26 +--
>  ...ssing-libraries-to-Extension-for-mul.patch |   7 +-
>  ...le.py-correct-the-test-output-format.patch |  10 +-
>  ...report-missing-dependencies-for-disa.patch |  14 +-
>  ...up.py-do-not-add-a-curses-include-pa.patch |  11 +-
>  ...tutils-prefix-is-inside-staging-area.patch |  25 +-
>  .../python3/avoid_warning_about_tkinter.patch |   6 +-
>  .../python/python3/cgi_py.patch               |   4 +-
>  .../python/python3/crosspythonpath.patch      |  13 +-
>  .../python/python3/python-config.patch        |   8 +-
>  .../{python3_3.8.5.bb => python3_3.9.0.bb}    |  17 +-
>  25 files changed, 123 insertions(+), 406 deletions(-)
>  delete mode 100644
> meta/recipes-devtools/python/python3/0001-Do-not-hardcode-lib-as-location-for-site-packages-an.patch
>  delete mode 100644
> meta/recipes-devtools/python/python3/0001-configure.ac-fix-LIBPL.patch
>  delete mode 100644
> meta/recipes-devtools/python/python3/0001-python3-Do-not-hardcode-lib-for-distutils.patch
>  rename meta/recipes-devtools/python/{python3_3.8.5.bb => python3_3.9.0.bb}
> (95%)
>
> diff --git a/meta/classes/python3-dir.bbclass
> b/meta/classes/python3-dir.bbclass
> index 036d7140d9..f51f971fc5 100644
> --- a/meta/classes/python3-dir.bbclass
> +++ b/meta/classes/python3-dir.bbclass
> @@ -1,4 +1,4 @@
> -PYTHON_BASEVERSION = "3.8"
> +PYTHON_BASEVERSION = "3.9"
>  PYTHON_ABI = ""
>  PYTHON_DIR = "python${PYTHON_BASEVERSION}"
>  PYTHON_PN = "python3"
> diff --git
> a/meta/recipes-devtools/python/python3/0001-Do-not-add-usr-lib-termcap-to-linker-flags-to-avoid-.patch
> b/meta/recipes-devtools/python/python3/0001-Do-not-add-usr-lib-termcap-to-linker-flags-to-avoid-.patch
> index 59592821d7..44354f44d4 100644
> ---
> a/meta/recipes-devtools/python/python3/0001-Do-not-add-usr-lib-termcap-to-linker-flags-to-avoid-.patch
> +++
> b/meta/recipes-devtools/python/python3/0001-Do-not-add-usr-lib-termcap-to-linker-flags-to-avoid-.patch
> @@ -1,4 +1,4 @@
> -From 039c53dd5baddec3359a05be0bff46a3b32bbb84 Mon Sep 17 00:00:00 2001
> +From 2b122b1e664a91b14a8d8074d342439c1892700a Mon Sep 17 00:00:00 2001
>  From: Alexander Kanavin <alex.kanavin@gmail.com>
>  Date: Fri, 25 Jan 2019 19:04:13 +0100
>  Subject: [PATCH] Do not add /usr/lib/termcap to linker flags to avoid host
> @@ -12,10 +12,10 @@ Signed-off-by: Alexander Kanavin <
> alex.kanavin@gmail.com>
>   1 file changed, 1 deletion(-)
>
>  diff --git a/setup.py b/setup.py
> -index 20d7f35..ab18ff0 100644
> +index 770866b..d3ccc6c 100644
>  --- a/setup.py
>  +++ b/setup.py
> -@@ -957,7 +957,6 @@ class PyBuildExt(build_ext):
> +@@ -1058,7 +1058,6 @@ class PyBuildExt(build_ext):
>                                                        'termcap'):
>                   readline_libs.append('termcap')
>               self.add(Extension('readline', ['readline.c'],
> diff --git
> a/meta/recipes-devtools/python/python3/0001-Do-not-hardcode-lib-as-location-for-site-packages-an.patch
> b/meta/recipes-devtools/python/python3/0001-Do-not-hardcode-lib-as-location-for-site-packages-an.patch
> deleted file mode 100644
> index 112c979441..0000000000
> ---
> a/meta/recipes-devtools/python/python3/0001-Do-not-hardcode-lib-as-location-for-site-packages-an.patch
> +++ /dev/null
> @@ -1,214 +0,0 @@
> -From a078b6ff1492e848ad1055764fb9a414abaf3e12 Mon Sep 17 00:00:00 2001
> -From: Alexander Kanavin <alex.kanavin@gmail.com>
> -Date: Tue, 5 Feb 2019 15:52:02 +0100
> -Subject: [PATCH] Do not hardcode "lib" as location for modules,
> site-packages
> - and lib-dynload
> -
> -Upstream-Status: Inappropriate [oe-core specific]
> -Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
> -
> ----
> - Include/pythonrun.h  |  2 ++
> - Lib/site.py          |  4 ++--
> - Makefile.pre.in      |  5 +++--
> - Modules/getpath.c    | 22 ++++++++++++++--------
> - Python/getplatform.c | 10 ++++++++++
> - Python/sysmodule.c   |  2 ++
> - 6 files changed, 33 insertions(+), 12 deletions(-)
> -
> -diff --git a/Include/pythonrun.h b/Include/pythonrun.h
> -index 46091e0..61b2e15 100644
> ---- a/Include/pythonrun.h
> -+++ b/Include/pythonrun.h
> -@@ -7,6 +7,8 @@
> - extern "C" {
> - #endif
> -
> -+PyAPI_FUNC(const char *) Py_GetLib(void);
> -+
> - #ifndef Py_LIMITED_API
> - PyAPI_FUNC(int) PyRun_SimpleStringFlags(const char *, PyCompilerFlags *);
> - PyAPI_FUNC(int) PyRun_AnyFileExFlags(
> -diff --git a/Lib/site.py b/Lib/site.py
> -index a065ab0..1d720ef 100644
> ---- a/Lib/site.py
> -+++ b/Lib/site.py
> -@@ -335,12 +335,12 @@ def getsitepackages(prefixes=None):
> -         seen.add(prefix)
> -
> -         if os.sep == '/':
> --            sitepackages.append(os.path.join(prefix, "lib",
> -+            sitepackages.append(os.path.join(prefix, sys.lib,
> -                                         "python%d.%d" %
> sys.version_info[:2],
> -                                         "site-packages"))
> -         else:
> -             sitepackages.append(prefix)
> --            sitepackages.append(os.path.join(prefix, "lib",
> "site-packages"))
> -+            sitepackages.append(os.path.join(prefix, sys.lib,
> "site-packages"))
> -     return sitepackages
> -
> - def addsitepackages(known_paths, prefixes=None):
> -diff --git a/Makefile.pre.in b/Makefile.pre.in
> -index 65665df..be49140 100644
> ---- a/Makefile.pre.in
> -+++ b/Makefile.pre.in
> -@@ -143,7 +143,7 @@ LIBDIR=            @libdir@
> - MANDIR=               @mandir@
> - INCLUDEDIR=   @includedir@
> - CONFINCLUDEDIR=       $(exec_prefix)/include
> --SCRIPTDIR=    $(prefix)/lib
> -+SCRIPTDIR=    @libdir@
> - ABIFLAGS=     @ABIFLAGS@
> -
> - # Detailed destination directories
> -@@ -753,6 +753,7 @@ Modules/getpath.o: $(srcdir)/Modules/getpath.c
> Makefile
> -               -DEXEC_PREFIX='"$(exec_prefix)"' \
> -               -DVERSION='"$(VERSION)"' \
> -               -DVPATH='"$(VPATH)"' \
> -+              -DLIB='"$(LIB)"' \
> -               -o $@ $(srcdir)/Modules/getpath.c
> -
> - Programs/python.o: $(srcdir)/Programs/python.c
> -@@ -868,7 +869,7 @@ regen-symbol: $(srcdir)/Include/graminit.h
> - Python/compile.o Python/symtable.o Python/ast_unparse.o Python/ast.o
> Python/future.o Parser/parsetok.o: $(srcdir)/Include/graminit.h
> $(srcdir)/Include/Python-ast.h
> -
> - Python/getplatform.o: $(srcdir)/Python/getplatform.c
> --              $(CC) -c $(PY_CORE_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@
> $(srcdir)/Python/getplatform.c
> -+              $(CC) -c $(PY_CORE_CFLAGS) -DPLATFORM='"$(MACHDEP)"'
> -DLIB='"$(LIB)"' -o $@ $(srcdir)/Python/getplatform.c
> -
> - Python/importdl.o: $(srcdir)/Python/importdl.c
> -               $(CC) -c $(PY_CORE_CFLAGS) -I$(DLINCLDIR) -o $@
> $(srcdir)/Python/importdl.c
> -diff --git a/Modules/getpath.c b/Modules/getpath.c
> -index b727f66..c003e46 100644
> ---- a/Modules/getpath.c
> -+++ b/Modules/getpath.c
> -@@ -128,6 +128,7 @@ typedef struct {
> -     wchar_t *exec_prefix;              /* EXEC_PREFIX macro */
> -
> -     wchar_t *lib_python;               /* "lib/pythonX.Y" */
> -+    wchar_t *multilib_python;               /* "lib[suffix]/pythonX.Y" */
> -
> -     int prefix_found;         /* found platform independent libraries? */
> -     int exec_prefix_found;    /* found the platform dependent libraries?
> */
> -@@ -386,7 +387,7 @@ search_for_prefix(PyCalculatePath *calculate,
> _PyPathConfig *pathconfig,
> -         if (delim) {
> -             *delim = L'\0';
> -         }
> --        status = joinpath(prefix, calculate->lib_python, prefix_len);
> -+        status = joinpath(prefix, calculate->multilib_python,
> prefix_len);
> -         if (_PyStatus_EXCEPTION(status)) {
> -             return status;
> -         }
> -@@ -444,7 +445,7 @@ search_for_prefix(PyCalculatePath *calculate,
> _PyPathConfig *pathconfig,
> -     do {
> -         /* Path: <argv0_path or substring> / <lib_python> / LANDMARK */
> -         size_t n = wcslen(prefix);
> --        status = joinpath(prefix, calculate->lib_python, prefix_len);
> -+        status = joinpath(prefix, calculate->multilib_python,
> prefix_len);
> -         if (_PyStatus_EXCEPTION(status)) {
> -             return status;
> -         }
> -@@ -467,7 +468,7 @@ search_for_prefix(PyCalculatePath *calculate,
> _PyPathConfig *pathconfig,
> -     if (safe_wcscpy(prefix, calculate->prefix, prefix_len) < 0) {
> -         return PATHLEN_ERR();
> -     }
> --    status = joinpath(prefix, calculate->lib_python, prefix_len);
> -+    status = joinpath(prefix, calculate->multilib_python, prefix_len);
> -     if (_PyStatus_EXCEPTION(status)) {
> -         return status;
> -     }
> -@@ -510,7 +511,7 @@ calculate_prefix(PyCalculatePath *calculate,
> _PyPathConfig *pathconfig,
> -         if (safe_wcscpy(prefix, calculate->prefix, prefix_len) < 0) {
> -             return PATHLEN_ERR();
> -         }
> --        status = joinpath(prefix, calculate->lib_python, prefix_len);
> -+        status = joinpath(prefix, calculate->multilib_python,
> prefix_len);
> -         if (_PyStatus_EXCEPTION(status)) {
> -             return status;
> -         }
> -@@ -635,7 +636,7 @@ search_for_exec_prefix(PyCalculatePath *calculate,
> _PyPathConfig *pathconfig,
> -                 return PATHLEN_ERR();
> -             }
> -         }
> --        status = joinpath(exec_prefix, calculate->lib_python,
> exec_prefix_len);
> -+        status = joinpath(exec_prefix, calculate->multilib_python,
> exec_prefix_len);
> -         if (_PyStatus_EXCEPTION(status)) {
> -             return status;
> -         }
> -@@ -667,7 +668,7 @@ search_for_exec_prefix(PyCalculatePath *calculate,
> _PyPathConfig *pathconfig,
> -     do {
> -         /* Path: <argv0_path or substring> / <lib_python> /
> "lib-dynload" */
> -         size_t n = wcslen(exec_prefix);
> --        status = joinpath(exec_prefix, calculate->lib_python,
> exec_prefix_len);
> -+        status = joinpath(exec_prefix, calculate->multilib_python,
> exec_prefix_len);
> -         if (_PyStatus_EXCEPTION(status)) {
> -             return status;
> -         }
> -@@ -689,7 +690,7 @@ search_for_exec_prefix(PyCalculatePath *calculate,
> _PyPathConfig *pathconfig,
> -     if (safe_wcscpy(exec_prefix, calculate->exec_prefix,
> exec_prefix_len) < 0) {
> -         return PATHLEN_ERR();
> -     }
> --    status = joinpath(exec_prefix, calculate->lib_python,
> exec_prefix_len);
> -+    status = joinpath(exec_prefix, calculate->multilib_python,
> exec_prefix_len);
> -     if (_PyStatus_EXCEPTION(status)) {
> -         return status;
> -     }
> -@@ -928,7 +929,7 @@ calculate_argv0_path(PyCalculatePath *calculate,
> const wchar_t *program_full_pat
> -             return PATHLEN_ERR();
> -         }
> -         reduce(argv0_path);
> --        status = joinpath(argv0_path, calculate->lib_python,
> argv0_path_len);
> -+        status = joinpath(argv0_path, calculate->multilib_python,
> argv0_path_len);
> -         if (_PyStatus_EXCEPTION(status)) {
> -             PyMem_RawFree(wbuf);
> -             return status;
> -@@ -1201,6 +1202,10 @@ calculate_init(PyCalculatePath *calculate, const
> PyConfig *config)
> -     if (!calculate->lib_python) {
> -         return DECODE_LOCALE_ERR("EXEC_PREFIX define", len);
> -     }
> -+    calculate->multilib_python = Py_DecodeLocale(LIB "/python" VERSION,
> &len);
> -+    if (!calculate->multilib_python) {
> -+        return DECODE_LOCALE_ERR("EXEC_PREFIX define", len);
> -+    }
> -
> -     calculate->warnings = config->pathconfig_warnings;
> -     calculate->pythonpath_env = config->pythonpath_env;
> -@@ -1216,6 +1221,7 @@ calculate_free(PyCalculatePath *calculate)
> -     PyMem_RawFree(calculate->prefix);
> -     PyMem_RawFree(calculate->exec_prefix);
> -     PyMem_RawFree(calculate->lib_python);
> -+    PyMem_RawFree(calculate->multilib_python);
> -     PyMem_RawFree(calculate->path_env);
> - }
> -
> -diff --git a/Python/getplatform.c b/Python/getplatform.c
> -index 81a0f7a..d55396b 100644
> ---- a/Python/getplatform.c
> -+++ b/Python/getplatform.c
> -@@ -10,3 +10,13 @@ Py_GetPlatform(void)
> - {
> -     return PLATFORM;
> - }
> -+
> -+#ifndef LIB
> -+#define LIB "lib"
> -+#endif
> -+
> -+const char *
> -+Py_GetLib(void)
> -+{
> -+      return LIB;
> -+}
> -diff --git a/Python/sysmodule.c b/Python/sysmodule.c
> -index 5b0fb81..0dce754 100644
> ---- a/Python/sysmodule.c
> -+++ b/Python/sysmodule.c
> -@@ -2668,6 +2668,8 @@ _PySys_InitCore(_PyRuntimeState *runtime,
> PyInterpreterState *interp,
> -                         PyUnicode_FromString(Py_GetCopyright()));
> -     SET_SYS_FROM_STRING("platform",
> -                         PyUnicode_FromString(Py_GetPlatform()));
> -+    SET_SYS_FROM_STRING("lib",
> -+                        PyUnicode_FromString(Py_GetLib()));
> -     SET_SYS_FROM_STRING("maxsize",
> -                         PyLong_FromSsize_t(PY_SSIZE_T_MAX));
> -     SET_SYS_FROM_STRING("float_info",
> diff --git
> a/meta/recipes-devtools/python/python3/0001-Do-not-use-the-shell-version-of-python-config-that-w.patch
> b/meta/recipes-devtools/python/python3/0001-Do-not-use-the-shell-version-of-python-config-that-w.patch
> index 83fd52d87f..7113ce2138 100644
> ---
> a/meta/recipes-devtools/python/python3/0001-Do-not-use-the-shell-version-of-python-config-that-w.patch
> +++
> b/meta/recipes-devtools/python/python3/0001-Do-not-use-the-shell-version-of-python-config-that-w.patch
> @@ -1,4 +1,4 @@
> -From 148861fa16f2aaacd518770f337ea54b5182f981 Mon Sep 17 00:00:00 2001
> +From 980fcf1a36bcb3ab26d4e82a304e205f02cb376f Mon Sep 17 00:00:00 2001
>  From: Alexander Kanavin <alex.kanavin@gmail.com>
>  Date: Tue, 29 Jan 2019 15:03:01 +0100
>  Subject: [PATCH] Do not use the shell version of python-config that was
> @@ -9,15 +9,16 @@ outputs directories correctly.
>
>  Upstream-Status: Inappropriate [oe-specific]
>  Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
> +
>  ---
>   Makefile.pre.in | 9 +++------
>   1 file changed, 3 insertions(+), 6 deletions(-)
>
>  diff --git a/Makefile.pre.in b/Makefile.pre.in
> -index 2d2e11f..cc19942 100644
> +index 77f91e7..5259754 100644
>  --- a/Makefile.pre.in
>  +++ b/Makefile.pre.in
> -@@ -1431,12 +1431,9 @@ python-config: $(srcdir)/Misc/python-config.in
> Misc/python-config.sh
> +@@ -1568,12 +1568,9 @@ python-config: $(srcdir)/Misc/python-config.in
> Misc/python-config.sh
>         sed -e "s,@EXENAME@,$(BINDIR)/python$(LDVERSION)$(EXE)," <
> $(srcdir)/Misc/python-config.in >python-config.py
>         @ # Replace makefile compat. variable references with shell script
> compat. ones; $(VAR) -> ${VAR}
>         LC_ALL=C sed -e 's,\$$(\([A-Za-z0-9_]*\)),\$$\{\1\},g' <
> Misc/python-config.sh >python-config
> diff --git
> a/meta/recipes-devtools/python/python3/0001-Don-t-search-system-for-headers-libraries.patch
> b/meta/recipes-devtools/python/python3/0001-Don-t-search-system-for-headers-libraries.patch
> index 3e471b9a49..95b4969c09 100644
> ---
> a/meta/recipes-devtools/python/python3/0001-Don-t-search-system-for-headers-libraries.patch
> +++
> b/meta/recipes-devtools/python/python3/0001-Don-t-search-system-for-headers-libraries.patch
> @@ -1,4 +1,4 @@
> -From b880e78bf4a1852e260188e6df3ec6034403d2fc Mon Sep 17 00:00:00 2001
> +From 9325b9705046d5ad4ade0482f0020a0ae5c56eaf Mon Sep 17 00:00:00 2001
>  From: Jeremy Puhlman <jpuhlman@mvista.com>
>  Date: Wed, 4 Mar 2020 00:06:42 +0000
>  Subject: [PATCH] Don't search system for headers/libraries
> @@ -11,10 +11,10 @@ Signed-off-by: Jeremy Puhlman <jpuhlman@mvista.com>
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
>  diff --git a/setup.py b/setup.py
> -index 7208cd0..c0bd0ad 100644
> +index a456e53..af194ee 100644
>  --- a/setup.py
>  +++ b/setup.py
> -@@ -674,8 +674,8 @@ class PyBuildExt(build_ext):
> +@@ -770,8 +770,8 @@ class PyBuildExt(build_ext):
>               add_dir_to_list(self.compiler.include_dirs,
>                               sysconfig.get_config_var("INCLUDEDIR"))
>
> diff --git
> a/meta/recipes-devtools/python/python3/0001-Lib-sysconfig.py-fix-another-place-where-lib-is-hard.patch
> b/meta/recipes-devtools/python/python3/0001-Lib-sysconfig.py-fix-another-place-where-lib-is-hard.patch
> index b97583682a..7aaa346c5d 100644
> ---
> a/meta/recipes-devtools/python/python3/0001-Lib-sysconfig.py-fix-another-place-where-lib-is-hard.patch
> +++
> b/meta/recipes-devtools/python/python3/0001-Lib-sysconfig.py-fix-another-place-where-lib-is-hard.patch
> @@ -6,22 +6,26 @@ Subject: [PATCH] Lib/sysconfig.py: fix another place
> where 'lib' is hardcoded
>
>  Upstream-Status: Inappropriate [oe-core specific]
>  Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
> +
> +Rebased for 3.9 [10/2020]
> +Signed-off-by: Alejandro Enedino Hernandez Samaniego <
> alejandro.hernandez@linux.microsoft.com>
> +
>  ---
>   Lib/sysconfig.py | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
>
> -diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py
> -index d15cec8..87fa5e6 100644
> ---- a/Lib/sysconfig.py
> -+++ b/Lib/sysconfig.py
> +Index: Python-3.9.0/Lib/sysconfig.py
> +===================================================================
> +--- Python-3.9.0.orig/Lib/sysconfig.py
> ++++ Python-3.9.0/Lib/sysconfig.py
>  @@ -20,10 +20,10 @@ __all__ = [
>
>   _INSTALL_SCHEMES = {
>       'posix_prefix': {
> --        'stdlib': '{installed_base}/lib/python{py_version_short}',
> --        'platstdlib': '{platbase}/lib/python{py_version_short}',
> +-        'stdlib':
> '{installed_base}/{platlibdir}/python{py_version_short}',
> +-        'platstdlib': '{platbase}/{platlibdir}/python{py_version_short}',
>  -        'purelib': '{base}/lib/python{py_version_short}/site-packages',
> --        'platlib':
> '{platbase}/lib/python{py_version_short}/site-packages',
> +-        'platlib':
> '{platbase}/{platlibdir}/python{py_version_short}/site-packages',
>  +        'stdlib': '{LIBDEST}',
>  +        'platstdlib': '{LIBDEST}',
>  +        'purelib': '{LIBDEST}/site-packages',
> diff --git
> a/meta/recipes-devtools/python/python3/0001-Makefile-do-not-compile-.pyc-in-parallel.patch
> b/meta/recipes-devtools/python/python3/0001-Makefile-do-not-compile-.pyc-in-parallel.patch
> index b1bceac512..fee0f45219 100644
> ---
> a/meta/recipes-devtools/python/python3/0001-Makefile-do-not-compile-.pyc-in-parallel.patch
> +++
> b/meta/recipes-devtools/python/python3/0001-Makefile-do-not-compile-.pyc-in-parallel.patch
> @@ -1,4 +1,4 @@
> -From c501e121a872cbcef8ffe626c1de173a125be9f8 Mon Sep 17 00:00:00 2001
> +From 04b5cbff2126339417763f908c89eba076e60c4e Mon Sep 17 00:00:00 2001
>  From: Alexander Kanavin <alex.kanavin@gmail.com>
>  Date: Thu, 16 Jan 2020 12:34:20 +0100
>  Subject: [PATCH] Makefile: do not compile .pyc in parallel
> @@ -11,15 +11,16 @@
> https://github.com/python/cpython/commit/1a2dd82f56bd813aacc570e172cefe55a8a4150
>
>  Upstream-Status: Pending
>  Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
> +
>  ---
>   Makefile.pre.in | 12 ++++++------
>   1 file changed, 6 insertions(+), 6 deletions(-)
>
>  diff --git a/Makefile.pre.in b/Makefile.pre.in
> -index 1241112..5dfdf44 100644
> +index 09763f5..59b95be 100644
>  --- a/Makefile.pre.in
>  +++ b/Makefile.pre.in
> -@@ -1457,30 +1457,30 @@ libinstall:    build_all
> $(srcdir)/Modules/xxmodule.c
> +@@ -1529,30 +1529,30 @@ libinstall:    build_all
> $(srcdir)/Modules/xxmodule.c
>         fi
>         -PYTHONPATH=$(DESTDIR)$(LIBDEST)  $(RUNSHARED) \
>                 $(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py
> \
> diff --git
> a/meta/recipes-devtools/python/python3/0001-Makefile-fix-Issue36464-parallel-build-race-problem.patch
> b/meta/recipes-devtools/python/python3/0001-Makefile-fix-Issue36464-parallel-build-race-problem.patch
> index 237645bc60..bdce71f1c4 100644
> ---
> a/meta/recipes-devtools/python/python3/0001-Makefile-fix-Issue36464-parallel-build-race-problem.patch
> +++
> b/meta/recipes-devtools/python/python3/0001-Makefile-fix-Issue36464-parallel-build-race-problem.patch
> @@ -1,4 +1,4 @@
> -From 840fda32c82550259d02a7a56a78a9c05162b1a1 Mon Sep 17 00:00:00 2001
> +From 8da4539c32ba0eb36aae65a5cbd0a71082764ca9 Mon Sep 17 00:00:00 2001
>  From: Changqing Li <changqing.li@windriver.com>
>  Date: Wed, 8 May 2019 16:10:29 +0800
>  Subject: [PATCH] Makefile: fix Issue36464 (parallel build race problem)
> @@ -12,15 +12,16 @@ exists in the libainstall target.
>  Upstream-Status: Submitted [https://github.com/python/cpython/pull/13186]
>
>  Signed-off-by: Changqing Li <changqing.li@windriver.com>
> +
>  ---
>   Makefile.pre.in | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
>  diff --git a/Makefile.pre.in b/Makefile.pre.in
> -index 15f3687..7e9f173 100644
> +index a87fe82..09763f5 100644
>  --- a/Makefile.pre.in
>  +++ b/Makefile.pre.in
> -@@ -1456,7 +1456,7 @@ LIBPL=           @LIBPL@
> +@@ -1618,7 +1618,7 @@ LIBPL=           @LIBPL@
>   LIBPC=                $(LIBDIR)/pkgconfig
>
>   libainstall:  @DEF_MAKE_RULE@ python-config
> @@ -29,6 +30,3 @@ index 15f3687..7e9f173 100644
>         do \
>                 if test ! -d $(DESTDIR)$$i; then \
>                         echo "Creating directory $$i"; \
> ---
> -2.7.4
> -
> diff --git
> a/meta/recipes-devtools/python/python3/0001-Makefile.pre-use-qemu-wrapper-when-gathering-profile.patch
> b/meta/recipes-devtools/python/python3/0001-Makefile.pre-use-qemu-wrapper-when-gathering-profile.patch
> index fa7735ff93..5eb356ac6c 100644
> ---
> a/meta/recipes-devtools/python/python3/0001-Makefile.pre-use-qemu-wrapper-when-gathering-profile.patch
> +++
> b/meta/recipes-devtools/python/python3/0001-Makefile.pre-use-qemu-wrapper-when-gathering-profile.patch
> @@ -1,19 +1,20 @@
> -From cf6a9100902484e4d028ee88742dd2487b014a98 Mon Sep 17 00:00:00 2001
> +From f1f29d96b3d270656feb85bcc00ca29c27d8b77f Mon Sep 17 00:00:00 2001
>  From: Alexander Kanavin <alex.kanavin@gmail.com>
>  Date: Wed, 30 Jan 2019 12:41:04 +0100
>  Subject: [PATCH] Makefile.pre: use qemu wrapper when gathering profile
> data
>
>  Upstream-Status: Inappropriate [oe-core specific]
>  Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
> +
>  ---
>   Makefile.pre.in | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
>
>  diff --git a/Makefile.pre.in b/Makefile.pre.in
> -index a3a02a7..d5503dd 100644
> +index 5259754..a87fe82 100644
>  --- a/Makefile.pre.in
>  +++ b/Makefile.pre.in
> -@@ -507,8 +507,7 @@ build_all_generate_profile:
> +@@ -519,8 +519,7 @@ build_all_generate_profile:
>         $(MAKE) @DEF_MAKE_RULE@ CFLAGS_NODIST="$(CFLAGS_NODIST)
> $(PGO_PROF_GEN_FLAG)" LDFLAGS_NODIST="$(LDFLAGS_NODIST)
> $(PGO_PROF_GEN_FLAG)" LIBS="$(LIBS)"
>
>   run_profile_task:
> diff --git
> a/meta/recipes-devtools/python/python3/0001-Use-FLAG_REF-always-for-interned-strings.patch
> b/meta/recipes-devtools/python/python3/0001-Use-FLAG_REF-always-for-interned-strings.patch
> index 957839bf3e..5a49fff696 100644
> ---
> a/meta/recipes-devtools/python/python3/0001-Use-FLAG_REF-always-for-interned-strings.patch
> +++
> b/meta/recipes-devtools/python/python3/0001-Use-FLAG_REF-always-for-interned-strings.patch
> @@ -1,19 +1,20 @@
> -From 6c8ea7c1dacd42f3ba00440231ec0e6b1a38300d Mon Sep 17 00:00:00 2001
> +From 12d895a9a0c03dd872727434921118016176f561 Mon Sep 17 00:00:00 2001
>  From: Inada Naoki <songofacandy@gmail.com>
>  Date: Sat, 14 Jul 2018 00:46:11 +0900
>  Subject: [PATCH] Use FLAG_REF always for interned strings
>
>  Upstream-Status: Submitted [https://github.com/python/cpython/pull/8226]
>  Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
> +
>  ---
>   Python/marshal.c | 9 +++++++--
>   1 file changed, 7 insertions(+), 2 deletions(-)
>
>  diff --git a/Python/marshal.c b/Python/marshal.c
> -index 6d06266c6a..51db2e3b2e 100644
> +index c4538bd..2437160 100644
>  --- a/Python/marshal.c
>  +++ b/Python/marshal.c
> -@@ -275,9 +275,14 @@ w_ref(PyObject *v, char *flag, WFILE *p)
> +@@ -298,9 +298,14 @@ w_ref(PyObject *v, char *flag, WFILE *p)
>       if (p->version < 3 || p->hashtable == NULL)
>           return 0; /* not writing object references */
>
> @@ -28,8 +29,5 @@ index 6d06266c6a..51db2e3b2e 100644
>           return 0;
>  +    }
>
> -     entry = _Py_HASHTABLE_GET_ENTRY(p->hashtable, v);
> +     entry = _Py_hashtable_get_entry(p->hashtable, v);
>       if (entry != NULL) {
> ---
> -2.21.0
> -
> diff --git
> a/meta/recipes-devtools/python/python3/0001-bpo-36852-proper-detection-of-mips-architecture-for-.patch
> b/meta/recipes-devtools/python/python3/0001-bpo-36852-proper-detection-of-mips-architecture-for-.patch
> index c4fae09a5b..e8dc18277a 100644
> ---
> a/meta/recipes-devtools/python/python3/0001-bpo-36852-proper-detection-of-mips-architecture-for-.patch
> +++
> b/meta/recipes-devtools/python/python3/0001-bpo-36852-proper-detection-of-mips-architecture-for-.patch
> @@ -1,4 +1,4 @@
> -From 1ad771d86728ee2ed30e202e9768d8d825f96467 Mon Sep 17 00:00:00 2001
> +From 405703bc48271d7280c0281897d0e6a9752bbccc Mon Sep 17 00:00:00 2001
>  From: Matthias Schoepfer <matthias.schoepfer@ithinx.io>
>  Date: Fri, 31 May 2019 15:34:34 +0200
>  Subject: [PATCH] bpo-36852: proper detection of mips architecture for soft
> @@ -13,16 +13,16 @@ to do this in a more autoconf/autotools manner.
>  Upstream-Status: Submitted [https://github.com/python/cpython/pull/13196]
>  Signed-off-by: Matthias Schoepfer <matthias.schoepfer@ithinx.io>
>
> -%% original patch:
> 0001-bpo-36852-proper-detection-of-mips-architecture-for-.patch
> +
>  ---
>   configure.ac | 175 +++++++--------------------------------------------
>   1 file changed, 21 insertions(+), 154 deletions(-)
>
>  diff --git a/configure.ac b/configure.ac
> -index ede710e..bc81b0b 100644
> +index e491e24..784850b 100644
>  --- a/configure.ac
>  +++ b/configure.ac
> -@@ -710,160 +710,27 @@ fi
> +@@ -722,160 +722,27 @@ fi
>   MULTIARCH=$($CC --print-multiarch 2>/dev/null)
>   AC_SUBST(MULTIARCH)
>
> @@ -204,6 +204,3 @@ index ede710e..bc81b0b 100644
>
>   if test x$PLATFORM_TRIPLET != x && test x$MULTIARCH != x; then
>     if test x$PLATFORM_TRIPLET != x$MULTIARCH; then
> ---
> -2.24.1
> -
> diff --git
> a/meta/recipes-devtools/python/python3/0001-configure.ac-fix-LIBPL.patch
> b/meta/recipes-devtools/python/python3/0001-configure.ac-fix-LIBPL.patch
> deleted file mode 100644
> index 123ce3a2dc..0000000000
> ---
> a/meta/recipes-devtools/python/python3/0001-configure.ac-fix-LIBPL.patch
> +++ /dev/null
> @@ -1,35 +0,0 @@
> -From acce3d441e7eadadd2d3ce38654155dc43f1f607 Mon Sep 17 00:00:00 2001
> -From: Changqing Li <changqing.li@windriver.com>
> -Date: Fri, 7 Feb 2020 09:36:25 +0800
> -Subject: [PATCH] configure.ac: fix LIBPL
> -
> -Use LIBDIR rather than prefix/lib, so that it would work when lib64.
> -
> -Upstream-Status: Inappropriate [oe-core specific]
> -
> -Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
> -Signed-off-by: Li Zhou <li.zhou@windriver.c>
> -Signed-off-by: Changqing Li <changqing.li@windriver.com>
> ----
> - configure.ac | 4 ++--
> - 1 file changed, 2 insertions(+), 2 deletions(-)
> -
> -diff --git a/configure.ac b/configure.ac
> -index ce04258..915f475 100644
> ---- a/configure.ac
> -+++ b/configure.ac
> -@@ -4532,9 +4532,9 @@ fi
> - dnl define LIBPL after ABIFLAGS and LDVERSION is defined.
> - AC_SUBST(PY_ENABLE_SHARED)
> - if test x$PLATFORM_TRIPLET = x; then
> --  LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}"
> -+  LIBPL='$(LIBDIR)'"/python${VERSION}/config-${LDVERSION}"
> - else
> --
> LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}-${PLATFORM_TRIPLET}"
> -+
> LIBPL='$(LIBDIR)'"/python${VERSION}/config-${LDVERSION}-${PLATFORM_TRIPLET}"
> - fi
> - AC_SUBST(LIBPL)
> -
> ---
> -2.7.4
> -
> diff --git
> a/meta/recipes-devtools/python/python3/0001-distutils-sysconfig-append-STAGING_LIBDIR-python-sys.patch
> b/meta/recipes-devtools/python/python3/0001-distutils-sysconfig-append-STAGING_LIBDIR-python-sys.patch
> index 2b68c0acc2..d8a296236f 100644
> ---
> a/meta/recipes-devtools/python/python3/0001-distutils-sysconfig-append-STAGING_LIBDIR-python-sys.patch
> +++
> b/meta/recipes-devtools/python/python3/0001-distutils-sysconfig-append-STAGING_LIBDIR-python-sys.patch
> @@ -1,4 +1,4 @@
> -From bc59d49efff41051034d7fbf5d0c8505e4c3134b Mon Sep 17 00:00:00 2001
> +From 5e3b6807b59ad9dbae0727b75a0e603f474d6451 Mon Sep 17 00:00:00 2001
>  From: Alexander Kanavin <alex.kanavin@gmail.com>
>  Date: Thu, 31 Jan 2019 16:46:30 +0100
>  Subject: [PATCH] distutils/sysconfig: append
> @@ -15,10 +15,10 @@ Signed-off-by: Alexander Kanavin <
> alex.kanavin@gmail.com>
>   2 files changed, 4 insertions(+)
>
>  diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
> -index b51629e..2df348c 100644
> +index 37feae5..4774e12 100644
>  --- a/Lib/distutils/sysconfig.py
>  +++ b/Lib/distutils/sysconfig.py
> -@@ -438,6 +438,8 @@ def _init_posix():
> +@@ -444,6 +444,8 @@ def _init_posix():
>           platform=sys.platform,
>           multiarch=getattr(sys.implementation, '_multiarch', ''),
>       ))
> @@ -28,10 +28,10 @@ index b51629e..2df348c 100644
>       build_time_vars = _temp.build_time_vars
>       global _config_vars
>  diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py
> -index b2d790b..405273c 100644
> +index bf04ac5..010f9ef 100644
>  --- a/Lib/sysconfig.py
>  +++ b/Lib/sysconfig.py
> -@@ -419,6 +419,8 @@ def _init_posix(vars):
> +@@ -417,6 +417,8 @@ def _init_posix(vars):
>       """Initialize the module as appropriate for POSIX systems."""
>       # _sysconfigdata is generated at build time, see
> _generate_posix_vars()
>       name = _get_sysconfigdata_name()
> diff --git
> a/meta/recipes-devtools/python/python3/0001-python3-Do-not-hardcode-lib-for-distutils.patch
> b/meta/recipes-devtools/python/python3/0001-python3-Do-not-hardcode-lib-for-distutils.patch
> deleted file mode 100644
> index fe031b9983..0000000000
> ---
> a/meta/recipes-devtools/python/python3/0001-python3-Do-not-hardcode-lib-for-distutils.patch
> +++ /dev/null
> @@ -1,43 +0,0 @@
> -From bb711b53f10d32a90a27ccf4b0dc51e4a701d862 Mon Sep 17 00:00:00 2001
> -From: Changqing Li <changqing.li@windriver.com>
> -Date: Fri, 7 Feb 2020 09:42:09 +0800
> -Subject: [PATCH] python3: Do not hardcode "lib" for distutils
> -
> -Get the sys.lib from python3 itself and do not use
> -hardcoded value of 'lib' for distutils.
> -
> -Upstream-Status: Inappropriate [oe-core specific]
> -
> -Signed-off-by: Li Zhou <li.zhou@windriver.com>
> -Signed-off-by: Changqing Li <changqing.li@windriver.com>
> ----
> - Lib/distutils/command/install.py | 6 ++++--
> - 1 file changed, 4 insertions(+), 2 deletions(-)
> -
> -diff --git a/Lib/distutils/command/install.py
> b/Lib/distutils/command/install.py
> -index c625c95..8e32f54 100644
> ---- a/Lib/distutils/command/install.py
> -+++ b/Lib/distutils/command/install.py
> -@@ -19,6 +19,8 @@ from site import USER_BASE
> - from site import USER_SITE
> - HAS_USER_SITE = True
> -
> -+libname = sys.lib
> -+
> - WINDOWS_SCHEME = {
> -     'purelib': '$base/Lib/site-packages',
> -     'platlib': '$base/Lib/site-packages',
> -@@ -29,8 +31,8 @@ WINDOWS_SCHEME = {
> -
> - INSTALL_SCHEMES = {
> -     'unix_prefix': {
> --        'purelib': '$base/lib/python$py_version_short/site-packages',
> --        'platlib': '$platbase/lib/python$py_version_short/site-packages',
> -+        'purelib': '$base/' + libname +
> '/python$py_version_short/site-packages',
> -+        'platlib': '$platbase/' + libname +
> '/python$py_version_short/site-packages',
> -         'headers':
> '$base/include/python$py_version_short$abiflags/$dist_name',
> -         'scripts': '$base/bin',
> -         'data'   : '$base',
> ---
> -2.7.4
> -
> diff --git
> a/meta/recipes-devtools/python/python3/0001-python3-use-cc_basename-to-replace-CC-for-checking-c.patch
> b/meta/recipes-devtools/python/python3/0001-python3-use-cc_basename-to-replace-CC-for-checking-c.patch
> index fb10ca94b3..4c182d2f9e 100644
> ---
> a/meta/recipes-devtools/python/python3/0001-python3-use-cc_basename-to-replace-CC-for-checking-c.patch
> +++
> b/meta/recipes-devtools/python/python3/0001-python3-use-cc_basename-to-replace-CC-for-checking-c.patch
> @@ -1,4 +1,4 @@
> -From 994783da5c21cab81b6589ed2d4275e665a946f9 Mon Sep 17 00:00:00 2001
> +From a1a529f61464a222ed0391e422a5824601178fc5 Mon Sep 17 00:00:00 2001
>  From: Changqing Li <changqing.li@windriver.com>
>  Date: Mon, 22 Oct 2018 15:19:51 +0800
>  Subject: [PATCH] python3: use cc_basename to replace CC for checking
> compiler
> @@ -27,7 +27,7 @@ Signed-off-by: Changqing Li <changqing.li@windriver.com>
>   1 file changed, 10 insertions(+), 9 deletions(-)
>
>  diff --git a/configure.ac b/configure.ac
> -index a189d42..0f85486 100644
> +index d60f052..e491e24 100644
>  --- a/configure.ac
>  +++ b/configure.ac
>  @@ -54,6 +54,7 @@ AC_CONFIG_HEADER(pyconfig.h)
> @@ -38,7 +38,7 @@ index a189d42..0f85486 100644
>
>   # pybuilddir.txt will be created by --generate-posix-vars in the Makefile
>   rm -f pybuilddir.txt
> -@@ -671,7 +672,7 @@ AC_MSG_RESULT($with_cxx_main)
> +@@ -689,7 +690,7 @@ AC_MSG_RESULT($with_cxx_main)
>   preset_cxx="$CXX"
>   if test -z "$CXX"
>   then
> @@ -47,7 +47,7 @@ index a189d42..0f85486 100644
>           gcc)    AC_PATH_TOOL(CXX, [g++], [g++], [notfound]) ;;
>           cc)     AC_PATH_TOOL(CXX, [c++], [c++], [notfound]) ;;
>           clang|*/clang)     AC_PATH_TOOL(CXX, [clang++], [clang++],
> [notfound]) ;;
> -@@ -957,7 +958,7 @@ rmdir CaseSensitiveTestDir
> +@@ -975,7 +976,7 @@ rmdir CaseSensitiveTestDir
>
>   case $ac_sys_system in
>   hp*|HP*)
> @@ -56,7 +56,7 @@ index a189d42..0f85486 100644
>       cc|*/cc) CC="$CC -Ae";;
>       esac;;
>   esac
> -@@ -1335,7 +1336,7 @@ else
> +@@ -1366,7 +1367,7 @@ else
>   fi],
>   [AC_MSG_RESULT(no)])
>   if test "$Py_LTO" = 'true' ; then
> @@ -65,7 +65,7 @@ index a189d42..0f85486 100644
>       *clang*)
>         AC_SUBST(LLVM_AR)
>         AC_PATH_TOOL(LLVM_AR, llvm-ar, '', ${llvm_path})
> -@@ -1425,7 +1426,7 @@ then
> +@@ -1456,7 +1457,7 @@ then
>     fi
>   fi
>   LLVM_PROF_ERR=no
> @@ -74,7 +74,7 @@ index a189d42..0f85486 100644
>     *clang*)
>       # Any changes made here should be reflected in the GCC+Darwin case
> below
>       PGO_PROF_GEN_FLAG="-fprofile-instr-generate"
> -@@ -1486,7 +1487,7 @@ esac
> +@@ -1517,7 +1518,7 @@ esac
>   # compiler and platform.  BASECFLAGS tweaks need to be made even if the
>   # user set OPT.
>
> @@ -83,7 +83,7 @@ index a189d42..0f85486 100644
>       *clang*)
>           cc_is_clang=1
>           ;;
> -@@ -1622,7 +1623,7 @@ yes)
> +@@ -1653,7 +1654,7 @@ yes)
>
>       # ICC doesn't recognize the option, but only emits a warning
>       ## XXX does it emit an unused result warning and can it be disabled?
> @@ -92,16 +92,16 @@ index a189d42..0f85486 100644
>       *icc*)
>       ac_cv_disable_unused_result_warning=no
>       ;;
> -@@ -1943,7 +1944,7 @@ yes)
> +@@ -1993,7 +1994,7 @@ yes)
> +     ;;
>   esac
>
> - # ICC needs -fp-model strict or floats behave badly
>  -case "$CC" in
>  +case "$cc_basename" in
>   *icc*)
> +     # ICC needs -fp-model strict or floats behave badly
>       CFLAGS_NODIST="$CFLAGS_NODIST -fp-model strict"
> -     ;;
> -@@ -2711,7 +2712,7 @@ then
> +@@ -2765,7 +2766,7 @@ then
>                 then
>                         LINKFORSHARED="-Wl,--export-dynamic"
>                 fi;;
> @@ -110,7 +110,7 @@ index a189d42..0f85486 100644
>                   *gcc*)
>                     if $CC -Xlinker --help 2>&1 | grep export-dynamic
> >/dev/null
>                     then
> -@@ -5362,7 +5363,7 @@ if test "$have_gcc_asm_for_x87" = yes; then
> +@@ -5507,7 +5508,7 @@ if test "$have_gcc_asm_for_x87" = yes; then
>       # Some versions of gcc miscompile inline asm:
>       # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46491
>       # http://gcc.gnu.org/ml/gcc/2010-11/msg00366.html
> diff --git
> a/meta/recipes-devtools/python/python3/0001-setup.py-pass-missing-libraries-to-Extension-for-mul.patch
> b/meta/recipes-devtools/python/python3/0001-setup.py-pass-missing-libraries-to-Extension-for-mul.patch
> index ea0af02e72..7ca6753172 100644
> ---
> a/meta/recipes-devtools/python/python3/0001-setup.py-pass-missing-libraries-to-Extension-for-mul.patch
> +++
> b/meta/recipes-devtools/python/python3/0001-setup.py-pass-missing-libraries-to-Extension-for-mul.patch
> @@ -1,4 +1,4 @@
> -From 7019ba184b828ed7253750cf409fc5760ef90a54 Mon Sep 17 00:00:00 2001
> +From 1bf39bd881a73fd0b9564b46c9e5a126f8483b3d Mon Sep 17 00:00:00 2001
>  From: Alexander Kanavin <alex.kanavin@gmail.com>
>  Date: Thu, 9 Jan 2020 17:44:05 +0100
>  Subject: [PATCH] setup.py: pass missing libraries to Extension for
> @@ -50,15 +50,16 @@ Upstream-Status: Pending
>
>  Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
>  Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
> +
>  ---
>   setup.py | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
>  diff --git a/setup.py b/setup.py
> -index ec3f2a4..b0f1541 100644
> +index 8cf058c..9c1c33b 100644
>  --- a/setup.py
>  +++ b/setup.py
> -@@ -1671,7 +1671,7 @@ class PyBuildExt(build_ext):
> +@@ -1777,7 +1777,7 @@ class PyBuildExt(build_ext):
>                                      libraries=libs,
>
>  include_dirs=["Modules/_multiprocessing"]))
>
> diff --git
> a/meta/recipes-devtools/python/python3/0001-test_locale.py-correct-the-test-output-format.patch
> b/meta/recipes-devtools/python/python3/0001-test_locale.py-correct-the-test-output-format.patch
> index 35b7e0c480..bd5f406708 100644
> ---
> a/meta/recipes-devtools/python/python3/0001-test_locale.py-correct-the-test-output-format.patch
> +++
> b/meta/recipes-devtools/python/python3/0001-test_locale.py-correct-the-test-output-format.patch
> @@ -1,4 +1,4 @@
> -From b94995e0c694ec9561efec0d1a59b323340e6105 Mon Sep 17 00:00:00 2001
> +From b2d5ab7c71741bbf27ec4690243244a4de72cfc0 Mon Sep 17 00:00:00 2001
>  From: Mingli Yu <mingli.yu@windriver.com>
>  Date: Mon, 5 Aug 2019 15:57:39 +0800
>  Subject: [PATCH] test_locale.py: correct the test output format
> @@ -24,15 +24,16 @@ Before this patch:
>  Upstream-Status: Submitted [https://github.com/python/cpython/pull/15132]
>
>  Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
> +
>  ---
>   Lib/test/test_locale.py | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
>  diff --git a/Lib/test/test_locale.py b/Lib/test/test_locale.py
> -index e2c2178..558d63c 100644
> +index 2863d20..2ed141c 100644
>  --- a/Lib/test/test_locale.py
>  +++ b/Lib/test/test_locale.py
> -@@ -527,7 +527,7 @@ class TestMiscellaneous(unittest.TestCase):
> +@@ -562,7 +562,7 @@ class TestMiscellaneous(unittest.TestCase):
>               self.skipTest('test needs Turkish locale')
>           loc = locale.getlocale(locale.LC_CTYPE)
>           if verbose:
> @@ -41,6 +42,3 @@ index e2c2178..558d63c 100644
>           locale.setlocale(locale.LC_CTYPE, loc)
>           self.assertEqual(loc, locale.getlocale(locale.LC_CTYPE))
>
> ---
> -2.7.4
> -
> diff --git
> a/meta/recipes-devtools/python/python3/0017-setup.py-do-not-report-missing-dependencies-for-disa.patch
> b/meta/recipes-devtools/python/python3/0017-setup.py-do-not-report-missing-dependencies-for-disa.patch
> index 4bd98f62fd..d0ff3219a6 100644
> ---
> a/meta/recipes-devtools/python/python3/0017-setup.py-do-not-report-missing-dependencies-for-disa.patch
> +++
> b/meta/recipes-devtools/python/python3/0017-setup.py-do-not-report-missing-dependencies-for-disa.patch
> @@ -1,4 +1,4 @@
> -From a2dd127b4163aff6cc35af0d0251321964232ad4 Mon Sep 17 00:00:00 2001
> +From 5d85a94fd0965aa26adf593b5f84948e9c502121 Mon Sep 17 00:00:00 2001
>  From: Alexander Kanavin <alex.kanavin@gmail.com>
>  Date: Mon, 7 Oct 2019 13:22:14 +0200
>  Subject: [PATCH] setup.py: do not report missing dependencies for disabled
> @@ -11,20 +11,24 @@ build completeness checker which relies on the report.
>  Upstream-Status: Inappropriate [oe-core specific]
>  Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
>
> +Rebased for 3.9 [10/2020]
> +Signed-off-by: Alejandro Enedino Hernandez Samaniego <
> alejandro.hernandez@linux.microsoft.com>
> +
>  ---
> - setup.py | 4 ++++
> - 1 file changed, 4 insertions(+)
> + setup.py | 5 +++++
> + 1 file changed, 5 insertions(+)
>
>  diff --git a/setup.py b/setup.py
> -index 7691258..ec3f2a4 100644
> +index ab9fb8e..8cf058c 100644
>  --- a/setup.py
>  +++ b/setup.py
> -@@ -408,6 +408,10 @@ class PyBuildExt(build_ext):
> +@@ -495,6 +495,11 @@ class PyBuildExt(build_ext):
>                   print("%-*s   %-*s   %-*s" % (longest, e, longest, f,
>                                                 longest, g))
>
>  +        # There is no need to report missing module dependencies,
>  +        # if the modules have been disabled in the first place.
> ++        sysconf_dis =
> sysconfig.get_config_var('MODDISABLED_NAMES').split()
>  +        self.missing = list(set(self.missing) - set(sysconf_dis))
>  +
>           if self.missing:
> diff --git
> a/meta/recipes-devtools/python/python3/0020-configure.ac-setup.py-do-not-add-a-curses-include-pa.patch
> b/meta/recipes-devtools/python/python3/0020-configure.ac-setup.py-do-not-add-a-curses-include-pa.patch
> index e04a91605c..daa133e1e0 100644
> ---
> a/meta/recipes-devtools/python/python3/0020-configure.ac-setup.py-do-not-add-a-curses-include-pa.patch
> +++
> b/meta/recipes-devtools/python/python3/0020-configure.ac-setup.py-do-not-add-a-curses-include-pa.patch
> @@ -1,4 +1,4 @@
> -From 863c09f640a5dfd33ff22915b0d5fee7bc5df70a Mon Sep 17 00:00:00 2001
> +From 5e75ab6ff0e5714684d71a3e75d389cdc1c2e783 Mon Sep 17 00:00:00 2001
>  From: Alexander Kanavin <alex.kanavin@gmail.com>
>  Date: Sun, 16 Feb 2020 17:50:25 +0100
>  Subject: [PATCH] configure.ac, setup.py: do not add a curses include
> path from
> @@ -11,16 +11,17 @@ as dnf failures).
>
>  Upstream-Status: Inappropriate [oe-core specific]
>  Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
> +
>  ---
>   configure.ac | 6 ------
>   setup.py     | 2 --
>   2 files changed, 8 deletions(-)
>
>  diff --git a/configure.ac b/configure.ac
> -index 915f475..c911011 100644
> +index 01ea772..7ee38f6 100644
>  --- a/configure.ac
>  +++ b/configure.ac
> -@@ -4828,12 +4828,6 @@ then
> +@@ -4977,12 +4977,6 @@ then
>     [Define if you have struct stat.st_mtimensec])
>   fi
>
> @@ -34,10 +35,10 @@ index 915f475..c911011 100644
>
>   # On Solaris, term.h requires curses.h
>  diff --git a/setup.py b/setup.py
> -index b0f1541..7208cd0 100644
> +index 9c1c33b..a456e53 100644
>  --- a/setup.py
>  +++ b/setup.py
> -@@ -973,8 +973,6 @@ class PyBuildExt(build_ext):
> +@@ -1075,8 +1075,6 @@ class PyBuildExt(build_ext):
>           panel_library = 'panel'
>           if curses_library == 'ncursesw':
>               curses_defines.append(('HAVE_NCURSESW', '1'))
> diff --git
> a/meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch
> b/meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch
> index 820fb98ed8..bacdfba5ef 100644
> ---
> a/meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch
> +++
> b/meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch
> @@ -1,4 +1,4 @@
> -From 064187668fcbefdd39a8cde372bf651124c3e578 Mon Sep 17 00:00:00 2001
> +From a05f77261dbabea29d05c249bfc2d8632e550b6a Mon Sep 17 00:00:00 2001
>  From: Khem Raj <raj.khem@gmail.com>
>  Date: Tue, 14 May 2013 15:00:26 -0700
>  Subject: [PATCH] python3: Add target and native recipes
> @@ -6,6 +6,7 @@ Subject: [PATCH] python3: Add target and native recipes
>  Upstream-Status: Inappropriate [embedded specific]
>
>  02/2015 Rebased for Python 3.4.2
> +10/2020 Rebased for Python 3.9.0
>
>  # The proper prefix is inside our staging area.
>  # Signed-Off: Michael 'Mickey' Lauer <mickey@vanille-media.de>
> @@ -18,10 +19,10 @@ Upstream-Status: Inappropriate [embedded specific]
>   1 file changed, 11 insertions(+), 3 deletions(-)
>
>  diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
> -index 2df348c..4f8db84 100644
> +index 4774e12..5468239 100644
>  --- a/Lib/distutils/sysconfig.py
>  +++ b/Lib/distutils/sysconfig.py
> -@@ -96,7 +96,9 @@ def get_python_inc(plat_specific=0, prefix=None):
> +@@ -95,7 +95,9 @@ def get_python_inc(plat_specific=0, prefix=None):
>       If 'prefix' is supplied, use it instead of sys.base_prefix or
>       sys.base_exec_prefix -- i.e., ignore 'plat_specific'.
>       """
> @@ -32,7 +33,7 @@ index 2df348c..4f8db84 100644
>           prefix = plat_specific and BASE_EXEC_PREFIX or BASE_PREFIX
>       if os.name == "posix":
>           if python_build:
> -@@ -139,7 +141,13 @@ def get_python_lib(plat_specific=0, standard_lib=0,
> prefix=None):
> +@@ -138,7 +140,13 @@ def get_python_lib(plat_specific=0, standard_lib=0,
> prefix=None):
>       If 'prefix' is supplied, use it instead of sys.base_prefix or
>       sys.base_exec_prefix -- i.e., ignore 'plat_specific'.
>       """
> @@ -47,12 +48,12 @@ index 2df348c..4f8db84 100644
>           if standard_lib:
>               prefix = plat_specific and BASE_EXEC_PREFIX or BASE_PREFIX
>           else:
> -@@ -147,7 +155,7 @@ def get_python_lib(plat_specific=0, standard_lib=0,
> prefix=None):
> -
> -     if os.name == "posix":
> -         libpython = os.path.join(prefix,
> --                                 "lib", "python" + get_python_version())
> -+                                 lib_basename, "python" +
> get_python_version())
> -         if standard_lib:
> -             return libpython
> +@@ -151,7 +159,7 @@ def get_python_lib(plat_specific=0, standard_lib=0,
> prefix=None):
> +             libdir = sys.platlibdir
>           else:
> +             # Pure Python
> +-            libdir = "lib"
> ++            libdir = "lib_basename"
> +         libpython = os.path.join(prefix, libdir,
> +                                  "python" + get_python_version())
> +         if standard_lib:
> diff --git
> a/meta/recipes-devtools/python/python3/avoid_warning_about_tkinter.patch
> b/meta/recipes-devtools/python/python3/avoid_warning_about_tkinter.patch
> index 184540e794..4dfa639669 100644
> ---
> a/meta/recipes-devtools/python/python3/avoid_warning_about_tkinter.patch
> +++
> b/meta/recipes-devtools/python/python3/avoid_warning_about_tkinter.patch
> @@ -1,4 +1,4 @@
> -From ba7202700578d435b07cfdfb7b57e83185752800 Mon Sep 17 00:00:00 2001
> +From f0653707a6a310bd059fe4dc3146052bb38b5d83 Mon Sep 17 00:00:00 2001
>  From: Andrei Gherzan <andrei@gherzan.ro>
>  Date: Mon, 28 Jan 2019 15:57:54 +0000
>  Subject: [PATCH] _tkinter module needs tk module along with tcl. tk is
> not yet
> @@ -15,10 +15,10 @@ Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
>  diff --git a/setup.py b/setup.py
> -index ab18ff0..7691258 100644
> +index d3ccc6c..ab9fb8e 100644
>  --- a/setup.py
>  +++ b/setup.py
> -@@ -1706,8 +1706,8 @@ class PyBuildExt(build_ext):
> +@@ -1811,8 +1811,8 @@ class PyBuildExt(build_ext):
>           self.detect_decimal()
>           self.detect_ctypes()
>           self.detect_multiprocessing()
> diff --git a/meta/recipes-devtools/python/python3/cgi_py.patch
> b/meta/recipes-devtools/python/python3/cgi_py.patch
> index 6c4ba54320..493fdf0ab8 100644
> --- a/meta/recipes-devtools/python/python3/cgi_py.patch
> +++ b/meta/recipes-devtools/python/python3/cgi_py.patch
> @@ -1,4 +1,4 @@
> -From 62336285cba38017b35cb761c03f0c7e80a671a3 Mon Sep 17 00:00:00 2001
> +From 5da956e20d53cfdb687b8b8c3c15cfe926961ada Mon Sep 17 00:00:00 2001
>  From: Mark Hatle <mark.hatle@windriver.com>
>  Date: Wed, 21 Sep 2011 20:55:33 -0500
>  Subject: [PATCH] Lib/cgi.py: Update the script as mentioned in the comment
> @@ -12,7 +12,7 @@ Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
>   1 file changed, 1 insertion(+), 10 deletions(-)
>
>  diff --git a/Lib/cgi.py b/Lib/cgi.py
> -index 8cf6687..094c7b4 100755
> +index 77ab703..3edaf60 100755
>  --- a/Lib/cgi.py
>  +++ b/Lib/cgi.py
>  @@ -1,13 +1,4 @@
> diff --git a/meta/recipes-devtools/python/python3/crosspythonpath.patch
> b/meta/recipes-devtools/python/python3/crosspythonpath.patch
> index d789ab57d4..f4c3b93782 100644
> --- a/meta/recipes-devtools/python/python3/crosspythonpath.patch
> +++ b/meta/recipes-devtools/python/python3/crosspythonpath.patch
> @@ -1,4 +1,8 @@
> -configure.ac: add CROSSPYTHONPATH into PYTHONPATH for PYTHON_FOR_BUILD
> +From 9dabb16c327211b8fb9327d06d66c7ef6baea4b2 Mon Sep 17 00:00:00 2001
> +From: Ricardo Ribalda <ricardo@ribalda.com>
> +Date: Tue, 18 Nov 2014 03:35:33 -0500
> +Subject: [PATCH] configure.ac: add CROSSPYTHONPATH into PYTHONPATH for
> + PYTHON_FOR_BUILD
>
>  When building x86->x86 the system will try to execute .so and related
> items
>  from the default PYTHONPATH.  This will fail if the target CPU contains
> @@ -10,8 +14,13 @@ Upstream-Status: Inappropriate [OE-Core integration
> specific]
>  Credits-to: Mark Hatle <mark.hatle@windriver.com>
>  Credits-to: Jackie Huang <jackie.huang@windriver.com>
>  Signed-off-by: Ricardo Ribalda <ricardo@ribalda.com>
> +
> +---
> + configure.ac | 2 +-
> + 1 file changed, 1 insertion(+), 1 deletion(-)
> +
>  diff --git a/configure.ac b/configure.ac
> -index 4ab19a6..7036a53 100644
> +index 784850b..01ea772 100644
>  --- a/configure.ac
>  +++ b/configure.ac
>  @@ -76,7 +76,7 @@ if test "$cross_compiling" = yes; then
> diff --git a/meta/recipes-devtools/python/python3/python-config.patch
> b/meta/recipes-devtools/python/python3/python-config.patch
> index c8a8f3d4aa..98b28bcbde 100644
> --- a/meta/recipes-devtools/python/python3/python-config.patch
> +++ b/meta/recipes-devtools/python/python3/python-config.patch
> @@ -1,4 +1,4 @@
> -From 07df0ae0d70cba6d1847fe1c24a71063930bec60 Mon Sep 17 00:00:00 2001
> +From bf238a78ec90671789c6498bede99928cb7244e5 Mon Sep 17 00:00:00 2001
>  From: Tyler Hall <tylerwhall@gmail.com>
>  Date: Sun, 4 May 2014 20:06:43 -0400
>  Subject: [PATCH] python-config: Revert to using distutils.sysconfig
> @@ -21,7 +21,7 @@ Signed-off-by: Tyler Hall <tylerwhall@gmail.com>
>   1 file changed, 5 insertions(+), 5 deletions(-)
>
>  diff --git a/Misc/python-config.in b/Misc/python-config.in
> -index 727c4a8..c702829 100644
> +index ebd99da..13e57ae 100644
>  --- a/Misc/python-config.in
>  +++ b/Misc/python-config.in
>  @@ -6,7 +6,7 @@
> @@ -37,11 +37,11 @@ index 727c4a8..c702829 100644
>
>   for opt in opt_flags:
>       if opt == '--prefix':
> --        print(sysconfig.get_config_var('prefix'))
> +-        print(getvar('prefix'))
>  +        print(sysconfig.PREFIX)
>
>       elif opt == '--exec-prefix':
> --        print(sysconfig.get_config_var('exec_prefix'))
> +-        print(getvar('exec_prefix'))
>  +        print(sysconfig.EXEC_PREFIX)
>
>       elif opt in ('--includes', '--cflags'):
> diff --git a/meta/recipes-devtools/python/python3_3.8.5.bb
> b/meta/recipes-devtools/python/python3_3.9.0.bb
> similarity index 95%
> rename from meta/recipes-devtools/python/python3_3.8.5.bb
> rename to meta/recipes-devtools/python/python3_3.9.0.bb
> index 2a3c52a116..bd1d40edce 100644
> --- a/meta/recipes-devtools/python/python3_3.8.5.bb
> +++ b/meta/recipes-devtools/python/python3_3.9.0.bb
> @@ -1,9 +1,9 @@
>  SUMMARY = "The Python Programming Language"
>  HOMEPAGE = "http://www.python.org"
> -LICENSE = "PSFv2"
> +LICENSE = "PSFv2 & BSD-0-Clause"
>  SECTION = "devel/python"
>
> -LIC_FILES_CHKSUM = "file://LICENSE;md5=203a6dbc802ee896020a47161e759642"
> +LIC_FILES_CHKSUM = "file://LICENSE;md5=33223c9ef60c31e3f0e866cb09b65e83"
>
>  SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz \
>             file://run-ptest \
> @@ -17,7 +17,6 @@ SRC_URI = "
> http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz \
>
> file://0001-Do-not-use-the-shell-version-of-python-config-that-w.patch \
>             file://python-config.patch \
>
> file://0001-Makefile.pre-use-qemu-wrapper-when-gathering-profile.patch \
> -
>  file://0001-Do-not-hardcode-lib-as-location-for-site-packages-an.patch \
>
> file://0001-python3-use-cc_basename-to-replace-CC-for-checking-c.patch \
>
> file://0001-Lib-sysconfig.py-fix-another-place-where-lib-is-hard.patch \
>
> file://0001-Makefile-fix-Issue36464-parallel-build-race-problem.patch \
> @@ -29,19 +28,17 @@ SRC_URI = "
> http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz \
>
> file://0017-setup.py-do-not-report-missing-dependencies-for-disa.patch \
>
> file://0001-setup.py-pass-missing-libraries-to-Extension-for-mul.patch \
>             file://0001-Makefile-do-not-compile-.pyc-in-parallel.patch \
> -           file://0001-configure.ac-fix-LIBPL.patch \
> -           file://0001-python3-Do-not-hardcode-lib-for-distutils.patch \
>
> file://0020-configure.ac-setup.py-do-not-add-a-curses-include-pa.patch \
>             "
>
> +
>  SRC_URI_append_class-native = " \
>
> file://0001-distutils-sysconfig-append-STAGING_LIBDIR-python-sys.patch \
>             file://12-distutils-prefix-is-inside-staging-area.patch \
>             file://0001-Don-t-search-system-for-headers-libraries.patch \
>             "
>
> -SRC_URI[md5sum] = "35b5a3d0254c1c59be9736373d429db7"
> -SRC_URI[sha256sum] =
> "e3003ed57db17e617acb382b0cade29a248c6026b1bd8aad1f976e9af66a83b0"
> +SRC_URI[sha256sum] =
> "9c73e63c99855709b9be0b3cc9e5b072cb60f37311e8c4e50f15576a0bf82854"
>
>  # exclude pre-releases for both python 2.x and 3.x
>  UPSTREAM_CHECK_REGEX = "[Pp]ython-(?P<pver>\d+(\.\d+)+).tar"
> @@ -52,7 +49,7 @@ CVE_PRODUCT = "python"
>  # This is not exploitable when glibc has CVE-2016-10739 fixed.
>  CVE_CHECK_WHITELIST += "CVE-2019-18348"
>
> -PYTHON_MAJMIN = "3.8"
> +PYTHON_MAJMIN = "3.9"
>
>  S = "${WORKDIR}/Python-${PV}"
>
> @@ -71,7 +68,7 @@ DEPENDS = "bzip2-replacement-native libffi bzip2 openssl
> sqlite3 zlib virtual/li
>  DEPENDS_append_class-target = " python3-native"
>  DEPENDS_append_class-nativesdk = " python3-native"
>
> -EXTRA_OECONF = " --without-ensurepip --enable-shared"
> +EXTRA_OECONF = " --without-ensurepip --enable-shared
> --with-platlibdir=${baselib}"
>  EXTRA_OECONF_append_class-native = " --bindir=${bindir}/${PN}"
>
>  export
> CROSSPYTHONPATH="${STAGING_LIBDIR_NATIVE}/python${PYTHON_MAJMIN}/lib-dynload/"
> @@ -115,7 +112,6 @@ CPPFLAGS_append = " -I${STAGING_INCDIR}/ncursesw
> -I${STAGING_INCDIR}/uuid"
>  EXTRA_OEMAKE = '\
>    STAGING_LIBDIR=${STAGING_LIBDIR} \
>    STAGING_INCDIR=${STAGING_INCDIR} \
> -  LIB=${baselib} \
>  '
>
>  do_compile_prepend_class-target() {
> @@ -179,7 +175,6 @@ py_package_preprocess () {
>                  -e 's:${RECIPE_SYSROOT_NATIVE}::g' \
>                  -e 's:${RECIPE_SYSROOT}::g' \
>                  -e 's:${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}::g' \
> -
> ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config-${PYTHON_MAJMIN}${PYTHON_ABI}*/Makefile
> \
>
>  ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata*.py \
>                  ${PKGD}/${bindir}/python${PYTHON_MAJMIN}-config
>
> --
> 2.25.1
>
>
> 
>
>

[-- Attachment #2: Type: text/html, Size: 73939 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [OE-core] [PATCH 2/2] python3: upgrade to python 3.9.0
  2020-10-24 21:35   ` [OE-core] " Alexander Kanavin
@ 2020-10-24 21:59     ` Alejandro Hernandez Samaniego
  2020-10-25  7:05       ` Alexander Kanavin
  2021-03-20  9:57     ` Martin Jansa
  1 sibling, 1 reply; 6+ messages in thread
From: Alejandro Hernandez Samaniego @ 2020-10-24 21:59 UTC (permalink / raw)
  To: Alexander Kanavin; +Cc: OE-core, Alejandro Enedino Hernandez Samaniego

[-- Attachment #1: Type: text/plain, Size: 59483 bytes --]

Oops, sorry about that, and here I was thinking I was gonna help you out
with the upgrades so you didn't waste time on this one

On Sat, 24 Oct 2020 at 21:35, Alexander Kanavin <alex.kanavin@gmail.com>
wrote:

> Haha, you beat me to it by a few minutes :)
>
> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/commit/?h=akanavin/package-version-updates&id=98049b60602b4bd3854e870e46705716e469277c
>
> I have some additional fixes included though, coming from autobuilder runs.
>
> Alex
>
>
>
>
> On Sat, 24 Oct 2020 at 23:22, Alejandro Hernandez Samaniego <
> alejandro@enedino.org> wrote:
>
>> AFAIC the upstream fix to use --with-platlibdir can now replace the
>> functinoality we put in place for multilib builds, this patch uses
>> such config as well as removes some of the patches for that.
>>
>> - Fixes fuzz on patches
>> - Rebased the rest to work on 3.9.0
>> - License changedm, it now includes BSD Clause 0
>>
>> Signed-off-by: Alejandro Enedino Hernandez Samaniego <
>> alejandro.hernandez@linux.microsoft.com>
>> ---
>>  meta/classes/python3-dir.bbclass              |   2 +-
>>  ...ib-termcap-to-linker-flags-to-avoid-.patch |   6 +-
>>  ...lib-as-location-for-site-packages-an.patch | 214 ------------------
>>  ...hell-version-of-python-config-that-w.patch |   7 +-
>>  ...-search-system-for-headers-libraries.patch |   6 +-
>>  ...-fix-another-place-where-lib-is-hard.patch |  18 +-
>>  ...file-do-not-compile-.pyc-in-parallel.patch |   7 +-
>>  ...sue36464-parallel-build-race-problem.patch |  10 +-
>>  ...-qemu-wrapper-when-gathering-profile.patch |   7 +-
>>  ...FLAG_REF-always-for-interned-strings.patch |  12 +-
>>  ...-detection-of-mips-architecture-for-.patch |  11 +-
>>  .../python3/0001-configure.ac-fix-LIBPL.patch |  35 ---
>>  ...fig-append-STAGING_LIBDIR-python-sys.patch |  10 +-
>>  ...n3-Do-not-hardcode-lib-for-distutils.patch |  43 ----
>>  ...asename-to-replace-CC-for-checking-c.patch |  26 +--
>>  ...ssing-libraries-to-Extension-for-mul.patch |   7 +-
>>  ...le.py-correct-the-test-output-format.patch |  10 +-
>>  ...report-missing-dependencies-for-disa.patch |  14 +-
>>  ...up.py-do-not-add-a-curses-include-pa.patch |  11 +-
>>  ...tutils-prefix-is-inside-staging-area.patch |  25 +-
>>  .../python3/avoid_warning_about_tkinter.patch |   6 +-
>>  .../python/python3/cgi_py.patch               |   4 +-
>>  .../python/python3/crosspythonpath.patch      |  13 +-
>>  .../python/python3/python-config.patch        |   8 +-
>>  .../{python3_3.8.5.bb => python3_3.9.0.bb}    |  17 +-
>>  25 files changed, 123 insertions(+), 406 deletions(-)
>>  delete mode 100644
>> meta/recipes-devtools/python/python3/0001-Do-not-hardcode-lib-as-location-for-site-packages-an.patch
>>  delete mode 100644
>> meta/recipes-devtools/python/python3/0001-configure.ac-fix-LIBPL.patch
>>  delete mode 100644
>> meta/recipes-devtools/python/python3/0001-python3-Do-not-hardcode-lib-for-distutils.patch
>>  rename meta/recipes-devtools/python/{python3_3.8.5.bb =>
>> python3_3.9.0.bb} (95%)
>>
>> diff --git a/meta/classes/python3-dir.bbclass
>> b/meta/classes/python3-dir.bbclass
>> index 036d7140d9..f51f971fc5 100644
>> --- a/meta/classes/python3-dir.bbclass
>> +++ b/meta/classes/python3-dir.bbclass
>> @@ -1,4 +1,4 @@
>> -PYTHON_BASEVERSION = "3.8"
>> +PYTHON_BASEVERSION = "3.9"
>>  PYTHON_ABI = ""
>>  PYTHON_DIR = "python${PYTHON_BASEVERSION}"
>>  PYTHON_PN = "python3"
>> diff --git
>> a/meta/recipes-devtools/python/python3/0001-Do-not-add-usr-lib-termcap-to-linker-flags-to-avoid-.patch
>> b/meta/recipes-devtools/python/python3/0001-Do-not-add-usr-lib-termcap-to-linker-flags-to-avoid-.patch
>> index 59592821d7..44354f44d4 100644
>> ---
>> a/meta/recipes-devtools/python/python3/0001-Do-not-add-usr-lib-termcap-to-linker-flags-to-avoid-.patch
>> +++
>> b/meta/recipes-devtools/python/python3/0001-Do-not-add-usr-lib-termcap-to-linker-flags-to-avoid-.patch
>> @@ -1,4 +1,4 @@
>> -From 039c53dd5baddec3359a05be0bff46a3b32bbb84 Mon Sep 17 00:00:00 2001
>> +From 2b122b1e664a91b14a8d8074d342439c1892700a Mon Sep 17 00:00:00 2001
>>  From: Alexander Kanavin <alex.kanavin@gmail.com>
>>  Date: Fri, 25 Jan 2019 19:04:13 +0100
>>  Subject: [PATCH] Do not add /usr/lib/termcap to linker flags to avoid
>> host
>> @@ -12,10 +12,10 @@ Signed-off-by: Alexander Kanavin <
>> alex.kanavin@gmail.com>
>>   1 file changed, 1 deletion(-)
>>
>>  diff --git a/setup.py b/setup.py
>> -index 20d7f35..ab18ff0 100644
>> +index 770866b..d3ccc6c 100644
>>  --- a/setup.py
>>  +++ b/setup.py
>> -@@ -957,7 +957,6 @@ class PyBuildExt(build_ext):
>> +@@ -1058,7 +1058,6 @@ class PyBuildExt(build_ext):
>>                                                        'termcap'):
>>                   readline_libs.append('termcap')
>>               self.add(Extension('readline', ['readline.c'],
>> diff --git
>> a/meta/recipes-devtools/python/python3/0001-Do-not-hardcode-lib-as-location-for-site-packages-an.patch
>> b/meta/recipes-devtools/python/python3/0001-Do-not-hardcode-lib-as-location-for-site-packages-an.patch
>> deleted file mode 100644
>> index 112c979441..0000000000
>> ---
>> a/meta/recipes-devtools/python/python3/0001-Do-not-hardcode-lib-as-location-for-site-packages-an.patch
>> +++ /dev/null
>> @@ -1,214 +0,0 @@
>> -From a078b6ff1492e848ad1055764fb9a414abaf3e12 Mon Sep 17 00:00:00 2001
>> -From: Alexander Kanavin <alex.kanavin@gmail.com>
>> -Date: Tue, 5 Feb 2019 15:52:02 +0100
>> -Subject: [PATCH] Do not hardcode "lib" as location for modules,
>> site-packages
>> - and lib-dynload
>> -
>> -Upstream-Status: Inappropriate [oe-core specific]
>> -Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
>> -
>> ----
>> - Include/pythonrun.h  |  2 ++
>> - Lib/site.py          |  4 ++--
>> - Makefile.pre.in      |  5 +++--
>> - Modules/getpath.c    | 22 ++++++++++++++--------
>> - Python/getplatform.c | 10 ++++++++++
>> - Python/sysmodule.c   |  2 ++
>> - 6 files changed, 33 insertions(+), 12 deletions(-)
>> -
>> -diff --git a/Include/pythonrun.h b/Include/pythonrun.h
>> -index 46091e0..61b2e15 100644
>> ---- a/Include/pythonrun.h
>> -+++ b/Include/pythonrun.h
>> -@@ -7,6 +7,8 @@
>> - extern "C" {
>> - #endif
>> -
>> -+PyAPI_FUNC(const char *) Py_GetLib(void);
>> -+
>> - #ifndef Py_LIMITED_API
>> - PyAPI_FUNC(int) PyRun_SimpleStringFlags(const char *, PyCompilerFlags
>> *);
>> - PyAPI_FUNC(int) PyRun_AnyFileExFlags(
>> -diff --git a/Lib/site.py b/Lib/site.py
>> -index a065ab0..1d720ef 100644
>> ---- a/Lib/site.py
>> -+++ b/Lib/site.py
>> -@@ -335,12 +335,12 @@ def getsitepackages(prefixes=None):
>> -         seen.add(prefix)
>> -
>> -         if os.sep == '/':
>> --            sitepackages.append(os.path.join(prefix, "lib",
>> -+            sitepackages.append(os.path.join(prefix, sys.lib,
>> -                                         "python%d.%d" %
>> sys.version_info[:2],
>> -                                         "site-packages"))
>> -         else:
>> -             sitepackages.append(prefix)
>> --            sitepackages.append(os.path.join(prefix, "lib",
>> "site-packages"))
>> -+            sitepackages.append(os.path.join(prefix, sys.lib,
>> "site-packages"))
>> -     return sitepackages
>> -
>> - def addsitepackages(known_paths, prefixes=None):
>> -diff --git a/Makefile.pre.in b/Makefile.pre.in
>> -index 65665df..be49140 100644
>> ---- a/Makefile.pre.in
>> -+++ b/Makefile.pre.in
>> -@@ -143,7 +143,7 @@ LIBDIR=            @libdir@
>> - MANDIR=               @mandir@
>> - INCLUDEDIR=   @includedir@
>> - CONFINCLUDEDIR=       $(exec_prefix)/include
>> --SCRIPTDIR=    $(prefix)/lib
>> -+SCRIPTDIR=    @libdir@
>> - ABIFLAGS=     @ABIFLAGS@
>> -
>> - # Detailed destination directories
>> -@@ -753,6 +753,7 @@ Modules/getpath.o: $(srcdir)/Modules/getpath.c
>> Makefile
>> -               -DEXEC_PREFIX='"$(exec_prefix)"' \
>> -               -DVERSION='"$(VERSION)"' \
>> -               -DVPATH='"$(VPATH)"' \
>> -+              -DLIB='"$(LIB)"' \
>> -               -o $@ $(srcdir)/Modules/getpath.c
>> -
>> - Programs/python.o: $(srcdir)/Programs/python.c
>> -@@ -868,7 +869,7 @@ regen-symbol: $(srcdir)/Include/graminit.h
>> - Python/compile.o Python/symtable.o Python/ast_unparse.o Python/ast.o
>> Python/future.o Parser/parsetok.o: $(srcdir)/Include/graminit.h
>> $(srcdir)/Include/Python-ast.h
>> -
>> - Python/getplatform.o: $(srcdir)/Python/getplatform.c
>> --              $(CC) -c $(PY_CORE_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o
>> $@ $(srcdir)/Python/getplatform.c
>> -+              $(CC) -c $(PY_CORE_CFLAGS) -DPLATFORM='"$(MACHDEP)"'
>> -DLIB='"$(LIB)"' -o $@ $(srcdir)/Python/getplatform.c
>> -
>> - Python/importdl.o: $(srcdir)/Python/importdl.c
>> -               $(CC) -c $(PY_CORE_CFLAGS) -I$(DLINCLDIR) -o $@
>> $(srcdir)/Python/importdl.c
>> -diff --git a/Modules/getpath.c b/Modules/getpath.c
>> -index b727f66..c003e46 100644
>> ---- a/Modules/getpath.c
>> -+++ b/Modules/getpath.c
>> -@@ -128,6 +128,7 @@ typedef struct {
>> -     wchar_t *exec_prefix;              /* EXEC_PREFIX macro */
>> -
>> -     wchar_t *lib_python;               /* "lib/pythonX.Y" */
>> -+    wchar_t *multilib_python;               /* "lib[suffix]/pythonX.Y"
>> */
>> -
>> -     int prefix_found;         /* found platform independent libraries?
>> */
>> -     int exec_prefix_found;    /* found the platform dependent
>> libraries? */
>> -@@ -386,7 +387,7 @@ search_for_prefix(PyCalculatePath *calculate,
>> _PyPathConfig *pathconfig,
>> -         if (delim) {
>> -             *delim = L'\0';
>> -         }
>> --        status = joinpath(prefix, calculate->lib_python, prefix_len);
>> -+        status = joinpath(prefix, calculate->multilib_python,
>> prefix_len);
>> -         if (_PyStatus_EXCEPTION(status)) {
>> -             return status;
>> -         }
>> -@@ -444,7 +445,7 @@ search_for_prefix(PyCalculatePath *calculate,
>> _PyPathConfig *pathconfig,
>> -     do {
>> -         /* Path: <argv0_path or substring> / <lib_python> / LANDMARK */
>> -         size_t n = wcslen(prefix);
>> --        status = joinpath(prefix, calculate->lib_python, prefix_len);
>> -+        status = joinpath(prefix, calculate->multilib_python,
>> prefix_len);
>> -         if (_PyStatus_EXCEPTION(status)) {
>> -             return status;
>> -         }
>> -@@ -467,7 +468,7 @@ search_for_prefix(PyCalculatePath *calculate,
>> _PyPathConfig *pathconfig,
>> -     if (safe_wcscpy(prefix, calculate->prefix, prefix_len) < 0) {
>> -         return PATHLEN_ERR();
>> -     }
>> --    status = joinpath(prefix, calculate->lib_python, prefix_len);
>> -+    status = joinpath(prefix, calculate->multilib_python, prefix_len);
>> -     if (_PyStatus_EXCEPTION(status)) {
>> -         return status;
>> -     }
>> -@@ -510,7 +511,7 @@ calculate_prefix(PyCalculatePath *calculate,
>> _PyPathConfig *pathconfig,
>> -         if (safe_wcscpy(prefix, calculate->prefix, prefix_len) < 0) {
>> -             return PATHLEN_ERR();
>> -         }
>> --        status = joinpath(prefix, calculate->lib_python, prefix_len);
>> -+        status = joinpath(prefix, calculate->multilib_python,
>> prefix_len);
>> -         if (_PyStatus_EXCEPTION(status)) {
>> -             return status;
>> -         }
>> -@@ -635,7 +636,7 @@ search_for_exec_prefix(PyCalculatePath *calculate,
>> _PyPathConfig *pathconfig,
>> -                 return PATHLEN_ERR();
>> -             }
>> -         }
>> --        status = joinpath(exec_prefix, calculate->lib_python,
>> exec_prefix_len);
>> -+        status = joinpath(exec_prefix, calculate->multilib_python,
>> exec_prefix_len);
>> -         if (_PyStatus_EXCEPTION(status)) {
>> -             return status;
>> -         }
>> -@@ -667,7 +668,7 @@ search_for_exec_prefix(PyCalculatePath *calculate,
>> _PyPathConfig *pathconfig,
>> -     do {
>> -         /* Path: <argv0_path or substring> / <lib_python> /
>> "lib-dynload" */
>> -         size_t n = wcslen(exec_prefix);
>> --        status = joinpath(exec_prefix, calculate->lib_python,
>> exec_prefix_len);
>> -+        status = joinpath(exec_prefix, calculate->multilib_python,
>> exec_prefix_len);
>> -         if (_PyStatus_EXCEPTION(status)) {
>> -             return status;
>> -         }
>> -@@ -689,7 +690,7 @@ search_for_exec_prefix(PyCalculatePath *calculate,
>> _PyPathConfig *pathconfig,
>> -     if (safe_wcscpy(exec_prefix, calculate->exec_prefix,
>> exec_prefix_len) < 0) {
>> -         return PATHLEN_ERR();
>> -     }
>> --    status = joinpath(exec_prefix, calculate->lib_python,
>> exec_prefix_len);
>> -+    status = joinpath(exec_prefix, calculate->multilib_python,
>> exec_prefix_len);
>> -     if (_PyStatus_EXCEPTION(status)) {
>> -         return status;
>> -     }
>> -@@ -928,7 +929,7 @@ calculate_argv0_path(PyCalculatePath *calculate,
>> const wchar_t *program_full_pat
>> -             return PATHLEN_ERR();
>> -         }
>> -         reduce(argv0_path);
>> --        status = joinpath(argv0_path, calculate->lib_python,
>> argv0_path_len);
>> -+        status = joinpath(argv0_path, calculate->multilib_python,
>> argv0_path_len);
>> -         if (_PyStatus_EXCEPTION(status)) {
>> -             PyMem_RawFree(wbuf);
>> -             return status;
>> -@@ -1201,6 +1202,10 @@ calculate_init(PyCalculatePath *calculate, const
>> PyConfig *config)
>> -     if (!calculate->lib_python) {
>> -         return DECODE_LOCALE_ERR("EXEC_PREFIX define", len);
>> -     }
>> -+    calculate->multilib_python = Py_DecodeLocale(LIB "/python" VERSION,
>> &len);
>> -+    if (!calculate->multilib_python) {
>> -+        return DECODE_LOCALE_ERR("EXEC_PREFIX define", len);
>> -+    }
>> -
>> -     calculate->warnings = config->pathconfig_warnings;
>> -     calculate->pythonpath_env = config->pythonpath_env;
>> -@@ -1216,6 +1221,7 @@ calculate_free(PyCalculatePath *calculate)
>> -     PyMem_RawFree(calculate->prefix);
>> -     PyMem_RawFree(calculate->exec_prefix);
>> -     PyMem_RawFree(calculate->lib_python);
>> -+    PyMem_RawFree(calculate->multilib_python);
>> -     PyMem_RawFree(calculate->path_env);
>> - }
>> -
>> -diff --git a/Python/getplatform.c b/Python/getplatform.c
>> -index 81a0f7a..d55396b 100644
>> ---- a/Python/getplatform.c
>> -+++ b/Python/getplatform.c
>> -@@ -10,3 +10,13 @@ Py_GetPlatform(void)
>> - {
>> -     return PLATFORM;
>> - }
>> -+
>> -+#ifndef LIB
>> -+#define LIB "lib"
>> -+#endif
>> -+
>> -+const char *
>> -+Py_GetLib(void)
>> -+{
>> -+      return LIB;
>> -+}
>> -diff --git a/Python/sysmodule.c b/Python/sysmodule.c
>> -index 5b0fb81..0dce754 100644
>> ---- a/Python/sysmodule.c
>> -+++ b/Python/sysmodule.c
>> -@@ -2668,6 +2668,8 @@ _PySys_InitCore(_PyRuntimeState *runtime,
>> PyInterpreterState *interp,
>> -                         PyUnicode_FromString(Py_GetCopyright()));
>> -     SET_SYS_FROM_STRING("platform",
>> -                         PyUnicode_FromString(Py_GetPlatform()));
>> -+    SET_SYS_FROM_STRING("lib",
>> -+                        PyUnicode_FromString(Py_GetLib()));
>> -     SET_SYS_FROM_STRING("maxsize",
>> -                         PyLong_FromSsize_t(PY_SSIZE_T_MAX));
>> -     SET_SYS_FROM_STRING("float_info",
>> diff --git
>> a/meta/recipes-devtools/python/python3/0001-Do-not-use-the-shell-version-of-python-config-that-w.patch
>> b/meta/recipes-devtools/python/python3/0001-Do-not-use-the-shell-version-of-python-config-that-w.patch
>> index 83fd52d87f..7113ce2138 100644
>> ---
>> a/meta/recipes-devtools/python/python3/0001-Do-not-use-the-shell-version-of-python-config-that-w.patch
>> +++
>> b/meta/recipes-devtools/python/python3/0001-Do-not-use-the-shell-version-of-python-config-that-w.patch
>> @@ -1,4 +1,4 @@
>> -From 148861fa16f2aaacd518770f337ea54b5182f981 Mon Sep 17 00:00:00 2001
>> +From 980fcf1a36bcb3ab26d4e82a304e205f02cb376f Mon Sep 17 00:00:00 2001
>>  From: Alexander Kanavin <alex.kanavin@gmail.com>
>>  Date: Tue, 29 Jan 2019 15:03:01 +0100
>>  Subject: [PATCH] Do not use the shell version of python-config that was
>> @@ -9,15 +9,16 @@ outputs directories correctly.
>>
>>  Upstream-Status: Inappropriate [oe-specific]
>>  Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
>> +
>>  ---
>>   Makefile.pre.in | 9 +++------
>>   1 file changed, 3 insertions(+), 6 deletions(-)
>>
>>  diff --git a/Makefile.pre.in b/Makefile.pre.in
>> -index 2d2e11f..cc19942 100644
>> +index 77f91e7..5259754 100644
>>  --- a/Makefile.pre.in
>>  +++ b/Makefile.pre.in
>> -@@ -1431,12 +1431,9 @@ python-config: $(srcdir)/Misc/python-config.in
>> Misc/python-config.sh
>> +@@ -1568,12 +1568,9 @@ python-config: $(srcdir)/Misc/python-config.in
>> Misc/python-config.sh
>>         sed -e "s,@EXENAME@,$(BINDIR)/python$(LDVERSION)$(EXE)," <
>> $(srcdir)/Misc/python-config.in >python-config.py
>>         @ # Replace makefile compat. variable references with shell
>> script compat. ones; $(VAR) -> ${VAR}
>>         LC_ALL=C sed -e 's,\$$(\([A-Za-z0-9_]*\)),\$$\{\1\},g' <
>> Misc/python-config.sh >python-config
>> diff --git
>> a/meta/recipes-devtools/python/python3/0001-Don-t-search-system-for-headers-libraries.patch
>> b/meta/recipes-devtools/python/python3/0001-Don-t-search-system-for-headers-libraries.patch
>> index 3e471b9a49..95b4969c09 100644
>> ---
>> a/meta/recipes-devtools/python/python3/0001-Don-t-search-system-for-headers-libraries.patch
>> +++
>> b/meta/recipes-devtools/python/python3/0001-Don-t-search-system-for-headers-libraries.patch
>> @@ -1,4 +1,4 @@
>> -From b880e78bf4a1852e260188e6df3ec6034403d2fc Mon Sep 17 00:00:00 2001
>> +From 9325b9705046d5ad4ade0482f0020a0ae5c56eaf Mon Sep 17 00:00:00 2001
>>  From: Jeremy Puhlman <jpuhlman@mvista.com>
>>  Date: Wed, 4 Mar 2020 00:06:42 +0000
>>  Subject: [PATCH] Don't search system for headers/libraries
>> @@ -11,10 +11,10 @@ Signed-off-by: Jeremy Puhlman <jpuhlman@mvista.com>
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>>  diff --git a/setup.py b/setup.py
>> -index 7208cd0..c0bd0ad 100644
>> +index a456e53..af194ee 100644
>>  --- a/setup.py
>>  +++ b/setup.py
>> -@@ -674,8 +674,8 @@ class PyBuildExt(build_ext):
>> +@@ -770,8 +770,8 @@ class PyBuildExt(build_ext):
>>               add_dir_to_list(self.compiler.include_dirs,
>>                               sysconfig.get_config_var("INCLUDEDIR"))
>>
>> diff --git
>> a/meta/recipes-devtools/python/python3/0001-Lib-sysconfig.py-fix-another-place-where-lib-is-hard.patch
>> b/meta/recipes-devtools/python/python3/0001-Lib-sysconfig.py-fix-another-place-where-lib-is-hard.patch
>> index b97583682a..7aaa346c5d 100644
>> ---
>> a/meta/recipes-devtools/python/python3/0001-Lib-sysconfig.py-fix-another-place-where-lib-is-hard.patch
>> +++
>> b/meta/recipes-devtools/python/python3/0001-Lib-sysconfig.py-fix-another-place-where-lib-is-hard.patch
>> @@ -6,22 +6,26 @@ Subject: [PATCH] Lib/sysconfig.py: fix another place
>> where 'lib' is hardcoded
>>
>>  Upstream-Status: Inappropriate [oe-core specific]
>>  Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
>> +
>> +Rebased for 3.9 [10/2020]
>> +Signed-off-by: Alejandro Enedino Hernandez Samaniego <
>> alejandro.hernandez@linux.microsoft.com>
>> +
>>  ---
>>   Lib/sysconfig.py | 8 ++++----
>>   1 file changed, 4 insertions(+), 4 deletions(-)
>>
>> -diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py
>> -index d15cec8..87fa5e6 100644
>> ---- a/Lib/sysconfig.py
>> -+++ b/Lib/sysconfig.py
>> +Index: Python-3.9.0/Lib/sysconfig.py
>> +===================================================================
>> +--- Python-3.9.0.orig/Lib/sysconfig.py
>> ++++ Python-3.9.0/Lib/sysconfig.py
>>  @@ -20,10 +20,10 @@ __all__ = [
>>
>>   _INSTALL_SCHEMES = {
>>       'posix_prefix': {
>> --        'stdlib': '{installed_base}/lib/python{py_version_short}',
>> --        'platstdlib': '{platbase}/lib/python{py_version_short}',
>> +-        'stdlib':
>> '{installed_base}/{platlibdir}/python{py_version_short}',
>> +-        'platstdlib':
>> '{platbase}/{platlibdir}/python{py_version_short}',
>>  -        'purelib': '{base}/lib/python{py_version_short}/site-packages',
>> --        'platlib':
>> '{platbase}/lib/python{py_version_short}/site-packages',
>> +-        'platlib':
>> '{platbase}/{platlibdir}/python{py_version_short}/site-packages',
>>  +        'stdlib': '{LIBDEST}',
>>  +        'platstdlib': '{LIBDEST}',
>>  +        'purelib': '{LIBDEST}/site-packages',
>> diff --git
>> a/meta/recipes-devtools/python/python3/0001-Makefile-do-not-compile-.pyc-in-parallel.patch
>> b/meta/recipes-devtools/python/python3/0001-Makefile-do-not-compile-.pyc-in-parallel.patch
>> index b1bceac512..fee0f45219 100644
>> ---
>> a/meta/recipes-devtools/python/python3/0001-Makefile-do-not-compile-.pyc-in-parallel.patch
>> +++
>> b/meta/recipes-devtools/python/python3/0001-Makefile-do-not-compile-.pyc-in-parallel.patch
>> @@ -1,4 +1,4 @@
>> -From c501e121a872cbcef8ffe626c1de173a125be9f8 Mon Sep 17 00:00:00 2001
>> +From 04b5cbff2126339417763f908c89eba076e60c4e Mon Sep 17 00:00:00 2001
>>  From: Alexander Kanavin <alex.kanavin@gmail.com>
>>  Date: Thu, 16 Jan 2020 12:34:20 +0100
>>  Subject: [PATCH] Makefile: do not compile .pyc in parallel
>> @@ -11,15 +11,16 @@
>> https://github.com/python/cpython/commit/1a2dd82f56bd813aacc570e172cefe55a8a4150
>>
>>  Upstream-Status: Pending
>>  Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
>> +
>>  ---
>>   Makefile.pre.in | 12 ++++++------
>>   1 file changed, 6 insertions(+), 6 deletions(-)
>>
>>  diff --git a/Makefile.pre.in b/Makefile.pre.in
>> -index 1241112..5dfdf44 100644
>> +index 09763f5..59b95be 100644
>>  --- a/Makefile.pre.in
>>  +++ b/Makefile.pre.in
>> -@@ -1457,30 +1457,30 @@ libinstall:    build_all
>> $(srcdir)/Modules/xxmodule.c
>> +@@ -1529,30 +1529,30 @@ libinstall:    build_all
>> $(srcdir)/Modules/xxmodule.c
>>         fi
>>         -PYTHONPATH=$(DESTDIR)$(LIBDEST)  $(RUNSHARED) \
>>                 $(PYTHON_FOR_BUILD) -Wi
>> $(DESTDIR)$(LIBDEST)/compileall.py \
>> diff --git
>> a/meta/recipes-devtools/python/python3/0001-Makefile-fix-Issue36464-parallel-build-race-problem.patch
>> b/meta/recipes-devtools/python/python3/0001-Makefile-fix-Issue36464-parallel-build-race-problem.patch
>> index 237645bc60..bdce71f1c4 100644
>> ---
>> a/meta/recipes-devtools/python/python3/0001-Makefile-fix-Issue36464-parallel-build-race-problem.patch
>> +++
>> b/meta/recipes-devtools/python/python3/0001-Makefile-fix-Issue36464-parallel-build-race-problem.patch
>> @@ -1,4 +1,4 @@
>> -From 840fda32c82550259d02a7a56a78a9c05162b1a1 Mon Sep 17 00:00:00 2001
>> +From 8da4539c32ba0eb36aae65a5cbd0a71082764ca9 Mon Sep 17 00:00:00 2001
>>  From: Changqing Li <changqing.li@windriver.com>
>>  Date: Wed, 8 May 2019 16:10:29 +0800
>>  Subject: [PATCH] Makefile: fix Issue36464 (parallel build race problem)
>> @@ -12,15 +12,16 @@ exists in the libainstall target.
>>  Upstream-Status: Submitted [https://github.com/python/cpython/pull/13186
>> ]
>>
>>  Signed-off-by: Changqing Li <changqing.li@windriver.com>
>> +
>>  ---
>>   Makefile.pre.in | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>>  diff --git a/Makefile.pre.in b/Makefile.pre.in
>> -index 15f3687..7e9f173 100644
>> +index a87fe82..09763f5 100644
>>  --- a/Makefile.pre.in
>>  +++ b/Makefile.pre.in
>> -@@ -1456,7 +1456,7 @@ LIBPL=           @LIBPL@
>> +@@ -1618,7 +1618,7 @@ LIBPL=           @LIBPL@
>>   LIBPC=                $(LIBDIR)/pkgconfig
>>
>>   libainstall:  @DEF_MAKE_RULE@ python-config
>> @@ -29,6 +30,3 @@ index 15f3687..7e9f173 100644
>>         do \
>>                 if test ! -d $(DESTDIR)$$i; then \
>>                         echo "Creating directory $$i"; \
>> ---
>> -2.7.4
>> -
>> diff --git
>> a/meta/recipes-devtools/python/python3/0001-Makefile.pre-use-qemu-wrapper-when-gathering-profile.patch
>> b/meta/recipes-devtools/python/python3/0001-Makefile.pre-use-qemu-wrapper-when-gathering-profile.patch
>> index fa7735ff93..5eb356ac6c 100644
>> ---
>> a/meta/recipes-devtools/python/python3/0001-Makefile.pre-use-qemu-wrapper-when-gathering-profile.patch
>> +++
>> b/meta/recipes-devtools/python/python3/0001-Makefile.pre-use-qemu-wrapper-when-gathering-profile.patch
>> @@ -1,19 +1,20 @@
>> -From cf6a9100902484e4d028ee88742dd2487b014a98 Mon Sep 17 00:00:00 2001
>> +From f1f29d96b3d270656feb85bcc00ca29c27d8b77f Mon Sep 17 00:00:00 2001
>>  From: Alexander Kanavin <alex.kanavin@gmail.com>
>>  Date: Wed, 30 Jan 2019 12:41:04 +0100
>>  Subject: [PATCH] Makefile.pre: use qemu wrapper when gathering profile
>> data
>>
>>  Upstream-Status: Inappropriate [oe-core specific]
>>  Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
>> +
>>  ---
>>   Makefile.pre.in | 3 +--
>>   1 file changed, 1 insertion(+), 2 deletions(-)
>>
>>  diff --git a/Makefile.pre.in b/Makefile.pre.in
>> -index a3a02a7..d5503dd 100644
>> +index 5259754..a87fe82 100644
>>  --- a/Makefile.pre.in
>>  +++ b/Makefile.pre.in
>> -@@ -507,8 +507,7 @@ build_all_generate_profile:
>> +@@ -519,8 +519,7 @@ build_all_generate_profile:
>>         $(MAKE) @DEF_MAKE_RULE@ CFLAGS_NODIST="$(CFLAGS_NODIST)
>> $(PGO_PROF_GEN_FLAG)" LDFLAGS_NODIST="$(LDFLAGS_NODIST)
>> $(PGO_PROF_GEN_FLAG)" LIBS="$(LIBS)"
>>
>>   run_profile_task:
>> diff --git
>> a/meta/recipes-devtools/python/python3/0001-Use-FLAG_REF-always-for-interned-strings.patch
>> b/meta/recipes-devtools/python/python3/0001-Use-FLAG_REF-always-for-interned-strings.patch
>> index 957839bf3e..5a49fff696 100644
>> ---
>> a/meta/recipes-devtools/python/python3/0001-Use-FLAG_REF-always-for-interned-strings.patch
>> +++
>> b/meta/recipes-devtools/python/python3/0001-Use-FLAG_REF-always-for-interned-strings.patch
>> @@ -1,19 +1,20 @@
>> -From 6c8ea7c1dacd42f3ba00440231ec0e6b1a38300d Mon Sep 17 00:00:00 2001
>> +From 12d895a9a0c03dd872727434921118016176f561 Mon Sep 17 00:00:00 2001
>>  From: Inada Naoki <songofacandy@gmail.com>
>>  Date: Sat, 14 Jul 2018 00:46:11 +0900
>>  Subject: [PATCH] Use FLAG_REF always for interned strings
>>
>>  Upstream-Status: Submitted [https://github.com/python/cpython/pull/8226]
>>  Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
>> +
>>  ---
>>   Python/marshal.c | 9 +++++++--
>>   1 file changed, 7 insertions(+), 2 deletions(-)
>>
>>  diff --git a/Python/marshal.c b/Python/marshal.c
>> -index 6d06266c6a..51db2e3b2e 100644
>> +index c4538bd..2437160 100644
>>  --- a/Python/marshal.c
>>  +++ b/Python/marshal.c
>> -@@ -275,9 +275,14 @@ w_ref(PyObject *v, char *flag, WFILE *p)
>> +@@ -298,9 +298,14 @@ w_ref(PyObject *v, char *flag, WFILE *p)
>>       if (p->version < 3 || p->hashtable == NULL)
>>           return 0; /* not writing object references */
>>
>> @@ -28,8 +29,5 @@ index 6d06266c6a..51db2e3b2e 100644
>>           return 0;
>>  +    }
>>
>> -     entry = _Py_HASHTABLE_GET_ENTRY(p->hashtable, v);
>> +     entry = _Py_hashtable_get_entry(p->hashtable, v);
>>       if (entry != NULL) {
>> ---
>> -2.21.0
>> -
>> diff --git
>> a/meta/recipes-devtools/python/python3/0001-bpo-36852-proper-detection-of-mips-architecture-for-.patch
>> b/meta/recipes-devtools/python/python3/0001-bpo-36852-proper-detection-of-mips-architecture-for-.patch
>> index c4fae09a5b..e8dc18277a 100644
>> ---
>> a/meta/recipes-devtools/python/python3/0001-bpo-36852-proper-detection-of-mips-architecture-for-.patch
>> +++
>> b/meta/recipes-devtools/python/python3/0001-bpo-36852-proper-detection-of-mips-architecture-for-.patch
>> @@ -1,4 +1,4 @@
>> -From 1ad771d86728ee2ed30e202e9768d8d825f96467 Mon Sep 17 00:00:00 2001
>> +From 405703bc48271d7280c0281897d0e6a9752bbccc Mon Sep 17 00:00:00 2001
>>  From: Matthias Schoepfer <matthias.schoepfer@ithinx.io>
>>  Date: Fri, 31 May 2019 15:34:34 +0200
>>  Subject: [PATCH] bpo-36852: proper detection of mips architecture for
>> soft
>> @@ -13,16 +13,16 @@ to do this in a more autoconf/autotools manner.
>>  Upstream-Status: Submitted [https://github.com/python/cpython/pull/13196
>> ]
>>  Signed-off-by: Matthias Schoepfer <matthias.schoepfer@ithinx.io>
>>
>> -%% original patch:
>> 0001-bpo-36852-proper-detection-of-mips-architecture-for-.patch
>> +
>>  ---
>>   configure.ac | 175 +++++++--------------------------------------------
>>   1 file changed, 21 insertions(+), 154 deletions(-)
>>
>>  diff --git a/configure.ac b/configure.ac
>> -index ede710e..bc81b0b 100644
>> +index e491e24..784850b 100644
>>  --- a/configure.ac
>>  +++ b/configure.ac
>> -@@ -710,160 +710,27 @@ fi
>> +@@ -722,160 +722,27 @@ fi
>>   MULTIARCH=$($CC --print-multiarch 2>/dev/null)
>>   AC_SUBST(MULTIARCH)
>>
>> @@ -204,6 +204,3 @@ index ede710e..bc81b0b 100644
>>
>>   if test x$PLATFORM_TRIPLET != x && test x$MULTIARCH != x; then
>>     if test x$PLATFORM_TRIPLET != x$MULTIARCH; then
>> ---
>> -2.24.1
>> -
>> diff --git
>> a/meta/recipes-devtools/python/python3/0001-configure.ac-fix-LIBPL.patch
>> b/meta/recipes-devtools/python/python3/0001-configure.ac-fix-LIBPL.patch
>> deleted file mode 100644
>> index 123ce3a2dc..0000000000
>> ---
>> a/meta/recipes-devtools/python/python3/0001-configure.ac-fix-LIBPL.patch
>> +++ /dev/null
>> @@ -1,35 +0,0 @@
>> -From acce3d441e7eadadd2d3ce38654155dc43f1f607 Mon Sep 17 00:00:00 2001
>> -From: Changqing Li <changqing.li@windriver.com>
>> -Date: Fri, 7 Feb 2020 09:36:25 +0800
>> -Subject: [PATCH] configure.ac: fix LIBPL
>> -
>> -Use LIBDIR rather than prefix/lib, so that it would work when lib64.
>> -
>> -Upstream-Status: Inappropriate [oe-core specific]
>> -
>> -Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
>> -Signed-off-by: Li Zhou <li.zhou@windriver.c>
>> -Signed-off-by: Changqing Li <changqing.li@windriver.com>
>> ----
>> - configure.ac | 4 ++--
>> - 1 file changed, 2 insertions(+), 2 deletions(-)
>> -
>> -diff --git a/configure.ac b/configure.ac
>> -index ce04258..915f475 100644
>> ---- a/configure.ac
>> -+++ b/configure.ac
>> -@@ -4532,9 +4532,9 @@ fi
>> - dnl define LIBPL after ABIFLAGS and LDVERSION is defined.
>> - AC_SUBST(PY_ENABLE_SHARED)
>> - if test x$PLATFORM_TRIPLET = x; then
>> --  LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}"
>> -+  LIBPL='$(LIBDIR)'"/python${VERSION}/config-${LDVERSION}"
>> - else
>> --
>> LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}-${PLATFORM_TRIPLET}"
>> -+
>> LIBPL='$(LIBDIR)'"/python${VERSION}/config-${LDVERSION}-${PLATFORM_TRIPLET}"
>> - fi
>> - AC_SUBST(LIBPL)
>> -
>> ---
>> -2.7.4
>> -
>> diff --git
>> a/meta/recipes-devtools/python/python3/0001-distutils-sysconfig-append-STAGING_LIBDIR-python-sys.patch
>> b/meta/recipes-devtools/python/python3/0001-distutils-sysconfig-append-STAGING_LIBDIR-python-sys.patch
>> index 2b68c0acc2..d8a296236f 100644
>> ---
>> a/meta/recipes-devtools/python/python3/0001-distutils-sysconfig-append-STAGING_LIBDIR-python-sys.patch
>> +++
>> b/meta/recipes-devtools/python/python3/0001-distutils-sysconfig-append-STAGING_LIBDIR-python-sys.patch
>> @@ -1,4 +1,4 @@
>> -From bc59d49efff41051034d7fbf5d0c8505e4c3134b Mon Sep 17 00:00:00 2001
>> +From 5e3b6807b59ad9dbae0727b75a0e603f474d6451 Mon Sep 17 00:00:00 2001
>>  From: Alexander Kanavin <alex.kanavin@gmail.com>
>>  Date: Thu, 31 Jan 2019 16:46:30 +0100
>>  Subject: [PATCH] distutils/sysconfig: append
>> @@ -15,10 +15,10 @@ Signed-off-by: Alexander Kanavin <
>> alex.kanavin@gmail.com>
>>   2 files changed, 4 insertions(+)
>>
>>  diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
>> -index b51629e..2df348c 100644
>> +index 37feae5..4774e12 100644
>>  --- a/Lib/distutils/sysconfig.py
>>  +++ b/Lib/distutils/sysconfig.py
>> -@@ -438,6 +438,8 @@ def _init_posix():
>> +@@ -444,6 +444,8 @@ def _init_posix():
>>           platform=sys.platform,
>>           multiarch=getattr(sys.implementation, '_multiarch', ''),
>>       ))
>> @@ -28,10 +28,10 @@ index b51629e..2df348c 100644
>>       build_time_vars = _temp.build_time_vars
>>       global _config_vars
>>  diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py
>> -index b2d790b..405273c 100644
>> +index bf04ac5..010f9ef 100644
>>  --- a/Lib/sysconfig.py
>>  +++ b/Lib/sysconfig.py
>> -@@ -419,6 +419,8 @@ def _init_posix(vars):
>> +@@ -417,6 +417,8 @@ def _init_posix(vars):
>>       """Initialize the module as appropriate for POSIX systems."""
>>       # _sysconfigdata is generated at build time, see
>> _generate_posix_vars()
>>       name = _get_sysconfigdata_name()
>> diff --git
>> a/meta/recipes-devtools/python/python3/0001-python3-Do-not-hardcode-lib-for-distutils.patch
>> b/meta/recipes-devtools/python/python3/0001-python3-Do-not-hardcode-lib-for-distutils.patch
>> deleted file mode 100644
>> index fe031b9983..0000000000
>> ---
>> a/meta/recipes-devtools/python/python3/0001-python3-Do-not-hardcode-lib-for-distutils.patch
>> +++ /dev/null
>> @@ -1,43 +0,0 @@
>> -From bb711b53f10d32a90a27ccf4b0dc51e4a701d862 Mon Sep 17 00:00:00 2001
>> -From: Changqing Li <changqing.li@windriver.com>
>> -Date: Fri, 7 Feb 2020 09:42:09 +0800
>> -Subject: [PATCH] python3: Do not hardcode "lib" for distutils
>> -
>> -Get the sys.lib from python3 itself and do not use
>> -hardcoded value of 'lib' for distutils.
>> -
>> -Upstream-Status: Inappropriate [oe-core specific]
>> -
>> -Signed-off-by: Li Zhou <li.zhou@windriver.com>
>> -Signed-off-by: Changqing Li <changqing.li@windriver.com>
>> ----
>> - Lib/distutils/command/install.py | 6 ++++--
>> - 1 file changed, 4 insertions(+), 2 deletions(-)
>> -
>> -diff --git a/Lib/distutils/command/install.py
>> b/Lib/distutils/command/install.py
>> -index c625c95..8e32f54 100644
>> ---- a/Lib/distutils/command/install.py
>> -+++ b/Lib/distutils/command/install.py
>> -@@ -19,6 +19,8 @@ from site import USER_BASE
>> - from site import USER_SITE
>> - HAS_USER_SITE = True
>> -
>> -+libname = sys.lib
>> -+
>> - WINDOWS_SCHEME = {
>> -     'purelib': '$base/Lib/site-packages',
>> -     'platlib': '$base/Lib/site-packages',
>> -@@ -29,8 +31,8 @@ WINDOWS_SCHEME = {
>> -
>> - INSTALL_SCHEMES = {
>> -     'unix_prefix': {
>> --        'purelib': '$base/lib/python$py_version_short/site-packages',
>> --        'platlib':
>> '$platbase/lib/python$py_version_short/site-packages',
>> -+        'purelib': '$base/' + libname +
>> '/python$py_version_short/site-packages',
>> -+        'platlib': '$platbase/' + libname +
>> '/python$py_version_short/site-packages',
>> -         'headers':
>> '$base/include/python$py_version_short$abiflags/$dist_name',
>> -         'scripts': '$base/bin',
>> -         'data'   : '$base',
>> ---
>> -2.7.4
>> -
>> diff --git
>> a/meta/recipes-devtools/python/python3/0001-python3-use-cc_basename-to-replace-CC-for-checking-c.patch
>> b/meta/recipes-devtools/python/python3/0001-python3-use-cc_basename-to-replace-CC-for-checking-c.patch
>> index fb10ca94b3..4c182d2f9e 100644
>> ---
>> a/meta/recipes-devtools/python/python3/0001-python3-use-cc_basename-to-replace-CC-for-checking-c.patch
>> +++
>> b/meta/recipes-devtools/python/python3/0001-python3-use-cc_basename-to-replace-CC-for-checking-c.patch
>> @@ -1,4 +1,4 @@
>> -From 994783da5c21cab81b6589ed2d4275e665a946f9 Mon Sep 17 00:00:00 2001
>> +From a1a529f61464a222ed0391e422a5824601178fc5 Mon Sep 17 00:00:00 2001
>>  From: Changqing Li <changqing.li@windriver.com>
>>  Date: Mon, 22 Oct 2018 15:19:51 +0800
>>  Subject: [PATCH] python3: use cc_basename to replace CC for checking
>> compiler
>> @@ -27,7 +27,7 @@ Signed-off-by: Changqing Li <changqing.li@windriver.com
>> >
>>   1 file changed, 10 insertions(+), 9 deletions(-)
>>
>>  diff --git a/configure.ac b/configure.ac
>> -index a189d42..0f85486 100644
>> +index d60f052..e491e24 100644
>>  --- a/configure.ac
>>  +++ b/configure.ac
>>  @@ -54,6 +54,7 @@ AC_CONFIG_HEADER(pyconfig.h)
>> @@ -38,7 +38,7 @@ index a189d42..0f85486 100644
>>
>>   # pybuilddir.txt will be created by --generate-posix-vars in the
>> Makefile
>>   rm -f pybuilddir.txt
>> -@@ -671,7 +672,7 @@ AC_MSG_RESULT($with_cxx_main)
>> +@@ -689,7 +690,7 @@ AC_MSG_RESULT($with_cxx_main)
>>   preset_cxx="$CXX"
>>   if test -z "$CXX"
>>   then
>> @@ -47,7 +47,7 @@ index a189d42..0f85486 100644
>>           gcc)    AC_PATH_TOOL(CXX, [g++], [g++], [notfound]) ;;
>>           cc)     AC_PATH_TOOL(CXX, [c++], [c++], [notfound]) ;;
>>           clang|*/clang)     AC_PATH_TOOL(CXX, [clang++], [clang++],
>> [notfound]) ;;
>> -@@ -957,7 +958,7 @@ rmdir CaseSensitiveTestDir
>> +@@ -975,7 +976,7 @@ rmdir CaseSensitiveTestDir
>>
>>   case $ac_sys_system in
>>   hp*|HP*)
>> @@ -56,7 +56,7 @@ index a189d42..0f85486 100644
>>       cc|*/cc) CC="$CC -Ae";;
>>       esac;;
>>   esac
>> -@@ -1335,7 +1336,7 @@ else
>> +@@ -1366,7 +1367,7 @@ else
>>   fi],
>>   [AC_MSG_RESULT(no)])
>>   if test "$Py_LTO" = 'true' ; then
>> @@ -65,7 +65,7 @@ index a189d42..0f85486 100644
>>       *clang*)
>>         AC_SUBST(LLVM_AR)
>>         AC_PATH_TOOL(LLVM_AR, llvm-ar, '', ${llvm_path})
>> -@@ -1425,7 +1426,7 @@ then
>> +@@ -1456,7 +1457,7 @@ then
>>     fi
>>   fi
>>   LLVM_PROF_ERR=no
>> @@ -74,7 +74,7 @@ index a189d42..0f85486 100644
>>     *clang*)
>>       # Any changes made here should be reflected in the GCC+Darwin case
>> below
>>       PGO_PROF_GEN_FLAG="-fprofile-instr-generate"
>> -@@ -1486,7 +1487,7 @@ esac
>> +@@ -1517,7 +1518,7 @@ esac
>>   # compiler and platform.  BASECFLAGS tweaks need to be made even if the
>>   # user set OPT.
>>
>> @@ -83,7 +83,7 @@ index a189d42..0f85486 100644
>>       *clang*)
>>           cc_is_clang=1
>>           ;;
>> -@@ -1622,7 +1623,7 @@ yes)
>> +@@ -1653,7 +1654,7 @@ yes)
>>
>>       # ICC doesn't recognize the option, but only emits a warning
>>       ## XXX does it emit an unused result warning and can it be disabled?
>> @@ -92,16 +92,16 @@ index a189d42..0f85486 100644
>>       *icc*)
>>       ac_cv_disable_unused_result_warning=no
>>       ;;
>> -@@ -1943,7 +1944,7 @@ yes)
>> +@@ -1993,7 +1994,7 @@ yes)
>> +     ;;
>>   esac
>>
>> - # ICC needs -fp-model strict or floats behave badly
>>  -case "$CC" in
>>  +case "$cc_basename" in
>>   *icc*)
>> +     # ICC needs -fp-model strict or floats behave badly
>>       CFLAGS_NODIST="$CFLAGS_NODIST -fp-model strict"
>> -     ;;
>> -@@ -2711,7 +2712,7 @@ then
>> +@@ -2765,7 +2766,7 @@ then
>>                 then
>>                         LINKFORSHARED="-Wl,--export-dynamic"
>>                 fi;;
>> @@ -110,7 +110,7 @@ index a189d42..0f85486 100644
>>                   *gcc*)
>>                     if $CC -Xlinker --help 2>&1 | grep export-dynamic
>> >/dev/null
>>                     then
>> -@@ -5362,7 +5363,7 @@ if test "$have_gcc_asm_for_x87" = yes; then
>> +@@ -5507,7 +5508,7 @@ if test "$have_gcc_asm_for_x87" = yes; then
>>       # Some versions of gcc miscompile inline asm:
>>       # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46491
>>       # http://gcc.gnu.org/ml/gcc/2010-11/msg00366.html
>> diff --git
>> a/meta/recipes-devtools/python/python3/0001-setup.py-pass-missing-libraries-to-Extension-for-mul.patch
>> b/meta/recipes-devtools/python/python3/0001-setup.py-pass-missing-libraries-to-Extension-for-mul.patch
>> index ea0af02e72..7ca6753172 100644
>> ---
>> a/meta/recipes-devtools/python/python3/0001-setup.py-pass-missing-libraries-to-Extension-for-mul.patch
>> +++
>> b/meta/recipes-devtools/python/python3/0001-setup.py-pass-missing-libraries-to-Extension-for-mul.patch
>> @@ -1,4 +1,4 @@
>> -From 7019ba184b828ed7253750cf409fc5760ef90a54 Mon Sep 17 00:00:00 2001
>> +From 1bf39bd881a73fd0b9564b46c9e5a126f8483b3d Mon Sep 17 00:00:00 2001
>>  From: Alexander Kanavin <alex.kanavin@gmail.com>
>>  Date: Thu, 9 Jan 2020 17:44:05 +0100
>>  Subject: [PATCH] setup.py: pass missing libraries to Extension for
>> @@ -50,15 +50,16 @@ Upstream-Status: Pending
>>
>>  Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
>>  Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
>> +
>>  ---
>>   setup.py | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>>  diff --git a/setup.py b/setup.py
>> -index ec3f2a4..b0f1541 100644
>> +index 8cf058c..9c1c33b 100644
>>  --- a/setup.py
>>  +++ b/setup.py
>> -@@ -1671,7 +1671,7 @@ class PyBuildExt(build_ext):
>> +@@ -1777,7 +1777,7 @@ class PyBuildExt(build_ext):
>>                                      libraries=libs,
>>
>>  include_dirs=["Modules/_multiprocessing"]))
>>
>> diff --git
>> a/meta/recipes-devtools/python/python3/0001-test_locale.py-correct-the-test-output-format.patch
>> b/meta/recipes-devtools/python/python3/0001-test_locale.py-correct-the-test-output-format.patch
>> index 35b7e0c480..bd5f406708 100644
>> ---
>> a/meta/recipes-devtools/python/python3/0001-test_locale.py-correct-the-test-output-format.patch
>> +++
>> b/meta/recipes-devtools/python/python3/0001-test_locale.py-correct-the-test-output-format.patch
>> @@ -1,4 +1,4 @@
>> -From b94995e0c694ec9561efec0d1a59b323340e6105 Mon Sep 17 00:00:00 2001
>> +From b2d5ab7c71741bbf27ec4690243244a4de72cfc0 Mon Sep 17 00:00:00 2001
>>  From: Mingli Yu <mingli.yu@windriver.com>
>>  Date: Mon, 5 Aug 2019 15:57:39 +0800
>>  Subject: [PATCH] test_locale.py: correct the test output format
>> @@ -24,15 +24,16 @@ Before this patch:
>>  Upstream-Status: Submitted [https://github.com/python/cpython/pull/15132
>> ]
>>
>>  Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
>> +
>>  ---
>>   Lib/test/test_locale.py | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>>  diff --git a/Lib/test/test_locale.py b/Lib/test/test_locale.py
>> -index e2c2178..558d63c 100644
>> +index 2863d20..2ed141c 100644
>>  --- a/Lib/test/test_locale.py
>>  +++ b/Lib/test/test_locale.py
>> -@@ -527,7 +527,7 @@ class TestMiscellaneous(unittest.TestCase):
>> +@@ -562,7 +562,7 @@ class TestMiscellaneous(unittest.TestCase):
>>               self.skipTest('test needs Turkish locale')
>>           loc = locale.getlocale(locale.LC_CTYPE)
>>           if verbose:
>> @@ -41,6 +42,3 @@ index e2c2178..558d63c 100644
>>           locale.setlocale(locale.LC_CTYPE, loc)
>>           self.assertEqual(loc, locale.getlocale(locale.LC_CTYPE))
>>
>> ---
>> -2.7.4
>> -
>> diff --git
>> a/meta/recipes-devtools/python/python3/0017-setup.py-do-not-report-missing-dependencies-for-disa.patch
>> b/meta/recipes-devtools/python/python3/0017-setup.py-do-not-report-missing-dependencies-for-disa.patch
>> index 4bd98f62fd..d0ff3219a6 100644
>> ---
>> a/meta/recipes-devtools/python/python3/0017-setup.py-do-not-report-missing-dependencies-for-disa.patch
>> +++
>> b/meta/recipes-devtools/python/python3/0017-setup.py-do-not-report-missing-dependencies-for-disa.patch
>> @@ -1,4 +1,4 @@
>> -From a2dd127b4163aff6cc35af0d0251321964232ad4 Mon Sep 17 00:00:00 2001
>> +From 5d85a94fd0965aa26adf593b5f84948e9c502121 Mon Sep 17 00:00:00 2001
>>  From: Alexander Kanavin <alex.kanavin@gmail.com>
>>  Date: Mon, 7 Oct 2019 13:22:14 +0200
>>  Subject: [PATCH] setup.py: do not report missing dependencies for
>> disabled
>> @@ -11,20 +11,24 @@ build completeness checker which relies on the report.
>>  Upstream-Status: Inappropriate [oe-core specific]
>>  Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
>>
>> +Rebased for 3.9 [10/2020]
>> +Signed-off-by: Alejandro Enedino Hernandez Samaniego <
>> alejandro.hernandez@linux.microsoft.com>
>> +
>>  ---
>> - setup.py | 4 ++++
>> - 1 file changed, 4 insertions(+)
>> + setup.py | 5 +++++
>> + 1 file changed, 5 insertions(+)
>>
>>  diff --git a/setup.py b/setup.py
>> -index 7691258..ec3f2a4 100644
>> +index ab9fb8e..8cf058c 100644
>>  --- a/setup.py
>>  +++ b/setup.py
>> -@@ -408,6 +408,10 @@ class PyBuildExt(build_ext):
>> +@@ -495,6 +495,11 @@ class PyBuildExt(build_ext):
>>                   print("%-*s   %-*s   %-*s" % (longest, e, longest, f,
>>                                                 longest, g))
>>
>>  +        # There is no need to report missing module dependencies,
>>  +        # if the modules have been disabled in the first place.
>> ++        sysconf_dis =
>> sysconfig.get_config_var('MODDISABLED_NAMES').split()
>>  +        self.missing = list(set(self.missing) - set(sysconf_dis))
>>  +
>>           if self.missing:
>> diff --git
>> a/meta/recipes-devtools/python/python3/0020-configure.ac-setup.py-do-not-add-a-curses-include-pa.patch
>> b/meta/recipes-devtools/python/python3/0020-configure.ac-setup.py-do-not-add-a-curses-include-pa.patch
>> index e04a91605c..daa133e1e0 100644
>> ---
>> a/meta/recipes-devtools/python/python3/0020-configure.ac-setup.py-do-not-add-a-curses-include-pa.patch
>> +++
>> b/meta/recipes-devtools/python/python3/0020-configure.ac-setup.py-do-not-add-a-curses-include-pa.patch
>> @@ -1,4 +1,4 @@
>> -From 863c09f640a5dfd33ff22915b0d5fee7bc5df70a Mon Sep 17 00:00:00 2001
>> +From 5e75ab6ff0e5714684d71a3e75d389cdc1c2e783 Mon Sep 17 00:00:00 2001
>>  From: Alexander Kanavin <alex.kanavin@gmail.com>
>>  Date: Sun, 16 Feb 2020 17:50:25 +0100
>>  Subject: [PATCH] configure.ac, setup.py: do not add a curses include
>> path from
>> @@ -11,16 +11,17 @@ as dnf failures).
>>
>>  Upstream-Status: Inappropriate [oe-core specific]
>>  Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
>> +
>>  ---
>>   configure.ac | 6 ------
>>   setup.py     | 2 --
>>   2 files changed, 8 deletions(-)
>>
>>  diff --git a/configure.ac b/configure.ac
>> -index 915f475..c911011 100644
>> +index 01ea772..7ee38f6 100644
>>  --- a/configure.ac
>>  +++ b/configure.ac
>> -@@ -4828,12 +4828,6 @@ then
>> +@@ -4977,12 +4977,6 @@ then
>>     [Define if you have struct stat.st_mtimensec])
>>   fi
>>
>> @@ -34,10 +35,10 @@ index 915f475..c911011 100644
>>
>>   # On Solaris, term.h requires curses.h
>>  diff --git a/setup.py b/setup.py
>> -index b0f1541..7208cd0 100644
>> +index 9c1c33b..a456e53 100644
>>  --- a/setup.py
>>  +++ b/setup.py
>> -@@ -973,8 +973,6 @@ class PyBuildExt(build_ext):
>> +@@ -1075,8 +1075,6 @@ class PyBuildExt(build_ext):
>>           panel_library = 'panel'
>>           if curses_library == 'ncursesw':
>>               curses_defines.append(('HAVE_NCURSESW', '1'))
>> diff --git
>> a/meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch
>> b/meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch
>> index 820fb98ed8..bacdfba5ef 100644
>> ---
>> a/meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch
>> +++
>> b/meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch
>> @@ -1,4 +1,4 @@
>> -From 064187668fcbefdd39a8cde372bf651124c3e578 Mon Sep 17 00:00:00 2001
>> +From a05f77261dbabea29d05c249bfc2d8632e550b6a Mon Sep 17 00:00:00 2001
>>  From: Khem Raj <raj.khem@gmail.com>
>>  Date: Tue, 14 May 2013 15:00:26 -0700
>>  Subject: [PATCH] python3: Add target and native recipes
>> @@ -6,6 +6,7 @@ Subject: [PATCH] python3: Add target and native recipes
>>  Upstream-Status: Inappropriate [embedded specific]
>>
>>  02/2015 Rebased for Python 3.4.2
>> +10/2020 Rebased for Python 3.9.0
>>
>>  # The proper prefix is inside our staging area.
>>  # Signed-Off: Michael 'Mickey' Lauer <mickey@vanille-media.de>
>> @@ -18,10 +19,10 @@ Upstream-Status: Inappropriate [embedded specific]
>>   1 file changed, 11 insertions(+), 3 deletions(-)
>>
>>  diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
>> -index 2df348c..4f8db84 100644
>> +index 4774e12..5468239 100644
>>  --- a/Lib/distutils/sysconfig.py
>>  +++ b/Lib/distutils/sysconfig.py
>> -@@ -96,7 +96,9 @@ def get_python_inc(plat_specific=0, prefix=None):
>> +@@ -95,7 +95,9 @@ def get_python_inc(plat_specific=0, prefix=None):
>>       If 'prefix' is supplied, use it instead of sys.base_prefix or
>>       sys.base_exec_prefix -- i.e., ignore 'plat_specific'.
>>       """
>> @@ -32,7 +33,7 @@ index 2df348c..4f8db84 100644
>>           prefix = plat_specific and BASE_EXEC_PREFIX or BASE_PREFIX
>>       if os.name == "posix":
>>           if python_build:
>> -@@ -139,7 +141,13 @@ def get_python_lib(plat_specific=0, standard_lib=0,
>> prefix=None):
>> +@@ -138,7 +140,13 @@ def get_python_lib(plat_specific=0, standard_lib=0,
>> prefix=None):
>>       If 'prefix' is supplied, use it instead of sys.base_prefix or
>>       sys.base_exec_prefix -- i.e., ignore 'plat_specific'.
>>       """
>> @@ -47,12 +48,12 @@ index 2df348c..4f8db84 100644
>>           if standard_lib:
>>               prefix = plat_specific and BASE_EXEC_PREFIX or BASE_PREFIX
>>           else:
>> -@@ -147,7 +155,7 @@ def get_python_lib(plat_specific=0, standard_lib=0,
>> prefix=None):
>> -
>> -     if os.name == "posix":
>> -         libpython = os.path.join(prefix,
>> --                                 "lib", "python" + get_python_version())
>> -+                                 lib_basename, "python" +
>> get_python_version())
>> -         if standard_lib:
>> -             return libpython
>> +@@ -151,7 +159,7 @@ def get_python_lib(plat_specific=0, standard_lib=0,
>> prefix=None):
>> +             libdir = sys.platlibdir
>>           else:
>> +             # Pure Python
>> +-            libdir = "lib"
>> ++            libdir = "lib_basename"
>> +         libpython = os.path.join(prefix, libdir,
>> +                                  "python" + get_python_version())
>> +         if standard_lib:
>> diff --git
>> a/meta/recipes-devtools/python/python3/avoid_warning_about_tkinter.patch
>> b/meta/recipes-devtools/python/python3/avoid_warning_about_tkinter.patch
>> index 184540e794..4dfa639669 100644
>> ---
>> a/meta/recipes-devtools/python/python3/avoid_warning_about_tkinter.patch
>> +++
>> b/meta/recipes-devtools/python/python3/avoid_warning_about_tkinter.patch
>> @@ -1,4 +1,4 @@
>> -From ba7202700578d435b07cfdfb7b57e83185752800 Mon Sep 17 00:00:00 2001
>> +From f0653707a6a310bd059fe4dc3146052bb38b5d83 Mon Sep 17 00:00:00 2001
>>  From: Andrei Gherzan <andrei@gherzan.ro>
>>  Date: Mon, 28 Jan 2019 15:57:54 +0000
>>  Subject: [PATCH] _tkinter module needs tk module along with tcl. tk is
>> not yet
>> @@ -15,10 +15,10 @@ Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>>  diff --git a/setup.py b/setup.py
>> -index ab18ff0..7691258 100644
>> +index d3ccc6c..ab9fb8e 100644
>>  --- a/setup.py
>>  +++ b/setup.py
>> -@@ -1706,8 +1706,8 @@ class PyBuildExt(build_ext):
>> +@@ -1811,8 +1811,8 @@ class PyBuildExt(build_ext):
>>           self.detect_decimal()
>>           self.detect_ctypes()
>>           self.detect_multiprocessing()
>> diff --git a/meta/recipes-devtools/python/python3/cgi_py.patch
>> b/meta/recipes-devtools/python/python3/cgi_py.patch
>> index 6c4ba54320..493fdf0ab8 100644
>> --- a/meta/recipes-devtools/python/python3/cgi_py.patch
>> +++ b/meta/recipes-devtools/python/python3/cgi_py.patch
>> @@ -1,4 +1,4 @@
>> -From 62336285cba38017b35cb761c03f0c7e80a671a3 Mon Sep 17 00:00:00 2001
>> +From 5da956e20d53cfdb687b8b8c3c15cfe926961ada Mon Sep 17 00:00:00 2001
>>  From: Mark Hatle <mark.hatle@windriver.com>
>>  Date: Wed, 21 Sep 2011 20:55:33 -0500
>>  Subject: [PATCH] Lib/cgi.py: Update the script as mentioned in the
>> comment
>> @@ -12,7 +12,7 @@ Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
>>   1 file changed, 1 insertion(+), 10 deletions(-)
>>
>>  diff --git a/Lib/cgi.py b/Lib/cgi.py
>> -index 8cf6687..094c7b4 100755
>> +index 77ab703..3edaf60 100755
>>  --- a/Lib/cgi.py
>>  +++ b/Lib/cgi.py
>>  @@ -1,13 +1,4 @@
>> diff --git a/meta/recipes-devtools/python/python3/crosspythonpath.patch
>> b/meta/recipes-devtools/python/python3/crosspythonpath.patch
>> index d789ab57d4..f4c3b93782 100644
>> --- a/meta/recipes-devtools/python/python3/crosspythonpath.patch
>> +++ b/meta/recipes-devtools/python/python3/crosspythonpath.patch
>> @@ -1,4 +1,8 @@
>> -configure.ac: add CROSSPYTHONPATH into PYTHONPATH for PYTHON_FOR_BUILD
>> +From 9dabb16c327211b8fb9327d06d66c7ef6baea4b2 Mon Sep 17 00:00:00 2001
>> +From: Ricardo Ribalda <ricardo@ribalda.com>
>> +Date: Tue, 18 Nov 2014 03:35:33 -0500
>> +Subject: [PATCH] configure.ac: add CROSSPYTHONPATH into PYTHONPATH for
>> + PYTHON_FOR_BUILD
>>
>>  When building x86->x86 the system will try to execute .so and related
>> items
>>  from the default PYTHONPATH.  This will fail if the target CPU contains
>> @@ -10,8 +14,13 @@ Upstream-Status: Inappropriate [OE-Core integration
>> specific]
>>  Credits-to: Mark Hatle <mark.hatle@windriver.com>
>>  Credits-to: Jackie Huang <jackie.huang@windriver.com>
>>  Signed-off-by: Ricardo Ribalda <ricardo@ribalda.com>
>> +
>> +---
>> + configure.ac | 2 +-
>> + 1 file changed, 1 insertion(+), 1 deletion(-)
>> +
>>  diff --git a/configure.ac b/configure.ac
>> -index 4ab19a6..7036a53 100644
>> +index 784850b..01ea772 100644
>>  --- a/configure.ac
>>  +++ b/configure.ac
>>  @@ -76,7 +76,7 @@ if test "$cross_compiling" = yes; then
>> diff --git a/meta/recipes-devtools/python/python3/python-config.patch
>> b/meta/recipes-devtools/python/python3/python-config.patch
>> index c8a8f3d4aa..98b28bcbde 100644
>> --- a/meta/recipes-devtools/python/python3/python-config.patch
>> +++ b/meta/recipes-devtools/python/python3/python-config.patch
>> @@ -1,4 +1,4 @@
>> -From 07df0ae0d70cba6d1847fe1c24a71063930bec60 Mon Sep 17 00:00:00 2001
>> +From bf238a78ec90671789c6498bede99928cb7244e5 Mon Sep 17 00:00:00 2001
>>  From: Tyler Hall <tylerwhall@gmail.com>
>>  Date: Sun, 4 May 2014 20:06:43 -0400
>>  Subject: [PATCH] python-config: Revert to using distutils.sysconfig
>> @@ -21,7 +21,7 @@ Signed-off-by: Tyler Hall <tylerwhall@gmail.com>
>>   1 file changed, 5 insertions(+), 5 deletions(-)
>>
>>  diff --git a/Misc/python-config.in b/Misc/python-config.in
>> -index 727c4a8..c702829 100644
>> +index ebd99da..13e57ae 100644
>>  --- a/Misc/python-config.in
>>  +++ b/Misc/python-config.in
>>  @@ -6,7 +6,7 @@
>> @@ -37,11 +37,11 @@ index 727c4a8..c702829 100644
>>
>>   for opt in opt_flags:
>>       if opt == '--prefix':
>> --        print(sysconfig.get_config_var('prefix'))
>> +-        print(getvar('prefix'))
>>  +        print(sysconfig.PREFIX)
>>
>>       elif opt == '--exec-prefix':
>> --        print(sysconfig.get_config_var('exec_prefix'))
>> +-        print(getvar('exec_prefix'))
>>  +        print(sysconfig.EXEC_PREFIX)
>>
>>       elif opt in ('--includes', '--cflags'):
>> diff --git a/meta/recipes-devtools/python/python3_3.8.5.bb
>> b/meta/recipes-devtools/python/python3_3.9.0.bb
>> similarity index 95%
>> rename from meta/recipes-devtools/python/python3_3.8.5.bb
>> rename to meta/recipes-devtools/python/python3_3.9.0.bb
>> index 2a3c52a116..bd1d40edce 100644
>> --- a/meta/recipes-devtools/python/python3_3.8.5.bb
>> +++ b/meta/recipes-devtools/python/python3_3.9.0.bb
>> @@ -1,9 +1,9 @@
>>  SUMMARY = "The Python Programming Language"
>>  HOMEPAGE = "http://www.python.org"
>> -LICENSE = "PSFv2"
>> +LICENSE = "PSFv2 & BSD-0-Clause"
>>  SECTION = "devel/python"
>>
>> -LIC_FILES_CHKSUM = "file://LICENSE;md5=203a6dbc802ee896020a47161e759642"
>> +LIC_FILES_CHKSUM = "file://LICENSE;md5=33223c9ef60c31e3f0e866cb09b65e83"
>>
>>  SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz \
>>             file://run-ptest \
>> @@ -17,7 +17,6 @@ SRC_URI = "
>> http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz \
>>
>> file://0001-Do-not-use-the-shell-version-of-python-config-that-w.patch \
>>             file://python-config.patch \
>>
>> file://0001-Makefile.pre-use-qemu-wrapper-when-gathering-profile.patch \
>> -
>>  file://0001-Do-not-hardcode-lib-as-location-for-site-packages-an.patch \
>>
>> file://0001-python3-use-cc_basename-to-replace-CC-for-checking-c.patch \
>>
>> file://0001-Lib-sysconfig.py-fix-another-place-where-lib-is-hard.patch \
>>
>> file://0001-Makefile-fix-Issue36464-parallel-build-race-problem.patch \
>> @@ -29,19 +28,17 @@ SRC_URI = "
>> http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz \
>>
>> file://0017-setup.py-do-not-report-missing-dependencies-for-disa.patch \
>>
>> file://0001-setup.py-pass-missing-libraries-to-Extension-for-mul.patch \
>>             file://0001-Makefile-do-not-compile-.pyc-in-parallel.patch \
>> -           file://0001-configure.ac-fix-LIBPL.patch \
>> -           file://0001-python3-Do-not-hardcode-lib-for-distutils.patch \
>>
>> file://0020-configure.ac-setup.py-do-not-add-a-curses-include-pa.patch \
>>             "
>>
>> +
>>  SRC_URI_append_class-native = " \
>>
>> file://0001-distutils-sysconfig-append-STAGING_LIBDIR-python-sys.patch \
>>             file://12-distutils-prefix-is-inside-staging-area.patch \
>>             file://0001-Don-t-search-system-for-headers-libraries.patch \
>>             "
>>
>> -SRC_URI[md5sum] = "35b5a3d0254c1c59be9736373d429db7"
>> -SRC_URI[sha256sum] =
>> "e3003ed57db17e617acb382b0cade29a248c6026b1bd8aad1f976e9af66a83b0"
>> +SRC_URI[sha256sum] =
>> "9c73e63c99855709b9be0b3cc9e5b072cb60f37311e8c4e50f15576a0bf82854"
>>
>>  # exclude pre-releases for both python 2.x and 3.x
>>  UPSTREAM_CHECK_REGEX = "[Pp]ython-(?P<pver>\d+(\.\d+)+).tar"
>> @@ -52,7 +49,7 @@ CVE_PRODUCT = "python"
>>  # This is not exploitable when glibc has CVE-2016-10739 fixed.
>>  CVE_CHECK_WHITELIST += "CVE-2019-18348"
>>
>> -PYTHON_MAJMIN = "3.8"
>> +PYTHON_MAJMIN = "3.9"
>>
>>  S = "${WORKDIR}/Python-${PV}"
>>
>> @@ -71,7 +68,7 @@ DEPENDS = "bzip2-replacement-native libffi bzip2
>> openssl sqlite3 zlib virtual/li
>>  DEPENDS_append_class-target = " python3-native"
>>  DEPENDS_append_class-nativesdk = " python3-native"
>>
>> -EXTRA_OECONF = " --without-ensurepip --enable-shared"
>> +EXTRA_OECONF = " --without-ensurepip --enable-shared
>> --with-platlibdir=${baselib}"
>>  EXTRA_OECONF_append_class-native = " --bindir=${bindir}/${PN}"
>>
>>  export
>> CROSSPYTHONPATH="${STAGING_LIBDIR_NATIVE}/python${PYTHON_MAJMIN}/lib-dynload/"
>> @@ -115,7 +112,6 @@ CPPFLAGS_append = " -I${STAGING_INCDIR}/ncursesw
>> -I${STAGING_INCDIR}/uuid"
>>  EXTRA_OEMAKE = '\
>>    STAGING_LIBDIR=${STAGING_LIBDIR} \
>>    STAGING_INCDIR=${STAGING_INCDIR} \
>> -  LIB=${baselib} \
>>  '
>>
>>  do_compile_prepend_class-target() {
>> @@ -179,7 +175,6 @@ py_package_preprocess () {
>>                  -e 's:${RECIPE_SYSROOT_NATIVE}::g' \
>>                  -e 's:${RECIPE_SYSROOT}::g' \
>>                  -e 's:${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}::g' \
>> -
>> ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config-${PYTHON_MAJMIN}${PYTHON_ABI}*/Makefile
>> \
>>
>>  ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata*.py \
>>                  ${PKGD}/${bindir}/python${PYTHON_MAJMIN}-config
>>
>> --
>> 2.25.1
>>
>>
>> 
>>
>>

[-- Attachment #2: Type: text/html, Size: 74531 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [OE-core] [PATCH 2/2] python3: upgrade to python 3.9.0
  2020-10-24 21:59     ` Alejandro Hernandez Samaniego
@ 2020-10-25  7:05       ` Alexander Kanavin
  0 siblings, 0 replies; 6+ messages in thread
From: Alexander Kanavin @ 2020-10-25  7:05 UTC (permalink / raw)
  To: Alejandro Enedino Hernandez Samaniego
  Cc: Alejandro Enedino Hernandez Samaniego, OE-core

[-- Attachment #1: Type: text/plain, Size: 61249 bytes --]

No need to be sorry, the effort is much appreciated! I was actually
thinking of taking your patch then rebasing any additional fixing of mine
on top, so you’re not discouraged from doing similar work in the future.

Alex

On Sat 24. Oct 2020 at 23.58, Alejandro Enedino Hernandez Samaniego <
alejandro@enedino.org> wrote:

> Oops, sorry about that, and here I was thinking I was gonna help you out
> with the upgrades so you didn't waste time on this one
>
> On Sat, 24 Oct 2020 at 21:35, Alexander Kanavin <alex.kanavin@gmail.com>
> wrote:
>
>> Haha, you beat me to it by a few minutes :)
>>
>> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/commit/?h=akanavin/package-version-updates&id=98049b60602b4bd3854e870e46705716e469277c
>>
>> I have some additional fixes included though, coming from autobuilder
>> runs.
>>
>> Alex
>>
>>
>>
>>
>> On Sat, 24 Oct 2020 at 23:22, Alejandro Hernandez Samaniego <
>> alejandro@enedino.org> wrote:
>>
>>> AFAIC the upstream fix to use --with-platlibdir can now replace the
>>> functinoality we put in place for multilib builds, this patch uses
>>> such config as well as removes some of the patches for that.
>>>
>>> - Fixes fuzz on patches
>>> - Rebased the rest to work on 3.9.0
>>> - License changedm, it now includes BSD Clause 0
>>>
>>> Signed-off-by: Alejandro Enedino Hernandez Samaniego <
>>> alejandro.hernandez@linux.microsoft.com>
>>> ---
>>>  meta/classes/python3-dir.bbclass              |   2 +-
>>>  ...ib-termcap-to-linker-flags-to-avoid-.patch |   6 +-
>>>  ...lib-as-location-for-site-packages-an.patch | 214 ------------------
>>>  ...hell-version-of-python-config-that-w.patch |   7 +-
>>>  ...-search-system-for-headers-libraries.patch |   6 +-
>>>  ...-fix-another-place-where-lib-is-hard.patch |  18 +-
>>>  ...file-do-not-compile-.pyc-in-parallel.patch |   7 +-
>>>  ...sue36464-parallel-build-race-problem.patch |  10 +-
>>>  ...-qemu-wrapper-when-gathering-profile.patch |   7 +-
>>>  ...FLAG_REF-always-for-interned-strings.patch |  12 +-
>>>  ...-detection-of-mips-architecture-for-.patch |  11 +-
>>>  .../python3/0001-configure.ac-fix-LIBPL.patch |  35 ---
>>>  ...fig-append-STAGING_LIBDIR-python-sys.patch |  10 +-
>>>  ...n3-Do-not-hardcode-lib-for-distutils.patch |  43 ----
>>>  ...asename-to-replace-CC-for-checking-c.patch |  26 +--
>>>  ...ssing-libraries-to-Extension-for-mul.patch |   7 +-
>>>  ...le.py-correct-the-test-output-format.patch |  10 +-
>>>  ...report-missing-dependencies-for-disa.patch |  14 +-
>>>  ...up.py-do-not-add-a-curses-include-pa.patch |  11 +-
>>>  ...tutils-prefix-is-inside-staging-area.patch |  25 +-
>>>  .../python3/avoid_warning_about_tkinter.patch |   6 +-
>>>  .../python/python3/cgi_py.patch               |   4 +-
>>>  .../python/python3/crosspythonpath.patch      |  13 +-
>>>  .../python/python3/python-config.patch        |   8 +-
>>>  .../{python3_3.8.5.bb => python3_3.9.0.bb}    |  17 +-
>>>  25 files changed, 123 insertions(+), 406 deletions(-)
>>>  delete mode 100644
>>> meta/recipes-devtools/python/python3/0001-Do-not-hardcode-lib-as-location-for-site-packages-an.patch
>>>  delete mode 100644
>>> meta/recipes-devtools/python/python3/0001-configure.ac-fix-LIBPL.patch
>>>  delete mode 100644
>>> meta/recipes-devtools/python/python3/0001-python3-Do-not-hardcode-lib-for-distutils.patch
>>>  rename meta/recipes-devtools/python/{python3_3.8.5.bb =>
>>> python3_3.9.0.bb} (95%)
>>>
>>> diff --git a/meta/classes/python3-dir.bbclass
>>> b/meta/classes/python3-dir.bbclass
>>> index 036d7140d9..f51f971fc5 100644
>>> --- a/meta/classes/python3-dir.bbclass
>>> +++ b/meta/classes/python3-dir.bbclass
>>> @@ -1,4 +1,4 @@
>>> -PYTHON_BASEVERSION = "3.8"
>>> +PYTHON_BASEVERSION = "3.9"
>>>  PYTHON_ABI = ""
>>>  PYTHON_DIR = "python${PYTHON_BASEVERSION}"
>>>  PYTHON_PN = "python3"
>>> diff --git
>>> a/meta/recipes-devtools/python/python3/0001-Do-not-add-usr-lib-termcap-to-linker-flags-to-avoid-.patch
>>> b/meta/recipes-devtools/python/python3/0001-Do-not-add-usr-lib-termcap-to-linker-flags-to-avoid-.patch
>>> index 59592821d7..44354f44d4 100644
>>> ---
>>> a/meta/recipes-devtools/python/python3/0001-Do-not-add-usr-lib-termcap-to-linker-flags-to-avoid-.patch
>>> +++
>>> b/meta/recipes-devtools/python/python3/0001-Do-not-add-usr-lib-termcap-to-linker-flags-to-avoid-.patch
>>> @@ -1,4 +1,4 @@
>>> -From 039c53dd5baddec3359a05be0bff46a3b32bbb84 Mon Sep 17 00:00:00 2001
>>> +From 2b122b1e664a91b14a8d8074d342439c1892700a Mon Sep 17 00:00:00 2001
>>>  From: Alexander Kanavin <alex.kanavin@gmail.com>
>>>  Date: Fri, 25 Jan 2019 19:04:13 +0100
>>>  Subject: [PATCH] Do not add /usr/lib/termcap to linker flags to avoid
>>> host
>>> @@ -12,10 +12,10 @@ Signed-off-by: Alexander Kanavin <
>>> alex.kanavin@gmail.com>
>>>   1 file changed, 1 deletion(-)
>>>
>>>  diff --git a/setup.py b/setup.py
>>> -index 20d7f35..ab18ff0 100644
>>> +index 770866b..d3ccc6c 100644
>>>  --- a/setup.py
>>>  +++ b/setup.py
>>> -@@ -957,7 +957,6 @@ class PyBuildExt(build_ext):
>>> +@@ -1058,7 +1058,6 @@ class PyBuildExt(build_ext):
>>>                                                        'termcap'):
>>>                   readline_libs.append('termcap')
>>>               self.add(Extension('readline', ['readline.c'],
>>> diff --git
>>> a/meta/recipes-devtools/python/python3/0001-Do-not-hardcode-lib-as-location-for-site-packages-an.patch
>>> b/meta/recipes-devtools/python/python3/0001-Do-not-hardcode-lib-as-location-for-site-packages-an.patch
>>> deleted file mode 100644
>>> index 112c979441..0000000000
>>> ---
>>> a/meta/recipes-devtools/python/python3/0001-Do-not-hardcode-lib-as-location-for-site-packages-an.patch
>>> +++ /dev/null
>>> @@ -1,214 +0,0 @@
>>> -From a078b6ff1492e848ad1055764fb9a414abaf3e12 Mon Sep 17 00:00:00 2001
>>> -From: Alexander Kanavin <alex.kanavin@gmail.com>
>>> -Date: Tue, 5 Feb 2019 15:52:02 +0100
>>> -Subject: [PATCH] Do not hardcode "lib" as location for modules,
>>> site-packages
>>> - and lib-dynload
>>> -
>>> -Upstream-Status: Inappropriate [oe-core specific]
>>> -Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
>>> -
>>> ----
>>> - Include/pythonrun.h  |  2 ++
>>> - Lib/site.py          |  4 ++--
>>> - Makefile.pre.in      |  5 +++--
>>> - Modules/getpath.c    | 22 ++++++++++++++--------
>>> - Python/getplatform.c | 10 ++++++++++
>>> - Python/sysmodule.c   |  2 ++
>>> - 6 files changed, 33 insertions(+), 12 deletions(-)
>>> -
>>> -diff --git a/Include/pythonrun.h b/Include/pythonrun.h
>>> -index 46091e0..61b2e15 100644
>>> ---- a/Include/pythonrun.h
>>> -+++ b/Include/pythonrun.h
>>> -@@ -7,6 +7,8 @@
>>> - extern "C" {
>>> - #endif
>>> -
>>> -+PyAPI_FUNC(const char *) Py_GetLib(void);
>>> -+
>>> - #ifndef Py_LIMITED_API
>>> - PyAPI_FUNC(int) PyRun_SimpleStringFlags(const char *, PyCompilerFlags
>>> *);
>>> - PyAPI_FUNC(int) PyRun_AnyFileExFlags(
>>> -diff --git a/Lib/site.py b/Lib/site.py
>>> -index a065ab0..1d720ef 100644
>>> ---- a/Lib/site.py
>>> -+++ b/Lib/site.py
>>> -@@ -335,12 +335,12 @@ def getsitepackages(prefixes=None):
>>> -         seen.add(prefix)
>>> -
>>> -         if os.sep == '/':
>>> --            sitepackages.append(os.path.join(prefix, "lib",
>>> -+            sitepackages.append(os.path.join(prefix, sys.lib,
>>> -                                         "python%d.%d" %
>>> sys.version_info[:2],
>>> -                                         "site-packages"))
>>> -         else:
>>> -             sitepackages.append(prefix)
>>> --            sitepackages.append(os.path.join(prefix, "lib",
>>> "site-packages"))
>>> -+            sitepackages.append(os.path.join(prefix, sys.lib,
>>> "site-packages"))
>>> -     return sitepackages
>>> -
>>> - def addsitepackages(known_paths, prefixes=None):
>>> -diff --git a/Makefile.pre.in b/Makefile.pre.in
>>> -index 65665df..be49140 100644
>>> ---- a/Makefile.pre.in
>>> -+++ b/Makefile.pre.in
>>> -@@ -143,7 +143,7 @@ LIBDIR=            @libdir@
>>> - MANDIR=               @mandir@
>>> - INCLUDEDIR=   @includedir@
>>> - CONFINCLUDEDIR=       $(exec_prefix)/include
>>> --SCRIPTDIR=    $(prefix)/lib
>>> -+SCRIPTDIR=    @libdir@
>>> - ABIFLAGS=     @ABIFLAGS@
>>> -
>>> - # Detailed destination directories
>>> -@@ -753,6 +753,7 @@ Modules/getpath.o: $(srcdir)/Modules/getpath.c
>>> Makefile
>>> -               -DEXEC_PREFIX='"$(exec_prefix)"' \
>>> -               -DVERSION='"$(VERSION)"' \
>>> -               -DVPATH='"$(VPATH)"' \
>>> -+              -DLIB='"$(LIB)"' \
>>> -               -o $@ $(srcdir)/Modules/getpath.c
>>> -
>>> - Programs/python.o: $(srcdir)/Programs/python.c
>>> -@@ -868,7 +869,7 @@ regen-symbol: $(srcdir)/Include/graminit.h
>>> - Python/compile.o Python/symtable.o Python/ast_unparse.o Python/ast.o
>>> Python/future.o Parser/parsetok.o: $(srcdir)/Include/graminit.h
>>> $(srcdir)/Include/Python-ast.h
>>> -
>>> - Python/getplatform.o: $(srcdir)/Python/getplatform.c
>>> --              $(CC) -c $(PY_CORE_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o
>>> $@ $(srcdir)/Python/getplatform.c
>>> -+              $(CC) -c $(PY_CORE_CFLAGS) -DPLATFORM='"$(MACHDEP)"'
>>> -DLIB='"$(LIB)"' -o $@ $(srcdir)/Python/getplatform.c
>>> -
>>> - Python/importdl.o: $(srcdir)/Python/importdl.c
>>> -               $(CC) -c $(PY_CORE_CFLAGS) -I$(DLINCLDIR) -o $@
>>> $(srcdir)/Python/importdl.c
>>> -diff --git a/Modules/getpath.c b/Modules/getpath.c
>>> -index b727f66..c003e46 100644
>>> ---- a/Modules/getpath.c
>>> -+++ b/Modules/getpath.c
>>> -@@ -128,6 +128,7 @@ typedef struct {
>>> -     wchar_t *exec_prefix;              /* EXEC_PREFIX macro */
>>> -
>>> -     wchar_t *lib_python;               /* "lib/pythonX.Y" */
>>> -+    wchar_t *multilib_python;               /* "lib[suffix]/pythonX.Y"
>>> */
>>> -
>>> -     int prefix_found;         /* found platform independent libraries?
>>> */
>>> -     int exec_prefix_found;    /* found the platform dependent
>>> libraries? */
>>> -@@ -386,7 +387,7 @@ search_for_prefix(PyCalculatePath *calculate,
>>> _PyPathConfig *pathconfig,
>>> -         if (delim) {
>>> -             *delim = L'\0';
>>> -         }
>>> --        status = joinpath(prefix, calculate->lib_python, prefix_len);
>>> -+        status = joinpath(prefix, calculate->multilib_python,
>>> prefix_len);
>>> -         if (_PyStatus_EXCEPTION(status)) {
>>> -             return status;
>>> -         }
>>> -@@ -444,7 +445,7 @@ search_for_prefix(PyCalculatePath *calculate,
>>> _PyPathConfig *pathconfig,
>>> -     do {
>>> -         /* Path: <argv0_path or substring> / <lib_python> / LANDMARK */
>>> -         size_t n = wcslen(prefix);
>>> --        status = joinpath(prefix, calculate->lib_python, prefix_len);
>>> -+        status = joinpath(prefix, calculate->multilib_python,
>>> prefix_len);
>>> -         if (_PyStatus_EXCEPTION(status)) {
>>> -             return status;
>>> -         }
>>> -@@ -467,7 +468,7 @@ search_for_prefix(PyCalculatePath *calculate,
>>> _PyPathConfig *pathconfig,
>>> -     if (safe_wcscpy(prefix, calculate->prefix, prefix_len) < 0) {
>>> -         return PATHLEN_ERR();
>>> -     }
>>> --    status = joinpath(prefix, calculate->lib_python, prefix_len);
>>> -+    status = joinpath(prefix, calculate->multilib_python, prefix_len);
>>> -     if (_PyStatus_EXCEPTION(status)) {
>>> -         return status;
>>> -     }
>>> -@@ -510,7 +511,7 @@ calculate_prefix(PyCalculatePath *calculate,
>>> _PyPathConfig *pathconfig,
>>> -         if (safe_wcscpy(prefix, calculate->prefix, prefix_len) < 0) {
>>> -             return PATHLEN_ERR();
>>> -         }
>>> --        status = joinpath(prefix, calculate->lib_python, prefix_len);
>>> -+        status = joinpath(prefix, calculate->multilib_python,
>>> prefix_len);
>>> -         if (_PyStatus_EXCEPTION(status)) {
>>> -             return status;
>>> -         }
>>> -@@ -635,7 +636,7 @@ search_for_exec_prefix(PyCalculatePath *calculate,
>>> _PyPathConfig *pathconfig,
>>> -                 return PATHLEN_ERR();
>>> -             }
>>> -         }
>>> --        status = joinpath(exec_prefix, calculate->lib_python,
>>> exec_prefix_len);
>>> -+        status = joinpath(exec_prefix, calculate->multilib_python,
>>> exec_prefix_len);
>>> -         if (_PyStatus_EXCEPTION(status)) {
>>> -             return status;
>>> -         }
>>> -@@ -667,7 +668,7 @@ search_for_exec_prefix(PyCalculatePath *calculate,
>>> _PyPathConfig *pathconfig,
>>> -     do {
>>> -         /* Path: <argv0_path or substring> / <lib_python> /
>>> "lib-dynload" */
>>> -         size_t n = wcslen(exec_prefix);
>>> --        status = joinpath(exec_prefix, calculate->lib_python,
>>> exec_prefix_len);
>>> -+        status = joinpath(exec_prefix, calculate->multilib_python,
>>> exec_prefix_len);
>>> -         if (_PyStatus_EXCEPTION(status)) {
>>> -             return status;
>>> -         }
>>> -@@ -689,7 +690,7 @@ search_for_exec_prefix(PyCalculatePath *calculate,
>>> _PyPathConfig *pathconfig,
>>> -     if (safe_wcscpy(exec_prefix, calculate->exec_prefix,
>>> exec_prefix_len) < 0) {
>>> -         return PATHLEN_ERR();
>>> -     }
>>> --    status = joinpath(exec_prefix, calculate->lib_python,
>>> exec_prefix_len);
>>> -+    status = joinpath(exec_prefix, calculate->multilib_python,
>>> exec_prefix_len);
>>> -     if (_PyStatus_EXCEPTION(status)) {
>>> -         return status;
>>> -     }
>>> -@@ -928,7 +929,7 @@ calculate_argv0_path(PyCalculatePath *calculate,
>>> const wchar_t *program_full_pat
>>> -             return PATHLEN_ERR();
>>> -         }
>>> -         reduce(argv0_path);
>>> --        status = joinpath(argv0_path, calculate->lib_python,
>>> argv0_path_len);
>>> -+        status = joinpath(argv0_path, calculate->multilib_python,
>>> argv0_path_len);
>>> -         if (_PyStatus_EXCEPTION(status)) {
>>> -             PyMem_RawFree(wbuf);
>>> -             return status;
>>> -@@ -1201,6 +1202,10 @@ calculate_init(PyCalculatePath *calculate, const
>>> PyConfig *config)
>>> -     if (!calculate->lib_python) {
>>> -         return DECODE_LOCALE_ERR("EXEC_PREFIX define", len);
>>> -     }
>>> -+    calculate->multilib_python = Py_DecodeLocale(LIB "/python"
>>> VERSION, &len);
>>> -+    if (!calculate->multilib_python) {
>>> -+        return DECODE_LOCALE_ERR("EXEC_PREFIX define", len);
>>> -+    }
>>> -
>>> -     calculate->warnings = config->pathconfig_warnings;
>>> -     calculate->pythonpath_env = config->pythonpath_env;
>>> -@@ -1216,6 +1221,7 @@ calculate_free(PyCalculatePath *calculate)
>>> -     PyMem_RawFree(calculate->prefix);
>>> -     PyMem_RawFree(calculate->exec_prefix);
>>> -     PyMem_RawFree(calculate->lib_python);
>>> -+    PyMem_RawFree(calculate->multilib_python);
>>> -     PyMem_RawFree(calculate->path_env);
>>> - }
>>> -
>>> -diff --git a/Python/getplatform.c b/Python/getplatform.c
>>> -index 81a0f7a..d55396b 100644
>>> ---- a/Python/getplatform.c
>>> -+++ b/Python/getplatform.c
>>> -@@ -10,3 +10,13 @@ Py_GetPlatform(void)
>>> - {
>>> -     return PLATFORM;
>>> - }
>>> -+
>>> -+#ifndef LIB
>>> -+#define LIB "lib"
>>> -+#endif
>>> -+
>>> -+const char *
>>> -+Py_GetLib(void)
>>> -+{
>>> -+      return LIB;
>>> -+}
>>> -diff --git a/Python/sysmodule.c b/Python/sysmodule.c
>>> -index 5b0fb81..0dce754 100644
>>> ---- a/Python/sysmodule.c
>>> -+++ b/Python/sysmodule.c
>>> -@@ -2668,6 +2668,8 @@ _PySys_InitCore(_PyRuntimeState *runtime,
>>> PyInterpreterState *interp,
>>> -                         PyUnicode_FromString(Py_GetCopyright()));
>>> -     SET_SYS_FROM_STRING("platform",
>>> -                         PyUnicode_FromString(Py_GetPlatform()));
>>> -+    SET_SYS_FROM_STRING("lib",
>>> -+                        PyUnicode_FromString(Py_GetLib()));
>>> -     SET_SYS_FROM_STRING("maxsize",
>>> -                         PyLong_FromSsize_t(PY_SSIZE_T_MAX));
>>> -     SET_SYS_FROM_STRING("float_info",
>>> diff --git
>>> a/meta/recipes-devtools/python/python3/0001-Do-not-use-the-shell-version-of-python-config-that-w.patch
>>> b/meta/recipes-devtools/python/python3/0001-Do-not-use-the-shell-version-of-python-config-that-w.patch
>>> index 83fd52d87f..7113ce2138 100644
>>> ---
>>> a/meta/recipes-devtools/python/python3/0001-Do-not-use-the-shell-version-of-python-config-that-w.patch
>>> +++
>>> b/meta/recipes-devtools/python/python3/0001-Do-not-use-the-shell-version-of-python-config-that-w.patch
>>> @@ -1,4 +1,4 @@
>>> -From 148861fa16f2aaacd518770f337ea54b5182f981 Mon Sep 17 00:00:00 2001
>>> +From 980fcf1a36bcb3ab26d4e82a304e205f02cb376f Mon Sep 17 00:00:00 2001
>>>  From: Alexander Kanavin <alex.kanavin@gmail.com>
>>>  Date: Tue, 29 Jan 2019 15:03:01 +0100
>>>  Subject: [PATCH] Do not use the shell version of python-config that was
>>> @@ -9,15 +9,16 @@ outputs directories correctly.
>>>
>>>  Upstream-Status: Inappropriate [oe-specific]
>>>  Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
>>> +
>>>  ---
>>>   Makefile.pre.in | 9 +++------
>>>   1 file changed, 3 insertions(+), 6 deletions(-)
>>>
>>>  diff --git a/Makefile.pre.in b/Makefile.pre.in
>>> -index 2d2e11f..cc19942 100644
>>> +index 77f91e7..5259754 100644
>>>  --- a/Makefile.pre.in
>>>  +++ b/Makefile.pre.in
>>> -@@ -1431,12 +1431,9 @@ python-config: $(srcdir)/Misc/python-config.in
>>> Misc/python-config.sh
>>> +@@ -1568,12 +1568,9 @@ python-config: $(srcdir)/Misc/python-config.in
>>> Misc/python-config.sh
>>>         sed -e "s,@EXENAME@,$(BINDIR)/python$(LDVERSION)$(EXE)," <
>>> $(srcdir)/Misc/python-config.in >python-config.py
>>>         @ # Replace makefile compat. variable references with shell
>>> script compat. ones; $(VAR) -> ${VAR}
>>>         LC_ALL=C sed -e 's,\$$(\([A-Za-z0-9_]*\)),\$$\{\1\},g' <
>>> Misc/python-config.sh >python-config
>>> diff --git
>>> a/meta/recipes-devtools/python/python3/0001-Don-t-search-system-for-headers-libraries.patch
>>> b/meta/recipes-devtools/python/python3/0001-Don-t-search-system-for-headers-libraries.patch
>>> index 3e471b9a49..95b4969c09 100644
>>> ---
>>> a/meta/recipes-devtools/python/python3/0001-Don-t-search-system-for-headers-libraries.patch
>>> +++
>>> b/meta/recipes-devtools/python/python3/0001-Don-t-search-system-for-headers-libraries.patch
>>> @@ -1,4 +1,4 @@
>>> -From b880e78bf4a1852e260188e6df3ec6034403d2fc Mon Sep 17 00:00:00 2001
>>> +From 9325b9705046d5ad4ade0482f0020a0ae5c56eaf Mon Sep 17 00:00:00 2001
>>>  From: Jeremy Puhlman <jpuhlman@mvista.com>
>>>  Date: Wed, 4 Mar 2020 00:06:42 +0000
>>>  Subject: [PATCH] Don't search system for headers/libraries
>>> @@ -11,10 +11,10 @@ Signed-off-by: Jeremy Puhlman <jpuhlman@mvista.com>
>>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>>
>>>  diff --git a/setup.py b/setup.py
>>> -index 7208cd0..c0bd0ad 100644
>>> +index a456e53..af194ee 100644
>>>  --- a/setup.py
>>>  +++ b/setup.py
>>> -@@ -674,8 +674,8 @@ class PyBuildExt(build_ext):
>>> +@@ -770,8 +770,8 @@ class PyBuildExt(build_ext):
>>>               add_dir_to_list(self.compiler.include_dirs,
>>>                               sysconfig.get_config_var("INCLUDEDIR"))
>>>
>>> diff --git
>>> a/meta/recipes-devtools/python/python3/0001-Lib-sysconfig.py-fix-another-place-where-lib-is-hard.patch
>>> b/meta/recipes-devtools/python/python3/0001-Lib-sysconfig.py-fix-another-place-where-lib-is-hard.patch
>>> index b97583682a..7aaa346c5d 100644
>>> ---
>>> a/meta/recipes-devtools/python/python3/0001-Lib-sysconfig.py-fix-another-place-where-lib-is-hard.patch
>>> +++
>>> b/meta/recipes-devtools/python/python3/0001-Lib-sysconfig.py-fix-another-place-where-lib-is-hard.patch
>>> @@ -6,22 +6,26 @@ Subject: [PATCH] Lib/sysconfig.py: fix another place
>>> where 'lib' is hardcoded
>>>
>>>  Upstream-Status: Inappropriate [oe-core specific]
>>>  Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
>>> +
>>> +Rebased for 3.9 [10/2020]
>>> +Signed-off-by: Alejandro Enedino Hernandez Samaniego <
>>> alejandro.hernandez@linux.microsoft.com>
>>> +
>>>  ---
>>>   Lib/sysconfig.py | 8 ++++----
>>>   1 file changed, 4 insertions(+), 4 deletions(-)
>>>
>>> -diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py
>>> -index d15cec8..87fa5e6 100644
>>> ---- a/Lib/sysconfig.py
>>> -+++ b/Lib/sysconfig.py
>>> +Index: Python-3.9.0/Lib/sysconfig.py
>>> +===================================================================
>>> +--- Python-3.9.0.orig/Lib/sysconfig.py
>>> ++++ Python-3.9.0/Lib/sysconfig.py
>>>  @@ -20,10 +20,10 @@ __all__ = [
>>>
>>>   _INSTALL_SCHEMES = {
>>>       'posix_prefix': {
>>> --        'stdlib': '{installed_base}/lib/python{py_version_short}',
>>> --        'platstdlib': '{platbase}/lib/python{py_version_short}',
>>> +-        'stdlib':
>>> '{installed_base}/{platlibdir}/python{py_version_short}',
>>> +-        'platstdlib':
>>> '{platbase}/{platlibdir}/python{py_version_short}',
>>>  -        'purelib': '{base}/lib/python{py_version_short}/site-packages',
>>> --        'platlib':
>>> '{platbase}/lib/python{py_version_short}/site-packages',
>>> +-        'platlib':
>>> '{platbase}/{platlibdir}/python{py_version_short}/site-packages',
>>>  +        'stdlib': '{LIBDEST}',
>>>  +        'platstdlib': '{LIBDEST}',
>>>  +        'purelib': '{LIBDEST}/site-packages',
>>> diff --git
>>> a/meta/recipes-devtools/python/python3/0001-Makefile-do-not-compile-.pyc-in-parallel.patch
>>> b/meta/recipes-devtools/python/python3/0001-Makefile-do-not-compile-.pyc-in-parallel.patch
>>> index b1bceac512..fee0f45219 100644
>>> ---
>>> a/meta/recipes-devtools/python/python3/0001-Makefile-do-not-compile-.pyc-in-parallel.patch
>>> +++
>>> b/meta/recipes-devtools/python/python3/0001-Makefile-do-not-compile-.pyc-in-parallel.patch
>>> @@ -1,4 +1,4 @@
>>> -From c501e121a872cbcef8ffe626c1de173a125be9f8 Mon Sep 17 00:00:00 2001
>>> +From 04b5cbff2126339417763f908c89eba076e60c4e Mon Sep 17 00:00:00 2001
>>>  From: Alexander Kanavin <alex.kanavin@gmail.com>
>>>  Date: Thu, 16 Jan 2020 12:34:20 +0100
>>>  Subject: [PATCH] Makefile: do not compile .pyc in parallel
>>> @@ -11,15 +11,16 @@
>>> https://github.com/python/cpython/commit/1a2dd82f56bd813aacc570e172cefe55a8a4150
>>>
>>>  Upstream-Status: Pending
>>>  Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
>>> +
>>>  ---
>>>   Makefile.pre.in | 12 ++++++------
>>>   1 file changed, 6 insertions(+), 6 deletions(-)
>>>
>>>  diff --git a/Makefile.pre.in b/Makefile.pre.in
>>> -index 1241112..5dfdf44 100644
>>> +index 09763f5..59b95be 100644
>>>  --- a/Makefile.pre.in
>>>  +++ b/Makefile.pre.in
>>> -@@ -1457,30 +1457,30 @@ libinstall:    build_all
>>> $(srcdir)/Modules/xxmodule.c
>>> +@@ -1529,30 +1529,30 @@ libinstall:    build_all
>>> $(srcdir)/Modules/xxmodule.c
>>>         fi
>>>         -PYTHONPATH=$(DESTDIR)$(LIBDEST)  $(RUNSHARED) \
>>>                 $(PYTHON_FOR_BUILD) -Wi
>>> $(DESTDIR)$(LIBDEST)/compileall.py \
>>> diff --git
>>> a/meta/recipes-devtools/python/python3/0001-Makefile-fix-Issue36464-parallel-build-race-problem.patch
>>> b/meta/recipes-devtools/python/python3/0001-Makefile-fix-Issue36464-parallel-build-race-problem.patch
>>> index 237645bc60..bdce71f1c4 100644
>>> ---
>>> a/meta/recipes-devtools/python/python3/0001-Makefile-fix-Issue36464-parallel-build-race-problem.patch
>>> +++
>>> b/meta/recipes-devtools/python/python3/0001-Makefile-fix-Issue36464-parallel-build-race-problem.patch
>>> @@ -1,4 +1,4 @@
>>> -From 840fda32c82550259d02a7a56a78a9c05162b1a1 Mon Sep 17 00:00:00 2001
>>> +From 8da4539c32ba0eb36aae65a5cbd0a71082764ca9 Mon Sep 17 00:00:00 2001
>>>  From: Changqing Li <changqing.li@windriver.com>
>>>  Date: Wed, 8 May 2019 16:10:29 +0800
>>>  Subject: [PATCH] Makefile: fix Issue36464 (parallel build race problem)
>>> @@ -12,15 +12,16 @@ exists in the libainstall target.
>>>  Upstream-Status: Submitted [
>>> https://github.com/python/cpython/pull/13186]
>>>
>>>  Signed-off-by: Changqing Li <changqing.li@windriver.com>
>>> +
>>>  ---
>>>   Makefile.pre.in | 2 +-
>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>>  diff --git a/Makefile.pre.in b/Makefile.pre.in
>>> -index 15f3687..7e9f173 100644
>>> +index a87fe82..09763f5 100644
>>>  --- a/Makefile.pre.in
>>>  +++ b/Makefile.pre.in
>>> -@@ -1456,7 +1456,7 @@ LIBPL=           @LIBPL@
>>> +@@ -1618,7 +1618,7 @@ LIBPL=           @LIBPL@
>>>   LIBPC=                $(LIBDIR)/pkgconfig
>>>
>>>   libainstall:  @DEF_MAKE_RULE@ python-config
>>> @@ -29,6 +30,3 @@ index 15f3687..7e9f173 100644
>>>         do \
>>>                 if test ! -d $(DESTDIR)$$i; then \
>>>                         echo "Creating directory $$i"; \
>>> ---
>>> -2.7.4
>>> -
>>> diff --git
>>> a/meta/recipes-devtools/python/python3/0001-Makefile.pre-use-qemu-wrapper-when-gathering-profile.patch
>>> b/meta/recipes-devtools/python/python3/0001-Makefile.pre-use-qemu-wrapper-when-gathering-profile.patch
>>> index fa7735ff93..5eb356ac6c 100644
>>> ---
>>> a/meta/recipes-devtools/python/python3/0001-Makefile.pre-use-qemu-wrapper-when-gathering-profile.patch
>>> +++
>>> b/meta/recipes-devtools/python/python3/0001-Makefile.pre-use-qemu-wrapper-when-gathering-profile.patch
>>> @@ -1,19 +1,20 @@
>>> -From cf6a9100902484e4d028ee88742dd2487b014a98 Mon Sep 17 00:00:00 2001
>>> +From f1f29d96b3d270656feb85bcc00ca29c27d8b77f Mon Sep 17 00:00:00 2001
>>>  From: Alexander Kanavin <alex.kanavin@gmail.com>
>>>  Date: Wed, 30 Jan 2019 12:41:04 +0100
>>>  Subject: [PATCH] Makefile.pre: use qemu wrapper when gathering profile
>>> data
>>>
>>>  Upstream-Status: Inappropriate [oe-core specific]
>>>  Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
>>> +
>>>  ---
>>>   Makefile.pre.in | 3 +--
>>>   1 file changed, 1 insertion(+), 2 deletions(-)
>>>
>>>  diff --git a/Makefile.pre.in b/Makefile.pre.in
>>> -index a3a02a7..d5503dd 100644
>>> +index 5259754..a87fe82 100644
>>>  --- a/Makefile.pre.in
>>>  +++ b/Makefile.pre.in
>>> -@@ -507,8 +507,7 @@ build_all_generate_profile:
>>> +@@ -519,8 +519,7 @@ build_all_generate_profile:
>>>         $(MAKE) @DEF_MAKE_RULE@ CFLAGS_NODIST="$(CFLAGS_NODIST)
>>> $(PGO_PROF_GEN_FLAG)" LDFLAGS_NODIST="$(LDFLAGS_NODIST)
>>> $(PGO_PROF_GEN_FLAG)" LIBS="$(LIBS)"
>>>
>>>   run_profile_task:
>>> diff --git
>>> a/meta/recipes-devtools/python/python3/0001-Use-FLAG_REF-always-for-interned-strings.patch
>>> b/meta/recipes-devtools/python/python3/0001-Use-FLAG_REF-always-for-interned-strings.patch
>>> index 957839bf3e..5a49fff696 100644
>>> ---
>>> a/meta/recipes-devtools/python/python3/0001-Use-FLAG_REF-always-for-interned-strings.patch
>>> +++
>>> b/meta/recipes-devtools/python/python3/0001-Use-FLAG_REF-always-for-interned-strings.patch
>>> @@ -1,19 +1,20 @@
>>> -From 6c8ea7c1dacd42f3ba00440231ec0e6b1a38300d Mon Sep 17 00:00:00 2001
>>> +From 12d895a9a0c03dd872727434921118016176f561 Mon Sep 17 00:00:00 2001
>>>  From: Inada Naoki <songofacandy@gmail.com>
>>>  Date: Sat, 14 Jul 2018 00:46:11 +0900
>>>  Subject: [PATCH] Use FLAG_REF always for interned strings
>>>
>>>  Upstream-Status: Submitted [https://github.com/python/cpython/pull/8226
>>> ]
>>>  Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
>>> +
>>>  ---
>>>   Python/marshal.c | 9 +++++++--
>>>   1 file changed, 7 insertions(+), 2 deletions(-)
>>>
>>>  diff --git a/Python/marshal.c b/Python/marshal.c
>>> -index 6d06266c6a..51db2e3b2e 100644
>>> +index c4538bd..2437160 100644
>>>  --- a/Python/marshal.c
>>>  +++ b/Python/marshal.c
>>> -@@ -275,9 +275,14 @@ w_ref(PyObject *v, char *flag, WFILE *p)
>>> +@@ -298,9 +298,14 @@ w_ref(PyObject *v, char *flag, WFILE *p)
>>>       if (p->version < 3 || p->hashtable == NULL)
>>>           return 0; /* not writing object references */
>>>
>>> @@ -28,8 +29,5 @@ index 6d06266c6a..51db2e3b2e 100644
>>>           return 0;
>>>  +    }
>>>
>>> -     entry = _Py_HASHTABLE_GET_ENTRY(p->hashtable, v);
>>> +     entry = _Py_hashtable_get_entry(p->hashtable, v);
>>>       if (entry != NULL) {
>>> ---
>>> -2.21.0
>>> -
>>> diff --git
>>> a/meta/recipes-devtools/python/python3/0001-bpo-36852-proper-detection-of-mips-architecture-for-.patch
>>> b/meta/recipes-devtools/python/python3/0001-bpo-36852-proper-detection-of-mips-architecture-for-.patch
>>> index c4fae09a5b..e8dc18277a 100644
>>> ---
>>> a/meta/recipes-devtools/python/python3/0001-bpo-36852-proper-detection-of-mips-architecture-for-.patch
>>> +++
>>> b/meta/recipes-devtools/python/python3/0001-bpo-36852-proper-detection-of-mips-architecture-for-.patch
>>> @@ -1,4 +1,4 @@
>>> -From 1ad771d86728ee2ed30e202e9768d8d825f96467 Mon Sep 17 00:00:00 2001
>>> +From 405703bc48271d7280c0281897d0e6a9752bbccc Mon Sep 17 00:00:00 2001
>>>  From: Matthias Schoepfer <matthias.schoepfer@ithinx.io>
>>>  Date: Fri, 31 May 2019 15:34:34 +0200
>>>  Subject: [PATCH] bpo-36852: proper detection of mips architecture for
>>> soft
>>> @@ -13,16 +13,16 @@ to do this in a more autoconf/autotools manner.
>>>  Upstream-Status: Submitted [
>>> https://github.com/python/cpython/pull/13196]
>>>  Signed-off-by: Matthias Schoepfer <matthias.schoepfer@ithinx.io>
>>>
>>> -%% original patch:
>>> 0001-bpo-36852-proper-detection-of-mips-architecture-for-.patch
>>> +
>>>  ---
>>>   configure.ac | 175 +++++++--------------------------------------------
>>>   1 file changed, 21 insertions(+), 154 deletions(-)
>>>
>>>  diff --git a/configure.ac b/configure.ac
>>> -index ede710e..bc81b0b 100644
>>> +index e491e24..784850b 100644
>>>  --- a/configure.ac
>>>  +++ b/configure.ac
>>> -@@ -710,160 +710,27 @@ fi
>>> +@@ -722,160 +722,27 @@ fi
>>>   MULTIARCH=$($CC --print-multiarch 2>/dev/null)
>>>   AC_SUBST(MULTIARCH)
>>>
>>> @@ -204,6 +204,3 @@ index ede710e..bc81b0b 100644
>>>
>>>   if test x$PLATFORM_TRIPLET != x && test x$MULTIARCH != x; then
>>>     if test x$PLATFORM_TRIPLET != x$MULTIARCH; then
>>> ---
>>> -2.24.1
>>> -
>>> diff --git
>>> a/meta/recipes-devtools/python/python3/0001-configure.ac-fix-LIBPL.patch
>>> b/meta/recipes-devtools/python/python3/0001-configure.ac-fix-LIBPL.patch
>>> deleted file mode 100644
>>> index 123ce3a2dc..0000000000
>>> ---
>>> a/meta/recipes-devtools/python/python3/0001-configure.ac-fix-LIBPL.patch
>>> +++ /dev/null
>>> @@ -1,35 +0,0 @@
>>> -From acce3d441e7eadadd2d3ce38654155dc43f1f607 Mon Sep 17 00:00:00 2001
>>> -From: Changqing Li <changqing.li@windriver.com>
>>> -Date: Fri, 7 Feb 2020 09:36:25 +0800
>>> -Subject: [PATCH] configure.ac: fix LIBPL
>>> -
>>> -Use LIBDIR rather than prefix/lib, so that it would work when lib64.
>>> -
>>> -Upstream-Status: Inappropriate [oe-core specific]
>>> -
>>> -Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
>>> -Signed-off-by: Li Zhou <li.zhou@windriver.c>
>>> -Signed-off-by: Changqing Li <changqing.li@windriver.com>
>>> ----
>>> - configure.ac | 4 ++--
>>> - 1 file changed, 2 insertions(+), 2 deletions(-)
>>> -
>>> -diff --git a/configure.ac b/configure.ac
>>> -index ce04258..915f475 100644
>>> ---- a/configure.ac
>>> -+++ b/configure.ac
>>> -@@ -4532,9 +4532,9 @@ fi
>>> - dnl define LIBPL after ABIFLAGS and LDVERSION is defined.
>>> - AC_SUBST(PY_ENABLE_SHARED)
>>> - if test x$PLATFORM_TRIPLET = x; then
>>> --  LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}"
>>> -+  LIBPL='$(LIBDIR)'"/python${VERSION}/config-${LDVERSION}"
>>> - else
>>> --
>>> LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}-${PLATFORM_TRIPLET}"
>>> -+
>>> LIBPL='$(LIBDIR)'"/python${VERSION}/config-${LDVERSION}-${PLATFORM_TRIPLET}"
>>> - fi
>>> - AC_SUBST(LIBPL)
>>> -
>>> ---
>>> -2.7.4
>>> -
>>> diff --git
>>> a/meta/recipes-devtools/python/python3/0001-distutils-sysconfig-append-STAGING_LIBDIR-python-sys.patch
>>> b/meta/recipes-devtools/python/python3/0001-distutils-sysconfig-append-STAGING_LIBDIR-python-sys.patch
>>> index 2b68c0acc2..d8a296236f 100644
>>> ---
>>> a/meta/recipes-devtools/python/python3/0001-distutils-sysconfig-append-STAGING_LIBDIR-python-sys.patch
>>> +++
>>> b/meta/recipes-devtools/python/python3/0001-distutils-sysconfig-append-STAGING_LIBDIR-python-sys.patch
>>> @@ -1,4 +1,4 @@
>>> -From bc59d49efff41051034d7fbf5d0c8505e4c3134b Mon Sep 17 00:00:00 2001
>>> +From 5e3b6807b59ad9dbae0727b75a0e603f474d6451 Mon Sep 17 00:00:00 2001
>>>  From: Alexander Kanavin <alex.kanavin@gmail.com>
>>>  Date: Thu, 31 Jan 2019 16:46:30 +0100
>>>  Subject: [PATCH] distutils/sysconfig: append
>>> @@ -15,10 +15,10 @@ Signed-off-by: Alexander Kanavin <
>>> alex.kanavin@gmail.com>
>>>   2 files changed, 4 insertions(+)
>>>
>>>  diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
>>> -index b51629e..2df348c 100644
>>> +index 37feae5..4774e12 100644
>>>  --- a/Lib/distutils/sysconfig.py
>>>  +++ b/Lib/distutils/sysconfig.py
>>> -@@ -438,6 +438,8 @@ def _init_posix():
>>> +@@ -444,6 +444,8 @@ def _init_posix():
>>>           platform=sys.platform,
>>>           multiarch=getattr(sys.implementation, '_multiarch', ''),
>>>       ))
>>> @@ -28,10 +28,10 @@ index b51629e..2df348c 100644
>>>       build_time_vars = _temp.build_time_vars
>>>       global _config_vars
>>>  diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py
>>> -index b2d790b..405273c 100644
>>> +index bf04ac5..010f9ef 100644
>>>  --- a/Lib/sysconfig.py
>>>  +++ b/Lib/sysconfig.py
>>> -@@ -419,6 +419,8 @@ def _init_posix(vars):
>>> +@@ -417,6 +417,8 @@ def _init_posix(vars):
>>>       """Initialize the module as appropriate for POSIX systems."""
>>>       # _sysconfigdata is generated at build time, see
>>> _generate_posix_vars()
>>>       name = _get_sysconfigdata_name()
>>> diff --git
>>> a/meta/recipes-devtools/python/python3/0001-python3-Do-not-hardcode-lib-for-distutils.patch
>>> b/meta/recipes-devtools/python/python3/0001-python3-Do-not-hardcode-lib-for-distutils.patch
>>> deleted file mode 100644
>>> index fe031b9983..0000000000
>>> ---
>>> a/meta/recipes-devtools/python/python3/0001-python3-Do-not-hardcode-lib-for-distutils.patch
>>> +++ /dev/null
>>> @@ -1,43 +0,0 @@
>>> -From bb711b53f10d32a90a27ccf4b0dc51e4a701d862 Mon Sep 17 00:00:00 2001
>>> -From: Changqing Li <changqing.li@windriver.com>
>>> -Date: Fri, 7 Feb 2020 09:42:09 +0800
>>> -Subject: [PATCH] python3: Do not hardcode "lib" for distutils
>>> -
>>> -Get the sys.lib from python3 itself and do not use
>>> -hardcoded value of 'lib' for distutils.
>>> -
>>> -Upstream-Status: Inappropriate [oe-core specific]
>>> -
>>> -Signed-off-by: Li Zhou <li.zhou@windriver.com>
>>> -Signed-off-by: Changqing Li <changqing.li@windriver.com>
>>> ----
>>> - Lib/distutils/command/install.py | 6 ++++--
>>> - 1 file changed, 4 insertions(+), 2 deletions(-)
>>> -
>>> -diff --git a/Lib/distutils/command/install.py
>>> b/Lib/distutils/command/install.py
>>> -index c625c95..8e32f54 100644
>>> ---- a/Lib/distutils/command/install.py
>>> -+++ b/Lib/distutils/command/install.py
>>> -@@ -19,6 +19,8 @@ from site import USER_BASE
>>> - from site import USER_SITE
>>> - HAS_USER_SITE = True
>>> -
>>> -+libname = sys.lib
>>> -+
>>> - WINDOWS_SCHEME = {
>>> -     'purelib': '$base/Lib/site-packages',
>>> -     'platlib': '$base/Lib/site-packages',
>>> -@@ -29,8 +31,8 @@ WINDOWS_SCHEME = {
>>> -
>>> - INSTALL_SCHEMES = {
>>> -     'unix_prefix': {
>>> --        'purelib': '$base/lib/python$py_version_short/site-packages',
>>> --        'platlib':
>>> '$platbase/lib/python$py_version_short/site-packages',
>>> -+        'purelib': '$base/' + libname +
>>> '/python$py_version_short/site-packages',
>>> -+        'platlib': '$platbase/' + libname +
>>> '/python$py_version_short/site-packages',
>>> -         'headers':
>>> '$base/include/python$py_version_short$abiflags/$dist_name',
>>> -         'scripts': '$base/bin',
>>> -         'data'   : '$base',
>>> ---
>>> -2.7.4
>>> -
>>> diff --git
>>> a/meta/recipes-devtools/python/python3/0001-python3-use-cc_basename-to-replace-CC-for-checking-c.patch
>>> b/meta/recipes-devtools/python/python3/0001-python3-use-cc_basename-to-replace-CC-for-checking-c.patch
>>> index fb10ca94b3..4c182d2f9e 100644
>>> ---
>>> a/meta/recipes-devtools/python/python3/0001-python3-use-cc_basename-to-replace-CC-for-checking-c.patch
>>> +++
>>> b/meta/recipes-devtools/python/python3/0001-python3-use-cc_basename-to-replace-CC-for-checking-c.patch
>>> @@ -1,4 +1,4 @@
>>> -From 994783da5c21cab81b6589ed2d4275e665a946f9 Mon Sep 17 00:00:00 2001
>>> +From a1a529f61464a222ed0391e422a5824601178fc5 Mon Sep 17 00:00:00 2001
>>>  From: Changqing Li <changqing.li@windriver.com>
>>>  Date: Mon, 22 Oct 2018 15:19:51 +0800
>>>  Subject: [PATCH] python3: use cc_basename to replace CC for checking
>>> compiler
>>> @@ -27,7 +27,7 @@ Signed-off-by: Changqing Li <
>>> changqing.li@windriver.com>
>>>   1 file changed, 10 insertions(+), 9 deletions(-)
>>>
>>>  diff --git a/configure.ac b/configure.ac
>>> -index a189d42..0f85486 100644
>>> +index d60f052..e491e24 100644
>>>  --- a/configure.ac
>>>  +++ b/configure.ac
>>>  @@ -54,6 +54,7 @@ AC_CONFIG_HEADER(pyconfig.h)
>>> @@ -38,7 +38,7 @@ index a189d42..0f85486 100644
>>>
>>>   # pybuilddir.txt will be created by --generate-posix-vars in the
>>> Makefile
>>>   rm -f pybuilddir.txt
>>> -@@ -671,7 +672,7 @@ AC_MSG_RESULT($with_cxx_main)
>>> +@@ -689,7 +690,7 @@ AC_MSG_RESULT($with_cxx_main)
>>>   preset_cxx="$CXX"
>>>   if test -z "$CXX"
>>>   then
>>> @@ -47,7 +47,7 @@ index a189d42..0f85486 100644
>>>           gcc)    AC_PATH_TOOL(CXX, [g++], [g++], [notfound]) ;;
>>>           cc)     AC_PATH_TOOL(CXX, [c++], [c++], [notfound]) ;;
>>>           clang|*/clang)     AC_PATH_TOOL(CXX, [clang++], [clang++],
>>> [notfound]) ;;
>>> -@@ -957,7 +958,7 @@ rmdir CaseSensitiveTestDir
>>> +@@ -975,7 +976,7 @@ rmdir CaseSensitiveTestDir
>>>
>>>   case $ac_sys_system in
>>>   hp*|HP*)
>>> @@ -56,7 +56,7 @@ index a189d42..0f85486 100644
>>>       cc|*/cc) CC="$CC -Ae";;
>>>       esac;;
>>>   esac
>>> -@@ -1335,7 +1336,7 @@ else
>>> +@@ -1366,7 +1367,7 @@ else
>>>   fi],
>>>   [AC_MSG_RESULT(no)])
>>>   if test "$Py_LTO" = 'true' ; then
>>> @@ -65,7 +65,7 @@ index a189d42..0f85486 100644
>>>       *clang*)
>>>         AC_SUBST(LLVM_AR)
>>>         AC_PATH_TOOL(LLVM_AR, llvm-ar, '', ${llvm_path})
>>> -@@ -1425,7 +1426,7 @@ then
>>> +@@ -1456,7 +1457,7 @@ then
>>>     fi
>>>   fi
>>>   LLVM_PROF_ERR=no
>>> @@ -74,7 +74,7 @@ index a189d42..0f85486 100644
>>>     *clang*)
>>>       # Any changes made here should be reflected in the GCC+Darwin case
>>> below
>>>       PGO_PROF_GEN_FLAG="-fprofile-instr-generate"
>>> -@@ -1486,7 +1487,7 @@ esac
>>> +@@ -1517,7 +1518,7 @@ esac
>>>   # compiler and platform.  BASECFLAGS tweaks need to be made even if the
>>>   # user set OPT.
>>>
>>> @@ -83,7 +83,7 @@ index a189d42..0f85486 100644
>>>       *clang*)
>>>           cc_is_clang=1
>>>           ;;
>>> -@@ -1622,7 +1623,7 @@ yes)
>>> +@@ -1653,7 +1654,7 @@ yes)
>>>
>>>       # ICC doesn't recognize the option, but only emits a warning
>>>       ## XXX does it emit an unused result warning and can it be
>>> disabled?
>>> @@ -92,16 +92,16 @@ index a189d42..0f85486 100644
>>>       *icc*)
>>>       ac_cv_disable_unused_result_warning=no
>>>       ;;
>>> -@@ -1943,7 +1944,7 @@ yes)
>>> +@@ -1993,7 +1994,7 @@ yes)
>>> +     ;;
>>>   esac
>>>
>>> - # ICC needs -fp-model strict or floats behave badly
>>>  -case "$CC" in
>>>  +case "$cc_basename" in
>>>   *icc*)
>>> +     # ICC needs -fp-model strict or floats behave badly
>>>       CFLAGS_NODIST="$CFLAGS_NODIST -fp-model strict"
>>> -     ;;
>>> -@@ -2711,7 +2712,7 @@ then
>>> +@@ -2765,7 +2766,7 @@ then
>>>                 then
>>>                         LINKFORSHARED="-Wl,--export-dynamic"
>>>                 fi;;
>>> @@ -110,7 +110,7 @@ index a189d42..0f85486 100644
>>>                   *gcc*)
>>>                     if $CC -Xlinker --help 2>&1 | grep export-dynamic
>>> >/dev/null
>>>                     then
>>> -@@ -5362,7 +5363,7 @@ if test "$have_gcc_asm_for_x87" = yes; then
>>> +@@ -5507,7 +5508,7 @@ if test "$have_gcc_asm_for_x87" = yes; then
>>>       # Some versions of gcc miscompile inline asm:
>>>       # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46491
>>>       # http://gcc.gnu.org/ml/gcc/2010-11/msg00366.html
>>> diff --git
>>> a/meta/recipes-devtools/python/python3/0001-setup.py-pass-missing-libraries-to-Extension-for-mul.patch
>>> b/meta/recipes-devtools/python/python3/0001-setup.py-pass-missing-libraries-to-Extension-for-mul.patch
>>> index ea0af02e72..7ca6753172 100644
>>> ---
>>> a/meta/recipes-devtools/python/python3/0001-setup.py-pass-missing-libraries-to-Extension-for-mul.patch
>>> +++
>>> b/meta/recipes-devtools/python/python3/0001-setup.py-pass-missing-libraries-to-Extension-for-mul.patch
>>> @@ -1,4 +1,4 @@
>>> -From 7019ba184b828ed7253750cf409fc5760ef90a54 Mon Sep 17 00:00:00 2001
>>> +From 1bf39bd881a73fd0b9564b46c9e5a126f8483b3d Mon Sep 17 00:00:00 2001
>>>  From: Alexander Kanavin <alex.kanavin@gmail.com>
>>>  Date: Thu, 9 Jan 2020 17:44:05 +0100
>>>  Subject: [PATCH] setup.py: pass missing libraries to Extension for
>>> @@ -50,15 +50,16 @@ Upstream-Status: Pending
>>>
>>>  Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
>>>  Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
>>> +
>>>  ---
>>>   setup.py | 2 +-
>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>>  diff --git a/setup.py b/setup.py
>>> -index ec3f2a4..b0f1541 100644
>>> +index 8cf058c..9c1c33b 100644
>>>  --- a/setup.py
>>>  +++ b/setup.py
>>> -@@ -1671,7 +1671,7 @@ class PyBuildExt(build_ext):
>>> +@@ -1777,7 +1777,7 @@ class PyBuildExt(build_ext):
>>>                                      libraries=libs,
>>>
>>>  include_dirs=["Modules/_multiprocessing"]))
>>>
>>> diff --git
>>> a/meta/recipes-devtools/python/python3/0001-test_locale.py-correct-the-test-output-format.patch
>>> b/meta/recipes-devtools/python/python3/0001-test_locale.py-correct-the-test-output-format.patch
>>> index 35b7e0c480..bd5f406708 100644
>>> ---
>>> a/meta/recipes-devtools/python/python3/0001-test_locale.py-correct-the-test-output-format.patch
>>> +++
>>> b/meta/recipes-devtools/python/python3/0001-test_locale.py-correct-the-test-output-format.patch
>>> @@ -1,4 +1,4 @@
>>> -From b94995e0c694ec9561efec0d1a59b323340e6105 Mon Sep 17 00:00:00 2001
>>> +From b2d5ab7c71741bbf27ec4690243244a4de72cfc0 Mon Sep 17 00:00:00 2001
>>>  From: Mingli Yu <mingli.yu@windriver.com>
>>>  Date: Mon, 5 Aug 2019 15:57:39 +0800
>>>  Subject: [PATCH] test_locale.py: correct the test output format
>>> @@ -24,15 +24,16 @@ Before this patch:
>>>  Upstream-Status: Submitted [
>>> https://github.com/python/cpython/pull/15132]
>>>
>>>  Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
>>> +
>>>  ---
>>>   Lib/test/test_locale.py | 2 +-
>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>>  diff --git a/Lib/test/test_locale.py b/Lib/test/test_locale.py
>>> -index e2c2178..558d63c 100644
>>> +index 2863d20..2ed141c 100644
>>>  --- a/Lib/test/test_locale.py
>>>  +++ b/Lib/test/test_locale.py
>>> -@@ -527,7 +527,7 @@ class TestMiscellaneous(unittest.TestCase):
>>> +@@ -562,7 +562,7 @@ class TestMiscellaneous(unittest.TestCase):
>>>               self.skipTest('test needs Turkish locale')
>>>           loc = locale.getlocale(locale.LC_CTYPE)
>>>           if verbose:
>>> @@ -41,6 +42,3 @@ index e2c2178..558d63c 100644
>>>           locale.setlocale(locale.LC_CTYPE, loc)
>>>           self.assertEqual(loc, locale.getlocale(locale.LC_CTYPE))
>>>
>>> ---
>>> -2.7.4
>>> -
>>> diff --git
>>> a/meta/recipes-devtools/python/python3/0017-setup.py-do-not-report-missing-dependencies-for-disa.patch
>>> b/meta/recipes-devtools/python/python3/0017-setup.py-do-not-report-missing-dependencies-for-disa.patch
>>> index 4bd98f62fd..d0ff3219a6 100644
>>> ---
>>> a/meta/recipes-devtools/python/python3/0017-setup.py-do-not-report-missing-dependencies-for-disa.patch
>>> +++
>>> b/meta/recipes-devtools/python/python3/0017-setup.py-do-not-report-missing-dependencies-for-disa.patch
>>> @@ -1,4 +1,4 @@
>>> -From a2dd127b4163aff6cc35af0d0251321964232ad4 Mon Sep 17 00:00:00 2001
>>> +From 5d85a94fd0965aa26adf593b5f84948e9c502121 Mon Sep 17 00:00:00 2001
>>>  From: Alexander Kanavin <alex.kanavin@gmail.com>
>>>  Date: Mon, 7 Oct 2019 13:22:14 +0200
>>>  Subject: [PATCH] setup.py: do not report missing dependencies for
>>> disabled
>>> @@ -11,20 +11,24 @@ build completeness checker which relies on the
>>> report.
>>>  Upstream-Status: Inappropriate [oe-core specific]
>>>  Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
>>>
>>> +Rebased for 3.9 [10/2020]
>>> +Signed-off-by: Alejandro Enedino Hernandez Samaniego <
>>> alejandro.hernandez@linux.microsoft.com>
>>> +
>>>  ---
>>> - setup.py | 4 ++++
>>> - 1 file changed, 4 insertions(+)
>>> + setup.py | 5 +++++
>>> + 1 file changed, 5 insertions(+)
>>>
>>>  diff --git a/setup.py b/setup.py
>>> -index 7691258..ec3f2a4 100644
>>> +index ab9fb8e..8cf058c 100644
>>>  --- a/setup.py
>>>  +++ b/setup.py
>>> -@@ -408,6 +408,10 @@ class PyBuildExt(build_ext):
>>> +@@ -495,6 +495,11 @@ class PyBuildExt(build_ext):
>>>                   print("%-*s   %-*s   %-*s" % (longest, e, longest, f,
>>>                                                 longest, g))
>>>
>>>  +        # There is no need to report missing module dependencies,
>>>  +        # if the modules have been disabled in the first place.
>>> ++        sysconf_dis =
>>> sysconfig.get_config_var('MODDISABLED_NAMES').split()
>>>  +        self.missing = list(set(self.missing) - set(sysconf_dis))
>>>  +
>>>           if self.missing:
>>> diff --git
>>> a/meta/recipes-devtools/python/python3/0020-configure.ac-setup.py-do-not-add-a-curses-include-pa.patch
>>> b/meta/recipes-devtools/python/python3/0020-configure.ac-setup.py-do-not-add-a-curses-include-pa.patch
>>> index e04a91605c..daa133e1e0 100644
>>> ---
>>> a/meta/recipes-devtools/python/python3/0020-configure.ac-setup.py-do-not-add-a-curses-include-pa.patch
>>> +++
>>> b/meta/recipes-devtools/python/python3/0020-configure.ac-setup.py-do-not-add-a-curses-include-pa.patch
>>> @@ -1,4 +1,4 @@
>>> -From 863c09f640a5dfd33ff22915b0d5fee7bc5df70a Mon Sep 17 00:00:00 2001
>>> +From 5e75ab6ff0e5714684d71a3e75d389cdc1c2e783 Mon Sep 17 00:00:00 2001
>>>  From: Alexander Kanavin <alex.kanavin@gmail.com>
>>>  Date: Sun, 16 Feb 2020 17:50:25 +0100
>>>  Subject: [PATCH] configure.ac, setup.py: do not add a curses include
>>> path from
>>> @@ -11,16 +11,17 @@ as dnf failures).
>>>
>>>  Upstream-Status: Inappropriate [oe-core specific]
>>>  Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
>>> +
>>>  ---
>>>   configure.ac | 6 ------
>>>   setup.py     | 2 --
>>>   2 files changed, 8 deletions(-)
>>>
>>>  diff --git a/configure.ac b/configure.ac
>>> -index 915f475..c911011 100644
>>> +index 01ea772..7ee38f6 100644
>>>  --- a/configure.ac
>>>  +++ b/configure.ac
>>> -@@ -4828,12 +4828,6 @@ then
>>> +@@ -4977,12 +4977,6 @@ then
>>>     [Define if you have struct stat.st_mtimensec])
>>>   fi
>>>
>>> @@ -34,10 +35,10 @@ index 915f475..c911011 100644
>>>
>>>   # On Solaris, term.h requires curses.h
>>>  diff --git a/setup.py b/setup.py
>>> -index b0f1541..7208cd0 100644
>>> +index 9c1c33b..a456e53 100644
>>>  --- a/setup.py
>>>  +++ b/setup.py
>>> -@@ -973,8 +973,6 @@ class PyBuildExt(build_ext):
>>> +@@ -1075,8 +1075,6 @@ class PyBuildExt(build_ext):
>>>           panel_library = 'panel'
>>>           if curses_library == 'ncursesw':
>>>               curses_defines.append(('HAVE_NCURSESW', '1'))
>>> diff --git
>>> a/meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch
>>> b/meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch
>>> index 820fb98ed8..bacdfba5ef 100644
>>> ---
>>> a/meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch
>>> +++
>>> b/meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch
>>> @@ -1,4 +1,4 @@
>>> -From 064187668fcbefdd39a8cde372bf651124c3e578 Mon Sep 17 00:00:00 2001
>>> +From a05f77261dbabea29d05c249bfc2d8632e550b6a Mon Sep 17 00:00:00 2001
>>>  From: Khem Raj <raj.khem@gmail.com>
>>>  Date: Tue, 14 May 2013 15:00:26 -0700
>>>  Subject: [PATCH] python3: Add target and native recipes
>>> @@ -6,6 +6,7 @@ Subject: [PATCH] python3: Add target and native recipes
>>>  Upstream-Status: Inappropriate [embedded specific]
>>>
>>>  02/2015 Rebased for Python 3.4.2
>>> +10/2020 Rebased for Python 3.9.0
>>>
>>>  # The proper prefix is inside our staging area.
>>>  # Signed-Off: Michael 'Mickey' Lauer <mickey@vanille-media.de>
>>> @@ -18,10 +19,10 @@ Upstream-Status: Inappropriate [embedded specific]
>>>   1 file changed, 11 insertions(+), 3 deletions(-)
>>>
>>>  diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
>>> -index 2df348c..4f8db84 100644
>>> +index 4774e12..5468239 100644
>>>  --- a/Lib/distutils/sysconfig.py
>>>  +++ b/Lib/distutils/sysconfig.py
>>> -@@ -96,7 +96,9 @@ def get_python_inc(plat_specific=0, prefix=None):
>>> +@@ -95,7 +95,9 @@ def get_python_inc(plat_specific=0, prefix=None):
>>>       If 'prefix' is supplied, use it instead of sys.base_prefix or
>>>       sys.base_exec_prefix -- i.e., ignore 'plat_specific'.
>>>       """
>>> @@ -32,7 +33,7 @@ index 2df348c..4f8db84 100644
>>>           prefix = plat_specific and BASE_EXEC_PREFIX or BASE_PREFIX
>>>       if os.name == "posix":
>>>           if python_build:
>>> -@@ -139,7 +141,13 @@ def get_python_lib(plat_specific=0,
>>> standard_lib=0, prefix=None):
>>> +@@ -138,7 +140,13 @@ def get_python_lib(plat_specific=0,
>>> standard_lib=0, prefix=None):
>>>       If 'prefix' is supplied, use it instead of sys.base_prefix or
>>>       sys.base_exec_prefix -- i.e., ignore 'plat_specific'.
>>>       """
>>> @@ -47,12 +48,12 @@ index 2df348c..4f8db84 100644
>>>           if standard_lib:
>>>               prefix = plat_specific and BASE_EXEC_PREFIX or BASE_PREFIX
>>>           else:
>>> -@@ -147,7 +155,7 @@ def get_python_lib(plat_specific=0, standard_lib=0,
>>> prefix=None):
>>> -
>>> -     if os.name == "posix":
>>> -         libpython = os.path.join(prefix,
>>> --                                 "lib", "python" +
>>> get_python_version())
>>> -+                                 lib_basename, "python" +
>>> get_python_version())
>>> -         if standard_lib:
>>> -             return libpython
>>> +@@ -151,7 +159,7 @@ def get_python_lib(plat_specific=0, standard_lib=0,
>>> prefix=None):
>>> +             libdir = sys.platlibdir
>>>           else:
>>> +             # Pure Python
>>> +-            libdir = "lib"
>>> ++            libdir = "lib_basename"
>>> +         libpython = os.path.join(prefix, libdir,
>>> +                                  "python" + get_python_version())
>>> +         if standard_lib:
>>> diff --git
>>> a/meta/recipes-devtools/python/python3/avoid_warning_about_tkinter.patch
>>> b/meta/recipes-devtools/python/python3/avoid_warning_about_tkinter.patch
>>> index 184540e794..4dfa639669 100644
>>> ---
>>> a/meta/recipes-devtools/python/python3/avoid_warning_about_tkinter.patch
>>> +++
>>> b/meta/recipes-devtools/python/python3/avoid_warning_about_tkinter.patch
>>> @@ -1,4 +1,4 @@
>>> -From ba7202700578d435b07cfdfb7b57e83185752800 Mon Sep 17 00:00:00 2001
>>> +From f0653707a6a310bd059fe4dc3146052bb38b5d83 Mon Sep 17 00:00:00 2001
>>>  From: Andrei Gherzan <andrei@gherzan.ro>
>>>  Date: Mon, 28 Jan 2019 15:57:54 +0000
>>>  Subject: [PATCH] _tkinter module needs tk module along with tcl. tk is
>>> not yet
>>> @@ -15,10 +15,10 @@ Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
>>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>>
>>>  diff --git a/setup.py b/setup.py
>>> -index ab18ff0..7691258 100644
>>> +index d3ccc6c..ab9fb8e 100644
>>>  --- a/setup.py
>>>  +++ b/setup.py
>>> -@@ -1706,8 +1706,8 @@ class PyBuildExt(build_ext):
>>> +@@ -1811,8 +1811,8 @@ class PyBuildExt(build_ext):
>>>           self.detect_decimal()
>>>           self.detect_ctypes()
>>>           self.detect_multiprocessing()
>>> diff --git a/meta/recipes-devtools/python/python3/cgi_py.patch
>>> b/meta/recipes-devtools/python/python3/cgi_py.patch
>>> index 6c4ba54320..493fdf0ab8 100644
>>> --- a/meta/recipes-devtools/python/python3/cgi_py.patch
>>> +++ b/meta/recipes-devtools/python/python3/cgi_py.patch
>>> @@ -1,4 +1,4 @@
>>> -From 62336285cba38017b35cb761c03f0c7e80a671a3 Mon Sep 17 00:00:00 2001
>>> +From 5da956e20d53cfdb687b8b8c3c15cfe926961ada Mon Sep 17 00:00:00 2001
>>>  From: Mark Hatle <mark.hatle@windriver.com>
>>>  Date: Wed, 21 Sep 2011 20:55:33 -0500
>>>  Subject: [PATCH] Lib/cgi.py: Update the script as mentioned in the
>>> comment
>>> @@ -12,7 +12,7 @@ Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
>>>   1 file changed, 1 insertion(+), 10 deletions(-)
>>>
>>>  diff --git a/Lib/cgi.py b/Lib/cgi.py
>>> -index 8cf6687..094c7b4 100755
>>> +index 77ab703..3edaf60 100755
>>>  --- a/Lib/cgi.py
>>>  +++ b/Lib/cgi.py
>>>  @@ -1,13 +1,4 @@
>>> diff --git a/meta/recipes-devtools/python/python3/crosspythonpath.patch
>>> b/meta/recipes-devtools/python/python3/crosspythonpath.patch
>>> index d789ab57d4..f4c3b93782 100644
>>> --- a/meta/recipes-devtools/python/python3/crosspythonpath.patch
>>> +++ b/meta/recipes-devtools/python/python3/crosspythonpath.patch
>>> @@ -1,4 +1,8 @@
>>> -configure.ac: add CROSSPYTHONPATH into PYTHONPATH for PYTHON_FOR_BUILD
>>> +From 9dabb16c327211b8fb9327d06d66c7ef6baea4b2 Mon Sep 17 00:00:00 2001
>>> +From: Ricardo Ribalda <ricardo@ribalda.com>
>>> +Date: Tue, 18 Nov 2014 03:35:33 -0500
>>> +Subject: [PATCH] configure.ac: add CROSSPYTHONPATH into PYTHONPATH for
>>> + PYTHON_FOR_BUILD
>>>
>>>  When building x86->x86 the system will try to execute .so and related
>>> items
>>>  from the default PYTHONPATH.  This will fail if the target CPU contains
>>> @@ -10,8 +14,13 @@ Upstream-Status: Inappropriate [OE-Core integration
>>> specific]
>>>  Credits-to: Mark Hatle <mark.hatle@windriver.com>
>>>  Credits-to: Jackie Huang <jackie.huang@windriver.com>
>>>  Signed-off-by: Ricardo Ribalda <ricardo@ribalda.com>
>>> +
>>> +---
>>> + configure.ac | 2 +-
>>> + 1 file changed, 1 insertion(+), 1 deletion(-)
>>> +
>>>  diff --git a/configure.ac b/configure.ac
>>> -index 4ab19a6..7036a53 100644
>>> +index 784850b..01ea772 100644
>>>  --- a/configure.ac
>>>  +++ b/configure.ac
>>>  @@ -76,7 +76,7 @@ if test "$cross_compiling" = yes; then
>>> diff --git a/meta/recipes-devtools/python/python3/python-config.patch
>>> b/meta/recipes-devtools/python/python3/python-config.patch
>>> index c8a8f3d4aa..98b28bcbde 100644
>>> --- a/meta/recipes-devtools/python/python3/python-config.patch
>>> +++ b/meta/recipes-devtools/python/python3/python-config.patch
>>> @@ -1,4 +1,4 @@
>>> -From 07df0ae0d70cba6d1847fe1c24a71063930bec60 Mon Sep 17 00:00:00 2001
>>> +From bf238a78ec90671789c6498bede99928cb7244e5 Mon Sep 17 00:00:00 2001
>>>  From: Tyler Hall <tylerwhall@gmail.com>
>>>  Date: Sun, 4 May 2014 20:06:43 -0400
>>>  Subject: [PATCH] python-config: Revert to using distutils.sysconfig
>>> @@ -21,7 +21,7 @@ Signed-off-by: Tyler Hall <tylerwhall@gmail.com>
>>>   1 file changed, 5 insertions(+), 5 deletions(-)
>>>
>>>  diff --git a/Misc/python-config.in b/Misc/python-config.in
>>> -index 727c4a8..c702829 100644
>>> +index ebd99da..13e57ae 100644
>>>  --- a/Misc/python-config.in
>>>  +++ b/Misc/python-config.in
>>>  @@ -6,7 +6,7 @@
>>> @@ -37,11 +37,11 @@ index 727c4a8..c702829 100644
>>>
>>>   for opt in opt_flags:
>>>       if opt == '--prefix':
>>> --        print(sysconfig.get_config_var('prefix'))
>>> +-        print(getvar('prefix'))
>>>  +        print(sysconfig.PREFIX)
>>>
>>>       elif opt == '--exec-prefix':
>>> --        print(sysconfig.get_config_var('exec_prefix'))
>>> +-        print(getvar('exec_prefix'))
>>>  +        print(sysconfig.EXEC_PREFIX)
>>>
>>>       elif opt in ('--includes', '--cflags'):
>>> diff --git a/meta/recipes-devtools/python/python3_3.8.5.bb
>>> b/meta/recipes-devtools/python/python3_3.9.0.bb
>>> similarity index 95%
>>> rename from meta/recipes-devtools/python/python3_3.8.5.bb
>>> rename to meta/recipes-devtools/python/python3_3.9.0.bb
>>> index 2a3c52a116..bd1d40edce 100644
>>> --- a/meta/recipes-devtools/python/python3_3.8.5.bb
>>> +++ b/meta/recipes-devtools/python/python3_3.9.0.bb
>>> @@ -1,9 +1,9 @@
>>>  SUMMARY = "The Python Programming Language"
>>>  HOMEPAGE = "http://www.python.org"
>>> -LICENSE = "PSFv2"
>>> +LICENSE = "PSFv2 & BSD-0-Clause"
>>>  SECTION = "devel/python"
>>>
>>> -LIC_FILES_CHKSUM = "file://LICENSE;md5=203a6dbc802ee896020a47161e759642"
>>> +LIC_FILES_CHKSUM = "file://LICENSE;md5=33223c9ef60c31e3f0e866cb09b65e83"
>>>
>>>  SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz \
>>>             file://run-ptest \
>>> @@ -17,7 +17,6 @@ SRC_URI = "
>>> http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz \
>>>
>>> file://0001-Do-not-use-the-shell-version-of-python-config-that-w.patch \
>>>             file://python-config.patch \
>>>
>>> file://0001-Makefile.pre-use-qemu-wrapper-when-gathering-profile.patch \
>>> -
>>>  file://0001-Do-not-hardcode-lib-as-location-for-site-packages-an.patch \
>>>
>>> file://0001-python3-use-cc_basename-to-replace-CC-for-checking-c.patch \
>>>
>>> file://0001-Lib-sysconfig.py-fix-another-place-where-lib-is-hard.patch \
>>>
>>> file://0001-Makefile-fix-Issue36464-parallel-build-race-problem.patch \
>>> @@ -29,19 +28,17 @@ SRC_URI = "
>>> http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz \
>>>
>>> file://0017-setup.py-do-not-report-missing-dependencies-for-disa.patch \
>>>
>>> file://0001-setup.py-pass-missing-libraries-to-Extension-for-mul.patch \
>>>             file://0001-Makefile-do-not-compile-.pyc-in-parallel.patch \
>>> -           file://0001-configure.ac-fix-LIBPL.patch \
>>> -           file://0001-python3-Do-not-hardcode-lib-for-distutils.patch \
>>>
>>> file://0020-configure.ac-setup.py-do-not-add-a-curses-include-pa.patch \
>>>             "
>>>
>>> +
>>>  SRC_URI_append_class-native = " \
>>>
>>> file://0001-distutils-sysconfig-append-STAGING_LIBDIR-python-sys.patch \
>>>             file://12-distutils-prefix-is-inside-staging-area.patch \
>>>             file://0001-Don-t-search-system-for-headers-libraries.patch \
>>>             "
>>>
>>> -SRC_URI[md5sum] = "35b5a3d0254c1c59be9736373d429db7"
>>> -SRC_URI[sha256sum] =
>>> "e3003ed57db17e617acb382b0cade29a248c6026b1bd8aad1f976e9af66a83b0"
>>> +SRC_URI[sha256sum] =
>>> "9c73e63c99855709b9be0b3cc9e5b072cb60f37311e8c4e50f15576a0bf82854"
>>>
>>>  # exclude pre-releases for both python 2.x and 3.x
>>>  UPSTREAM_CHECK_REGEX = "[Pp]ython-(?P<pver>\d+(\.\d+)+).tar"
>>> @@ -52,7 +49,7 @@ CVE_PRODUCT = "python"
>>>  # This is not exploitable when glibc has CVE-2016-10739 fixed.
>>>  CVE_CHECK_WHITELIST += "CVE-2019-18348"
>>>
>>> -PYTHON_MAJMIN = "3.8"
>>> +PYTHON_MAJMIN = "3.9"
>>>
>>>  S = "${WORKDIR}/Python-${PV}"
>>>
>>> @@ -71,7 +68,7 @@ DEPENDS = "bzip2-replacement-native libffi bzip2
>>> openssl sqlite3 zlib virtual/li
>>>  DEPENDS_append_class-target = " python3-native"
>>>  DEPENDS_append_class-nativesdk = " python3-native"
>>>
>>> -EXTRA_OECONF = " --without-ensurepip --enable-shared"
>>> +EXTRA_OECONF = " --without-ensurepip --enable-shared
>>> --with-platlibdir=${baselib}"
>>>  EXTRA_OECONF_append_class-native = " --bindir=${bindir}/${PN}"
>>>
>>>  export
>>> CROSSPYTHONPATH="${STAGING_LIBDIR_NATIVE}/python${PYTHON_MAJMIN}/lib-dynload/"
>>> @@ -115,7 +112,6 @@ CPPFLAGS_append = " -I${STAGING_INCDIR}/ncursesw
>>> -I${STAGING_INCDIR}/uuid"
>>>  EXTRA_OEMAKE = '\
>>>    STAGING_LIBDIR=${STAGING_LIBDIR} \
>>>    STAGING_INCDIR=${STAGING_INCDIR} \
>>> -  LIB=${baselib} \
>>>  '
>>>
>>>  do_compile_prepend_class-target() {
>>> @@ -179,7 +175,6 @@ py_package_preprocess () {
>>>                  -e 's:${RECIPE_SYSROOT_NATIVE}::g' \
>>>                  -e 's:${RECIPE_SYSROOT}::g' \
>>>                  -e 's:${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}::g' \
>>> -
>>> ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config-${PYTHON_MAJMIN}${PYTHON_ABI}*/Makefile
>>> \
>>>
>>>  ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata*.py \
>>>                  ${PKGD}/${bindir}/python${PYTHON_MAJMIN}-config
>>>
>>> --
>>> 2.25.1
>>>
>>>
>>> 
>>>
>>>

[-- Attachment #2: Type: text/html, Size: 75336 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [OE-core] [PATCH 2/2] python3: upgrade to python 3.9.0
  2020-10-24 21:35   ` [OE-core] " Alexander Kanavin
  2020-10-24 21:59     ` Alejandro Hernandez Samaniego
@ 2021-03-20  9:57     ` Martin Jansa
  1 sibling, 0 replies; 6+ messages in thread
From: Martin Jansa @ 2021-03-20  9:57 UTC (permalink / raw)
  To: Alexander Kanavin
  Cc: Alejandro Hernandez Samaniego, OE-core,
	Alejandro Enedino Hernandez Samaniego

[-- Attachment #1: Type: text/plain, Size: 5172 bytes --]

On Sat, Oct 24, 2020 at 11:35:05PM +0200, Alexander Kanavin wrote:
> Haha, you beat me to it by a few minutes :)
> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/commit/?h=akanavin/package-version-updates&id=98049b60602b4bd3854e870e46705716e469277c
> 
> I have some additional fixes included though, coming from autobuilder runs.

He also beated you a bit on functionality of PACKAGECONFIGs :).

> > a/meta/recipes-devtools/python/python3/0017-setup.py-do-not-report-missing-dependencies-for-disa.patch
> > b/meta/recipes-devtools/python/python3/0017-setup.py-do-not-report-missing-dependencies-for-disa.patch
> > index 4bd98f62fd..d0ff3219a6 100644
> > ---
> > a/meta/recipes-devtools/python/python3/0017-setup.py-do-not-report-missing-dependencies-for-disa.patch
> > +++
> > b/meta/recipes-devtools/python/python3/0017-setup.py-do-not-report-missing-dependencies-for-disa.patch
> > @@ -1,4 +1,4 @@
> > -From a2dd127b4163aff6cc35af0d0251321964232ad4 Mon Sep 17 00:00:00 2001
> > +From 5d85a94fd0965aa26adf593b5f84948e9c502121 Mon Sep 17 00:00:00 2001
> >  From: Alexander Kanavin <alex.kanavin@gmail.com>
> >  Date: Mon, 7 Oct 2019 13:22:14 +0200
> >  Subject: [PATCH] setup.py: do not report missing dependencies for disabled
> > @@ -11,20 +11,24 @@ build completeness checker which relies on the report.
> >  Upstream-Status: Inappropriate [oe-core specific]
> >  Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
> >
> > +Rebased for 3.9 [10/2020]
> > +Signed-off-by: Alejandro Enedino Hernandez Samaniego <
> > alejandro.hernandez@linux.microsoft.com>
> > +
> >  ---
> > - setup.py | 4 ++++
> > - 1 file changed, 4 insertions(+)
> > + setup.py | 5 +++++
> > + 1 file changed, 5 insertions(+)
> >
> >  diff --git a/setup.py b/setup.py
> > -index 7691258..ec3f2a4 100644
> > +index ab9fb8e..8cf058c 100644
> >  --- a/setup.py
> >  +++ b/setup.py
> > -@@ -408,6 +408,10 @@ class PyBuildExt(build_ext):
> > +@@ -495,6 +495,11 @@ class PyBuildExt(build_ext):
> >                   print("%-*s   %-*s   %-*s" % (longest, e, longest, f,
> >                                                 longest, g))
> >
> >  +        # There is no need to report missing module dependencies,
> >  +        # if the modules have been disabled in the first place.
> > ++        sysconf_dis =
> > sysconfig.get_config_var('MODDISABLED_NAMES').split()
> >  +        self.missing = list(set(self.missing) - set(sysconf_dis))
> >  +
> >           if self.missing:

This works better than Alex's version from
https://git.openembedded.org/openembedded-core/diff/meta/recipes-devtools/python/python3/0017-setup.py-do-not-report-missing-dependencies-for-disa.patch?id=7347556b18b45c5f9afc2cade565a75c95876914

diff --git a/meta/recipes-devtools/python/python3/0017-setup.py-do-not-report-missing-dependencies-for-disa.patch b/meta/recipes-devtools/python/python3/0017-setup.py-do-not-report-missing-dependencies-for-disa.patch
index 4bd98f62fd..5c620361da 100644
--- a/meta/recipes-devtools/python/python3/0017-setup.py-do-not-report-missing-dependencies-for-disa.patch
+++ b/meta/recipes-devtools/python/python3/0017-setup.py-do-not-report-missing-dependencies-for-disa.patch
@@ -25,7 +25,7 @@ index 7691258..ec3f2a4 100644
  
 +        # There is no need to report missing module dependencies,
 +        # if the modules have been disabled in the first place.
-+        self.missing = list(set(self.missing) - set(sysconf_dis))
++        self.missing = list(set(self.missing) - set(mods_disabled))
 +
          if self.missing:
              print()

because mods_disabled can contain only extensions which were disabled, as this list:
self.extensions: ['_struct', 'array', '_contextvars', 'math', 'cmath', 'time', '_datetime', '_zoneinfo', '_random', '_bisect', '_heapq', '_pickle', 'atexit', '_json', '_lsprof', 'unicodedata', '_opcode', '_asyncio', '_abc', '_queue', '_statistics', 'fcntl', 'pwd', 'grp', 'spwd', 'select', 'parser', 'mmap', 'syslog', '_xxsubinterpreters', 'audioop', '_csv', '_posixsubprocess', '_testcapi', '_testinternalcapi', '_testbuffer', '_testimportmultiple', '_testmultiphase', '_xxtestfuzz', '_curses', '_curses_panel', '_crypt', '_socket', '_ssl', '_hashlib', '_sha256', '_sha512', '_md5', '_sha1', '_blake2', '_sha3', '_sqlite3', 'termios', 'resource', 'ossaudiodev', 'nis', 'zlib', 'binascii', '_bz2', '_lzma', 'pyexpat', '_elementtree', '_multibytecodec', '_codecs_kr', '_codecs_jp', '_codecs_cn', '_codecs_tw', '_codecs_hk', '_codecs_iso2022', '_decimal', '_ctypes_test', '_posixshmem', '_multiprocessing', '_uuid', 'xxlimited', '_ctypes']

but PACKAGECONFIG in python3 recipe is using it to disable gdbm, dbm, readline and disabling them now causes do_install to fail with:

| ERROR: Execution of '/OE/build/oe-core/tmp-glibc/work/x86_64-linux/python3-native/3.9.0-r0/temp/run.do_install.69743' failed with exit code 1:
| The necessary bits to build these optional modules were not found:
| _dbm                  _gdbm                 readline

passing sysconf_dis into summary or reading it again from sysconfig like Alejandro fixes that. Will send patch shortly.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 201 bytes --]

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-03-20  9:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-24 21:20 [PATCH 1/2] libxml2: Backport patch to fix Python3.9 syntax Alejandro Hernandez Samaniego
2020-10-24 21:20 ` [PATCH 2/2] python3: upgrade to python 3.9.0 Alejandro Hernandez Samaniego
2020-10-24 21:35   ` [OE-core] " Alexander Kanavin
2020-10-24 21:59     ` Alejandro Hernandez Samaniego
2020-10-25  7:05       ` Alexander Kanavin
2021-03-20  9:57     ` Martin Jansa

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.