-diff -dur -x '*~' -x '*.orig' Python-3.5.0.orig/Modules/getpath.c Python-3.5.0/Modules/getpath.c
---- Python-3.5.0.orig/Modules/getpath.c 2015-09-13 13:41:24.000000000 +0200
-+++ Python-3.5.0/Modules/getpath.c 2015-12-02 20:26:50.857126441 +0100
-@@ -117,9 +117,21 @@
- #define EXEC_PREFIX PREFIX
- #endif
-
-+#ifndef LIB_PYTHON
-+#if defined(__x86_64__) || (defined(__sparc__) && defined(__arch64__)) || defined(__powerpc64__) || defined(__s390x__)
-+#if defined(__ILP32__)
-+#define LIB_PYTHON "libx32/python"
-+#else
-+#define LIB_PYTHON "lib64/python"
-+#endif
-+#else
-+#define LIB_PYTHON "lib/python"
-+#endif
-+#endif
-+
- #ifndef PYTHONPATH
--#define PYTHONPATH PREFIX "/lib/python" VERSION ":" \
-- EXEC_PREFIX "/lib/python" VERSION "/lib-dynload"
-+#define PYTHONPATH PREFIX "/" LIB_PYTHON VERSION ":" \
-+ EXEC_PREFIX "/" LIB_PYTHON VERSION "/lib-dynload:"
- #endif
-
- #ifndef LANDMARK
-@@ -511,7 +523,7 @@
- _pythonpath = Py_DecodeLocale(PYTHONPATH, NULL);
- _prefix = Py_DecodeLocale(PREFIX, NULL);
- _exec_prefix = Py_DecodeLocale(EXEC_PREFIX, NULL);
-- lib_python = Py_DecodeLocale("lib/python" VERSION, NULL);
-+ lib_python = Py_DecodeLocale(LIB_PYTHON VERSION, NULL);
-
- if (!_pythonpath || !_prefix || !_exec_prefix || !lib_python) {
- Py_FatalError(
-@@ -700,7 +712,7 @@
- }
- else
- wcsncpy(zip_path, _prefix, MAXPATHLEN);
-- joinpath(zip_path, L"lib/python00.zip");
-+ joinpath(zip_path, L"" LIB_PYTHON "00.zip");
- bufsz = wcslen(zip_path); /* Replace "00" with version */
- zip_path[bufsz - 6] = VERSION[0];
- zip_path[bufsz - 5] = VERSION[2];
-diff -dur -x '*~' -x '*.orig' Python-3.5.0.orig/Python/getplatform.c Python-3.5.0/Python/getplatform.c
---- Python-3.5.0.orig/Python/getplatform.c 2015-09-13 13:41:26.000000000 +0200
-+++ Python-3.5.0/Python/getplatform.c 2015-12-02 20:26:50.857126441 +0100
-@@ -10,3 +10,23 @@
- {
- return PLATFORM;
- }
-+
-+#ifndef ARCH
-+#define ARCH "unknown"
-+#endif
-+
-+const char *
-+Py_GetArch(void)
-+{
-+ return ARCH;
-+}
-+
-+#ifndef LIB
-+#define LIB "lib"
-+#endif
-+
-+const char *
-+Py_GetLib(void)
-+{
-+ return LIB;
-+}
-diff -dur -x '*~' -x '*.orig' Python-3.5.0.orig/Python/sysmodule.c Python-3.5.0/Python/sysmodule.c
---- Python-3.5.0.orig/Python/sysmodule.c 2015-09-13 13:41:26.000000000 +0200
-+++ Python-3.5.0/Python/sysmodule.c 2015-12-02 20:26:50.857126441 +0100
-@@ -1767,6 +1767,10 @@
- PyUnicode_FromString(Py_GetCopyright()));
- SET_SYS_FROM_STRING("platform",
- PyUnicode_FromString(Py_GetPlatform()));
-+ SET_SYS_FROM_STRING("arch",
-+ PyUnicode_FromString(Py_GetArch()));
-+ SET_SYS_FROM_STRING("lib",
-+ PyUnicode_FromString(Py_GetLib()));
- SET_SYS_FROM_STRING("executable",
- PyUnicode_FromWideChar(
- Py_GetProgramFullPath(), -1));
-diff -dur -x '*~' -x '*.orig' Python-3.5.0.orig/configure.ac Python-3.5.0/configure.ac
---- Python-3.5.0.orig/configure.ac 2015-12-02 20:26:33.157018154 +0100
-+++ Python-3.5.0/configure.ac 2015-12-02 20:28:51.431199018 +0100
-@@ -722,6 +722,45 @@
- ])
- fi
-
-+AC_SUBST(ARCH)
-+AC_MSG_CHECKING(ARCH)
-+ARCH=`uname -m`
-+case $ARCH in
-+i?86) ARCH=i386;;
-+esac
-+AC_MSG_RESULT($ARCH)
-+
-+AC_SUBST(LIB)
-+AC_MSG_CHECKING(LIB)
-+case $ac_sys_system in
-+Linux*)
-+ # Test if the compiler is 64bit
-+ echo 'int i;' > conftest.$ac_ext
-+ python_cv_cc_64bit_output=no
-+ if AC_TRY_EVAL(ac_compile); then
-+ case `/usr/bin/file conftest.$ac_objext` in
-+ *"ELF 64"*)
-+ python_cv_cc_64bit_output=yes
-+ ;;
-+ esac
-+ fi
-+ rm -rf conftest*
-+ ;;
-+esac
-+
-+case $ARCH:$python_cv_cc_64bit_output in
-+powerpc64:yes | s390x:yes | sparc64:yes | x86_64:yes)
-+ LIB="lib64"
-+ ;;
-+x86_64:no)
-+ LIB="libx32"
-+ ;;
-+*:*)
-+ LIB="lib"
-+ ;;
-+esac
-+AC_MSG_RESULT($LIB)
-+
-
- MULTIARCH=$($CC --print-multiarch 2>/dev/null)
- AC_SUBST(MULTIARCH)
-@@ -4331,7 +4370,7 @@
-
- dnl define LIBPL after ABIFLAGS and LDVERSION is defined.
- AC_SUBST(PY_ENABLE_SHARED)
--LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}"
-+LIBPL='$(LIBDIR)/python'"${VERSION}/config-${LDVERSION}"
- AC_SUBST(LIBPL)
-
- # Check whether right shifting a negative integer extends the sign bit
-diff -dur -x '*~' -x '*.orig' Python-3.5.0.orig/setup.py Python-3.5.0/setup.py
---- Python-3.5.0.orig/setup.py 2015-09-13 13:41:26.000000000 +0200
-+++ Python-3.5.0/setup.py 2015-12-02 20:26:50.857126441 +0100
-@@ -526,8 +526,7 @@
- # be assumed that no additional -I,-L directives are needed.
- if not cross_compiling:
- lib_dirs = self.compiler.library_dirs + [
-- '/lib64', '/usr/lib64',
-- '/lib', '/usr/lib',
-+ '/' + sys.lib, '/usr/' + sys.lib
- ]
- inc_dirs = self.compiler.include_dirs + ['/usr/include']
- else:
-@@ -750,11 +749,11 @@
+diff -urNp -x '*.orig' Python-3.9.2.org/setup.py Python-3.9.2/setup.py
+--- Python-3.9.2.org/setup.py 2021-02-19 13:31:44.000000000 +0100
++++ Python-3.9.2/setup.py 2021-02-25 18:40:00.708985783 +0100
+@@ -750,7 +750,7 @@ class PyBuildExt(build_ext):
+ add_dir_to_list(self.compiler.include_dirs,
+ sysconfig.get_config_var("INCLUDEDIR"))
+
+- system_lib_dirs = ['/lib64', '/usr/lib64', '/lib', '/usr/lib']
++ system_lib_dirs = ['/' + sys.platlibdir, '/usr/' + sys.platlibdir]
+ system_include_dirs = ['/usr/include']
+ # lib_dirs and inc_dirs are used to search for files;
+ # if a file is found in one of those directories, it can
+@@ -1039,11 +1039,11 @@ class PyBuildExt(build_ext):