Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'jb49761-aarch64' into 'master'
Fixes for aarch64 See merge request mer-core/python!14
- Loading branch information
Showing
5 changed files
with
306 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,185 @@ | ||
From 7de51a2d130c564901325ced97a750ac93609212 Mon Sep 17 00:00:00 2001 | ||
From: Matti Kosola <matti.kosola@jolla.com> | ||
Date: Fri, 22 May 2020 08:01:34 +0200 | ||
Subject: [PATCH 2/4] Fix lib64 for multilib | ||
|
||
Fixup various paths throughout the build and in distutils from "lib" to "lib64", | ||
and add the /usr/lib64/pythonMAJOR.MINOR/site-packages to sitedirs, in front of | ||
/usr/lib/pythonMAJOR.MINOR/site-packages | ||
|
||
Signed-off-by: Matti Kosola <matti.kosola@jolla.com> | ||
--- | ||
Lib/distutils/command/install.py | 4 ++-- | ||
Lib/distutils/sysconfig.py | 6 +++++- | ||
Lib/site.py | 4 ++++ | ||
Lib/test/test_site.py | 11 +++++++---- | ||
Makefile.pre.in | 2 +- | ||
Modules/getpath.c | 4 ++-- | ||
setup.py | 10 +++++----- | ||
7 files changed, 26 insertions(+), 15 deletions(-) | ||
|
||
diff --git a/Lib/distutils/command/install.py b/Lib/distutils/command/install.py | ||
index b9f1c6c..7b23714 100644 | ||
--- a/Lib/distutils/command/install.py | ||
+++ b/Lib/distutils/command/install.py | ||
@@ -42,14 +42,14 @@ else: | ||
INSTALL_SCHEMES = { | ||
'unix_prefix': { | ||
'purelib': '$base/lib/python$py_version_short/site-packages', | ||
- 'platlib': '$platbase/lib/python$py_version_short/site-packages', | ||
+ 'platlib': '$platbase/lib64/python$py_version_short/site-packages', | ||
'headers': '$base/include/python$py_version_short/$dist_name', | ||
'scripts': '$base/bin', | ||
'data' : '$base', | ||
}, | ||
'unix_home': { | ||
'purelib': '$base/lib/python', | ||
- 'platlib': '$base/lib/python', | ||
+ 'platlib': '$base/lib64/python', | ||
'headers': '$base/include/python/$dist_name', | ||
'scripts': '$base/bin', | ||
'data' : '$base', | ||
diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py | ||
index 1a4b792..a485419 100644 | ||
--- a/Lib/distutils/sysconfig.py | ||
+++ b/Lib/distutils/sysconfig.py | ||
@@ -129,8 +129,12 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None): | ||
prefix = plat_specific and EXEC_PREFIX or PREFIX | ||
|
||
if os.name == "posix": | ||
+ if plat_specific or standard_lib: | ||
+ lib = "lib64" | ||
+ else: | ||
+ lib = "lib" | ||
libpython = os.path.join(prefix, | ||
- "lib", "python" + get_python_version()) | ||
+ lib, "python" + get_python_version()) | ||
if standard_lib: | ||
return libpython | ||
else: | ||
diff --git a/Lib/site.py b/Lib/site.py | ||
index 3b51e81..9fd76c8 100644 | ||
--- a/Lib/site.py | ||
+++ b/Lib/site.py | ||
@@ -288,12 +288,16 @@ def getsitepackages(): | ||
if sys.platform in ('os2emx', 'riscos'): | ||
sitepackages.append(os.path.join(prefix, "Lib", "site-packages")) | ||
elif os.sep == '/': | ||
+ sitepackages.append(os.path.join(prefix, "lib64", | ||
+ "python" + sys.version[:3], | ||
+ "site-packages")) | ||
sitepackages.append(os.path.join(prefix, "lib", | ||
"python" + sys.version[:3], | ||
"site-packages")) | ||
sitepackages.append(os.path.join(prefix, "lib", "site-python")) | ||
else: | ||
sitepackages.append(prefix) | ||
+ sitepackages.append(os.path.join(prefix, "lib64", "site-packages")) | ||
sitepackages.append(os.path.join(prefix, "lib", "site-packages")) | ||
return sitepackages | ||
|
||
diff --git a/Lib/test/test_site.py b/Lib/test/test_site.py | ||
index b4384ee..349f688 100644 | ||
--- a/Lib/test/test_site.py | ||
+++ b/Lib/test/test_site.py | ||
@@ -254,17 +254,20 @@ class HelperFunctionsTests(unittest.TestCase): | ||
self.assertEqual(dirs[0], wanted) | ||
elif os.sep == '/': | ||
# OS X, Linux, FreeBSD, etc | ||
- self.assertEqual(len(dirs), 2) | ||
- wanted = os.path.join('xoxo', 'lib', 'python' + sys.version[:3], | ||
+ self.assertEqual(len(dirs), 3) | ||
+ wanted = os.path.join('xoxo', 'lib64', 'python' + sys.version[:3], | ||
'site-packages') | ||
self.assertEqual(dirs[0], wanted) | ||
- wanted = os.path.join('xoxo', 'lib', 'site-python') | ||
+ wanted = os.path.join('xoxo', 'lib', 'python' + sys.version[:3], | ||
+ 'site-packages') | ||
self.assertEqual(dirs[1], wanted) | ||
+ wanted = os.path.join('xoxo', 'lib', 'site-python') | ||
+ self.assertEqual(dirs[2], wanted) | ||
else: | ||
# other platforms | ||
self.assertEqual(len(dirs), 2) | ||
self.assertEqual(dirs[0], 'xoxo') | ||
- wanted = os.path.join('xoxo', 'lib', 'site-packages') | ||
+ wanted = os.path.join('xoxo', 'lib64', 'site-packages') | ||
self.assertEqual(dirs[1], wanted) | ||
|
||
def test_no_home_directory(self): | ||
diff --git a/Makefile.pre.in b/Makefile.pre.in | ||
index ed547b3..0db0716 100644 | ||
--- a/Makefile.pre.in | ||
+++ b/Makefile.pre.in | ||
@@ -110,7 +110,7 @@ LIBDIR= @libdir@ | ||
MANDIR= @mandir@ | ||
INCLUDEDIR= @includedir@ | ||
CONFINCLUDEDIR= $(exec_prefix)/include | ||
-SCRIPTDIR= $(prefix)/lib | ||
+SCRIPTDIR= $(prefix)/lib64 | ||
|
||
# Detailed destination directories | ||
BINLIBDEST= $(LIBDIR)/python$(VERSION) | ||
diff --git a/Modules/getpath.c b/Modules/getpath.c | ||
index c42ce31..2c897ba 100644 | ||
--- a/Modules/getpath.c | ||
+++ b/Modules/getpath.c | ||
@@ -108,7 +108,7 @@ static char prefix[MAXPATHLEN+1]; | ||
static char exec_prefix[MAXPATHLEN+1]; | ||
static char progpath[MAXPATHLEN+1]; | ||
static char *module_search_path = NULL; | ||
-static char lib_python[] = "lib/python" VERSION; | ||
+static char lib_python[] = "lib64/python" VERSION; | ||
|
||
static void | ||
reduce(char *dir) | ||
@@ -530,7 +530,7 @@ calculate_path(void) | ||
fprintf(stderr, | ||
"Could not find platform dependent libraries <exec_prefix>\n"); | ||
strncpy(exec_prefix, EXEC_PREFIX, MAXPATHLEN); | ||
- joinpath(exec_prefix, "lib/lib-dynload"); | ||
+ joinpath(exec_prefix, "lib64/lib-dynload"); | ||
} | ||
/* If we found EXEC_PREFIX do *not* reduce it! (Yet.) */ | ||
|
||
diff --git a/setup.py b/setup.py | ||
index 52f9918..e1d79eb 100644 | ||
--- a/setup.py | ||
+++ b/setup.py | ||
@@ -502,7 +502,7 @@ class PyBuildExt(build_ext): | ||
def detect_modules(self): | ||
# Ensure that /usr/local is always used | ||
if not cross_compiling: | ||
- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') | ||
+ add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib64') | ||
add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') | ||
if cross_compiling: | ||
self.add_gcc_paths() | ||
@@ -828,11 +828,11 @@ class PyBuildExt(build_ext): | ||
elif curses_library: | ||
readline_libs.append(curses_library) | ||
elif self.compiler.find_library_file(lib_dirs + | ||
- ['/usr/lib/termcap'], | ||
+ ['/usr/lib64/termcap'], | ||
'termcap'): | ||
readline_libs.append('termcap') | ||
exts.append( Extension('readline', ['readline.c'], | ||
- library_dirs=['/usr/lib/termcap'], | ||
+ library_dirs=['/usr/lib64/termcap'], | ||
extra_link_args=readline_extra_link_args, | ||
libraries=readline_libs) ) | ||
else: | ||
@@ -867,8 +867,8 @@ class PyBuildExt(build_ext): | ||
if krb5_h: | ||
ssl_incs += krb5_h | ||
ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs, | ||
- ['/usr/local/ssl/lib', | ||
- '/usr/contrib/ssl/lib/' | ||
+ ['/usr/local/ssl/lib64', | ||
+ '/usr/contrib/ssl/lib64/' | ||
] ) | ||
|
||
if (ssl_incs is not None and | ||
-- | ||
2.7.4 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
From bf3ea7be7221e01e3af790324039b1fe4b0467eb Mon Sep 17 00:00:00 2001 | ||
From: Matti Kosola <matti.kosola@jolla.com> | ||
Date: Fri, 22 May 2020 08:03:57 +0200 | ||
Subject: [PATCH 3/4] Fix sysconfig for multilib | ||
|
||
Python 2.7 split out much of the path-handling from distutils/sysconfig.py to | ||
a new sysconfig.py (in r77704). | ||
We need to make equivalent changes to that new file to ensure that the stdlib | ||
and platform-specific code go to /usr/lib64 not /usr/lib, on 64-bit archs | ||
|
||
Signed-off-by: Matti Kosola <matti.kosola@jolla.com> | ||
--- | ||
Lib/sysconfig.py | 18 +++++++++--------- | ||
1 file changed, 9 insertions(+), 9 deletions(-) | ||
|
||
diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py | ||
index 9c8350d..1ff812f 100644 | ||
--- a/Lib/sysconfig.py | ||
+++ b/Lib/sysconfig.py | ||
@@ -7,20 +7,20 @@ from os.path import pardir, realpath | ||
|
||
_INSTALL_SCHEMES = { | ||
'posix_prefix': { | ||
- 'stdlib': '{base}/lib/python{py_version_short}', | ||
- 'platstdlib': '{platbase}/lib/python{py_version_short}', | ||
+ 'stdlib': '{base}/lib64/python{py_version_short}', | ||
+ 'platstdlib': '{platbase}/lib64/python{py_version_short}', | ||
'purelib': '{base}/lib/python{py_version_short}/site-packages', | ||
- 'platlib': '{platbase}/lib/python{py_version_short}/site-packages', | ||
+ 'platlib': '{platbase}/lib64/python{py_version_short}/site-packages', | ||
'include': '{base}/include/python{py_version_short}', | ||
'platinclude': '{platbase}/include/python{py_version_short}', | ||
'scripts': '{base}/bin', | ||
'data': '{base}', | ||
}, | ||
'posix_home': { | ||
- 'stdlib': '{base}/lib/python', | ||
- 'platstdlib': '{base}/lib/python', | ||
+ 'stdlib': '{base}/lib64/python', | ||
+ 'platstdlib': '{base}/lib64/python', | ||
'purelib': '{base}/lib/python', | ||
- 'platlib': '{base}/lib/python', | ||
+ 'platlib': '{base}/lib64/python', | ||
'include': '{base}/include/python', | ||
'platinclude': '{base}/include/python', | ||
'scripts': '{base}/bin', | ||
@@ -65,10 +65,10 @@ _INSTALL_SCHEMES = { | ||
'data' : '{userbase}', | ||
}, | ||
'posix_user': { | ||
- 'stdlib': '{userbase}/lib/python{py_version_short}', | ||
- 'platstdlib': '{userbase}/lib/python{py_version_short}', | ||
+ 'stdlib': '{userbase}/lib64/python{py_version_short}', | ||
+ 'platstdlib': '{userbase}/lib64/python{py_version_short}', | ||
'purelib': '{userbase}/lib/python{py_version_short}/site-packages', | ||
- 'platlib': '{userbase}/lib/python{py_version_short}/site-packages', | ||
+ 'platlib': '{userbase}/lib64/python{py_version_short}/site-packages', | ||
'include': '{userbase}/include/python{py_version_short}', | ||
'scripts': '{userbase}/bin', | ||
'data' : '{userbase}', | ||
-- | ||
2.7.4 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
From 9e91d78d6dc2b645d3905f19b0648505128f89a9 Mon Sep 17 00:00:00 2001 | ||
From: Matti Kosola <matti.kosola@jolla.com> | ||
Date: Fri, 22 May 2020 08:06:25 +0200 | ||
Subject: [PATCH 4/4] Fix test installation for multilib | ||
|
||
Another lib64 fix, for distutils/tests/test_install.py | ||
|
||
Signed-off-by: Matti Kosola <matti.kosola@jolla.com> | ||
--- | ||
Lib/distutils/tests/test_install.py | 3 ++- | ||
1 file changed, 2 insertions(+), 1 deletion(-) | ||
|
||
diff --git a/Lib/distutils/tests/test_install.py b/Lib/distutils/tests/test_install.py | ||
index 397e2a7..c72ae0b 100644 | ||
--- a/Lib/distutils/tests/test_install.py | ||
+++ b/Lib/distutils/tests/test_install.py | ||
@@ -58,8 +58,9 @@ class InstallTestCase(support.TempdirManager, | ||
self.assertEqual(got, expected) | ||
|
||
libdir = os.path.join(destination, "lib", "python") | ||
+ platlibdir = os.path.join(destination, "lib64", "python") | ||
check_path(cmd.install_lib, libdir) | ||
- check_path(cmd.install_platlib, libdir) | ||
+ check_path(cmd.install_platlib, platlibdir) | ||
check_path(cmd.install_purelib, libdir) | ||
check_path(cmd.install_headers, | ||
os.path.join(destination, "include", "python", "foopkg")) | ||
-- | ||
2.7.4 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters