diff options
Diffstat (limited to 'meta/recipes-devtools/python/python3/correct-python3-lib-pathes-for-multilib-support.patch')
-rw-r--r-- | meta/recipes-devtools/python/python3/correct-python3-lib-pathes-for-multilib-support.patch | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/meta/recipes-devtools/python/python3/correct-python3-lib-pathes-for-multilib-support.patch b/meta/recipes-devtools/python/python3/correct-python3-lib-pathes-for-multilib-support.patch new file mode 100644 index 00000000000..8ca5a6a6f79 --- /dev/null +++ b/meta/recipes-devtools/python/python3/correct-python3-lib-pathes-for-multilib-support.patch @@ -0,0 +1,49 @@ +When enable multilib, it fails to run python3: + +| Could not find platform independent libraries <prefix> +| Could not find platform dependent libraries <exec_prefix> +| Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] +| Fatal Python error: Py_Initialize: Unable to get the locale encoding +| ImportError: No module named 'encodings' +| +| Current thread 0x00007f62ea5b2700 (most recent call first): +| Aborted (core dumped) + +The root cause is the module search path /usr/lib is wrong for x86-64 when +multilib is enabled. So replace fixed path string with right macro. + +Upstream-Status: Pending + +Signed-off-by: Kai Kang <kai.kang@windriver.com> +--- +diff --git a/Modules/getpath.c b/Modules/getpath.c +index 18deb60..d22af53 100644 +--- a/Modules/getpath.c ++++ b/Modules/getpath.c +@@ -494,7 +494,7 @@ calculate_path(void) + _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, NULL); + + if (!_pythonpath || !_prefix || !_exec_prefix || !lib_python) { + Py_FatalError( +@@ -683,7 +683,7 @@ calculate_path(void) + } + else + wcsncpy(zip_path, _prefix, MAXPATHLEN); +- joinpath(zip_path, L"lib/python00.zip"); ++ joinpath(zip_path, LIB L"/python00.zip"); + bufsz = wcslen(zip_path); /* Replace "00" with version */ + zip_path[bufsz - 6] = VERSION[0]; + zip_path[bufsz - 5] = VERSION[2]; +@@ -695,7 +695,7 @@ calculate_path(void) + fprintf(stderr, + "Could not find platform dependent libraries <exec_prefix>\n"); + wcsncpy(exec_prefix, _exec_prefix, MAXPATHLEN); +- joinpath(exec_prefix, L"lib/lib-dynload"); ++ joinpath(exec_prefix, LIB L"/lib-dynload"); + } + /* If we found EXEC_PREFIX do *not* reduce it! (Yet.) */ + |