summaryrefslogtreecommitdiffstats
path: root/patches/Python-2.7.16/0009-python2-prevent-host-path-leakage.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/Python-2.7.16/0009-python2-prevent-host-path-leakage.patch')
-rw-r--r--patches/Python-2.7.16/0009-python2-prevent-host-path-leakage.patch39
1 files changed, 39 insertions, 0 deletions
diff --git a/patches/Python-2.7.16/0009-python2-prevent-host-path-leakage.patch b/patches/Python-2.7.16/0009-python2-prevent-host-path-leakage.patch
new file mode 100644
index 000000000..ab5e0d42f
--- /dev/null
+++ b/patches/Python-2.7.16/0009-python2-prevent-host-path-leakage.patch
@@ -0,0 +1,39 @@
+From: Bastian Stender <bst@pengutronix.de>
+Date: Mon, 8 Jan 2018 15:55:40 +0100
+Subject: [PATCH] python2: 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 | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/setup.py b/setup.py
+index 4ce7075150d1..29b9de4a4607 100644
+--- a/setup.py
++++ b/setup.py
+@@ -458,9 +458,9 @@ 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()
+ 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.