mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH v2 1/2] python2: prevent host path leakage
@ 2018-01-08 15:18 Bastian Stender
  2018-01-08 15:18 ` [ptxdist] [PATCH v2 2/2] python3: " Bastian Stender
  0 siblings, 1 reply; 2+ messages in thread
From: Bastian Stender @ 2018-01-08 15:18 UTC (permalink / raw)
  To: ptxdist; +Cc: Bastian Stender

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.

Signed-off-by: Bastian Stender <bst@pengutronix.de>
---
Changes since (implicit) v1:
- add local paths when not cross-compiling
- perform add_multiarch_paths() only when not cross-compiling
---
 .../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..e2c35e1f9
--- /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: 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 8873831323f0..bd663dcfbec0 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.
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] 2+ messages in thread

* [ptxdist] [PATCH v2 2/2] python3: prevent host path leakage
  2018-01-08 15:18 [ptxdist] [PATCH v2 1/2] python2: prevent host path leakage Bastian Stender
@ 2018-01-08 15:18 ` Bastian Stender
  0 siblings, 0 replies; 2+ messages in thread
From: Bastian Stender @ 2018-01-08 15:18 UTC (permalink / raw)
  To: ptxdist; +Cc: Bastian Stender

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.

Signed-off-by: Bastian Stender <bst@pengutronix.de>
---
Changes since (implicit) v1:
- add local paths when not cross-compiling
- perform add_multiarch_paths() only when not cross-compiling
---
 .../0002-python3-prevent-host-path-leakage.patch   | 42 ++++++++++++++++++++++
 patches/Python-3.5.4/series                        |  3 +-
 2 files changed, 44 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..8b13afbd8
--- /dev/null
+++ b/patches/Python-3.5.4/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 ee04dba88fa8..5c79f50d88aa 100644
+--- a/setup.py
++++ b/setup.py
+@@ -493,10 +493,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.
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

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

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

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

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