If host and target architecture match PyBuildExt.compiler.library_dirs
and PyBuildExt.compiler.include_dirs contain host paths (e.g.
/usr/lib/i386-linux-gnu, /usr/include/i386-linux-gnu) leading to build
failures for some extensions (at least _ssl and _socket).

Signed-off-by: Bastian Stender <b...@pengutronix.de>
---
 .../0002-python3-prevent-host-path-leakage.patch   | 40 ++++++++++++++++++++++
 patches/Python-3.5.4/series                        |  3 +-
 2 files changed, 42 insertions(+), 1 deletion(-)
 create mode 100644 
patches/Python-3.5.4/0002-python3-prevent-host-path-leakage.patch

diff --git a/patches/Python-3.5.4/0002-python3-prevent-host-path-leakage.patch 
b/patches/Python-3.5.4/0002-python3-prevent-host-path-leakage.patch
new file mode 100644
index 000000000..783a1490f
--- /dev/null
+++ b/patches/Python-3.5.4/0002-python3-prevent-host-path-leakage.patch
@@ -0,0 +1,40 @@
+From: Bastian Stender <b...@pengutronix.de>
+Date: Fri, 5 Jan 2018 18:15:50 +0100
+Subject: [PATCH] python3: prevent host path leakage
+
+If host and target architecture match PyBuildExt.compiler.library_dirs
+and PyBuildExt.compiler.include_dirs contain host paths (e.g.
+/usr/lib/i386-linux-gnu, /usr/include/i386-linux-gnu) leading to build
+failures for some extensions (at least _ssl and _socket).
+
+Based on a patch by Alexandru Ardelean <ardeleana...@gmail.com>.
+
+See https://github.com/openwrt/packages/pull/784 for reference.
+
+Signed-off-by: Bastian Stender <b...@pengutronix.de>
+---
+ setup.py | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/setup.py b/setup.py
+index ee04dba88fa8..1b2d40558680 100644
+--- a/setup.py
++++ b/setup.py
+@@ -490,13 +490,13 @@ class PyBuildExt(build_ext):
+         # Ensure that /usr/local is always used, but the local build
+         # directories (i.e. '.' and 'Include') must be first.  See issue
+         # 10520.
+-        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')
++        #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')
+         # only change this for cross builds for 3.3, issues on Mageia
+         if cross_compiling:
+             self.add_gcc_paths()
+-        self.add_multiarch_paths()
++        #self.add_multiarch_paths()
+ 
+         # Add paths specified in the environment variables LDFLAGS and
+         # CPPFLAGS for header and library files.
diff --git a/patches/Python-3.5.4/series b/patches/Python-3.5.4/series
index 7f3b3d069..13414d973 100644
--- a/patches/Python-3.5.4/series
+++ b/patches/Python-3.5.4/series
@@ -1,4 +1,5 @@
 # generated by git-ptx-patches
 #tag:base --start-number 1
 0001-python3-don-t-leak-host-path-into-cross-compilation.patch
-# 3a85778f36c3116f07c55efca7ccb1a7  - git-ptx-patches magic
+0002-python3-prevent-host-path-leakage.patch
+# fc032e56bd6d6d9a892e750c18fa5e0d  - git-ptx-patches magic
-- 
2.11.0


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

Reply via email to