Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 3/3] python3: Compile host-python3 statically
@ 2016-09-16 13:30 Frederik Aalund
  2016-09-16 17:08 ` Thomas Petazzoni
  0 siblings, 1 reply; 5+ messages in thread
From: Frederik Aalund @ 2016-09-16 13:30 UTC (permalink / raw)
  To: buildroot

The previous behaviour was to compile host-python3 with `--enable-shared` as is done for the target python installation. The problem is that if the host *already* has a python installation, then host-python3 will be called with the system `libpython3.5.so`. So even though the $(HOST_DIR) python executable is called, the system .so is used.

On my system, I have python 3.5.1. I was trying to python 3.5.2 for buildroot. I noticed druing the build that the host-python thought it was 3.5.1 (as on the system). This was caused by the above. In combination with the `PYTHON3_PYC_ONLY`, this caused all the *.pyc files to be compiled for 3.5.1 even though it should have been 3.5.2.

I've changed the `python3.mk` file so that host-python3 is built statically. This way, such errors will not occur.

Alternatively, one could make sure to always call host-python3 with an `LD_LIBRARY_PATH` which points to the `$(HOST_DIR)`. However, this requires a much more invasive change than simply compiling python statically.

Signed-off-by: Frederik Aalund <fpa@sbtaqua.com>
---
 package/python3/python3.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/package/python3/python3.mk b/package/python3/python3.mk
index 1b63f95..093f570 100644
--- a/package/python3/python3.mk
+++ b/package/python3/python3.mk
@@ -25,6 +25,7 @@ PYTHON3_LIBTOOL_PATCH = NO
 # third-party Python modules.
 
 HOST_PYTHON3_CONF_OPTS += 	\
+	--disable-shared    \
 	--without-ensurepip	\
 	--without-cxx-main 	\
 	--disable-sqlite3	\
-- 
2.5.0

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

end of thread, other threads:[~2016-09-23 21:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-16 13:30 [Buildroot] [PATCH 3/3] python3: Compile host-python3 statically Frederik Aalund
2016-09-16 17:08 ` Thomas Petazzoni
2016-09-20 13:57   ` Frederik Peter Aalund
2016-09-23 16:10     ` Frederik Peter Aalund
2016-09-23 21:14       ` Thomas Petazzoni

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