mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH 1/2] python2: prevent host path leakage
@ 2018-01-05 17:37 Bastian Stender
  2018-01-05 17:37 ` [ptxdist] [PATCH 2/2] python3: " Bastian Stender
  2018-01-08 12:04 ` [ptxdist] [PATCH 1/2] python2: " Michael Olbrich
  0 siblings, 2 replies; 3+ messages in thread
From: Bastian Stender @ 2018-01-05 17:37 UTC (permalink / raw)
  To: ptxdist; +Cc: Bastian Stender

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 <bst@pengutronix.de>
---
 .../0009-python2-prevent-host-path-leakage.patch   | 39 ++++++++++++++++++++++
 patches/Python-2.7.13/series                       |  3 +-
 2 files changed, 41 insertions(+), 1 deletion(-)
 create mode 100644 patches/Python-2.7.13/0009-python2-prevent-host-path-leakage.patch

diff --git a/patches/Python-2.7.13/0009-python2-prevent-host-path-leakage.patch b/patches/Python-2.7.13/0009-python2-prevent-host-path-leakage.patch
new file mode 100644
index 000000000..7f49dad06
--- /dev/null
+++ b/patches/Python-2.7.13/0009-python2-prevent-host-path-leakage.patch
@@ -0,0 +1,39 @@
+From: Bastian Stender <bst@pengutronix.de>
+Date: Fri, 5 Jan 2018 18:29:05 +0100
+Subject: [PATCH] python2: 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 <ardeleanalex@gmail.com>.
+
+See https://github.com/openwrt/packages/pull/784 for reference.
+
+Signed-off-by: Bastian Stender <bst@pengutronix.de>
+---
+ setup.py | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/setup.py b/setup.py
+index 8873831323f0..ab50ccfc03ce 100644
+--- a/setup.py
++++ b/setup.py
+@@ -455,12 +455,12 @@ 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.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')
+         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-2.7.13/series b/patches/Python-2.7.13/series
index 3a8265888..476244734 100644
--- a/patches/Python-2.7.13/series
+++ b/patches/Python-2.7.13/series
@@ -8,4 +8,5 @@
 0006-python-don-t-add-rpaths-in-setup.py.patch
 0007-add-more-search-paths.patch
 0008-resolve-existing-LD_LIBRARY_PATH-during-make-not-dur.patch
-# 9497b574212cc870e4c8fce4dd1b0b44  - git-ptx-patches magic
+0009-python2-prevent-host-path-leakage.patch
+# 1fb48b2848c102e3848999b1d9f65710  - git-ptx-patches magic
-- 
2.11.0


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-01-08 12:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-05 17:37 [ptxdist] [PATCH 1/2] python2: prevent host path leakage Bastian Stender
2018-01-05 17:37 ` [ptxdist] [PATCH 2/2] python3: " Bastian Stender
2018-01-08 12:04 ` [ptxdist] [PATCH 1/2] python2: " Michael Olbrich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox