diff options
Diffstat (limited to 'patches/Python-3.7.3/0002-python3-prevent-host-path-leakage.patch')
-rw-r--r-- | patches/Python-3.7.3/0002-python3-prevent-host-path-leakage.patch | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/patches/Python-3.7.3/0002-python3-prevent-host-path-leakage.patch b/patches/Python-3.7.3/0002-python3-prevent-host-path-leakage.patch new file mode 100644 index 000000000..5594fe13f --- /dev/null +++ b/patches/Python-3.7.3/0002-python3-prevent-host-path-leakage.patch @@ -0,0 +1,42 @@ +From: Bastian Stender <bst@pengutronix.de> +Date: Mon, 8 Jan 2018 16:11:23 +0100 +Subject: [PATCH] python3: prevent host path leakage + +If cross-compiling and host/target architecture match host paths are +added to include_dirs and library_dirs in add_multiarch_paths() (e.g. +/usr/lib/i386-linux-gnu, /usr/include/i386-linux-gnu). This leads to +build failures for some extensions (at least _ssl and _socket). + +ptxdist does not support multiarch, so remove this addition when +cross-compiling. + +Based on a patch by Alexandru Ardelean <ardeleanalex@gmail.com>. + +See these patches for reference: +- https://github.com/openwrt/packages/pull/784 +- https://github.com/openwrt/packages/blob/master/lang/python/python/patches/006-remove-multi-arch-and-local-paths.patch +- http://cgit.openembedded.org/openembedded-core/tree/meta/recipes-devtools/python/python/host_include_contamination.patch + +Signed-off-by: Bastian Stender <bst@pengutronix.de> +--- + setup.py | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/setup.py b/setup.py +index a9d59a533aaa..929898091120 100644 +--- a/setup.py ++++ b/setup.py +@@ -543,10 +543,12 @@ class PyBuildExt(build_ext): + if not cross_compiling: + add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') + add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') ++ ++ self.add_multiarch_paths() ++ + # only change this for cross builds for 3.3, issues on Mageia + if cross_compiling: + self.add_gcc_paths() +- self.add_multiarch_paths() + + # Add paths specified in the environment variables LDFLAGS and + # CPPFLAGS for header and library files. |