From ea62d1217caa286e22f1db1e9e53dc9b662ac1d6 Mon Sep 17 00:00:00 2001 From: Alexandru Ardelean Date: Wed, 14 Mar 2018 16:18:27 +0200 Subject: [PATCH 1/2] python,python3: limit underlinking behavior to linux platforms This change was introduced in commit 1c54e2b0fbe2e9a7d to address build issues on Ubuntu 12.04. However it was reported to cause issues on Mac OS X. Report: https://github.com/openwrt/packages/issues/5310 It was also reported that removing this on MacOS X fixes the issue. Signed-off-by: Alexandru Ardelean --- lang/python/python/Makefile | 6 +++++- lang/python/python3/Makefile | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lang/python/python/Makefile b/lang/python/python/Makefile index c70c486e8a..5f698888a2 100644 --- a/lang/python/python/Makefile +++ b/lang/python/python/Makefile @@ -268,9 +268,13 @@ define PyPackage/python/filespec endef HOST_LDFLAGS += \ - -Wl,--no-as-needed -lrt \ $$$$(pkg-config --static --libs libcrypto libssl) +ifeq ($(HOST_OS),Linux) +HOST_LDFLAGS += \ + -Wl,--no-as-needed -lrt +endif + HOST_CONFIGURE_ARGS+= \ --without-cxx-main \ --without-pymalloc \ diff --git a/lang/python/python3/Makefile b/lang/python/python3/Makefile index cd97378ce5..794a2bf75e 100644 --- a/lang/python/python3/Makefile +++ b/lang/python/python3/Makefile @@ -264,9 +264,13 @@ define Py3Package/python3/filespec endef HOST_LDFLAGS += \ - -Wl,--no-as-needed -lrt \ $$$$(pkg-config --static --libs libcrypto libssl) +ifeq ($(HOST_OS),Linux) +HOST_LDFLAGS += \ + -Wl,--no-as-needed -lrt +endif + HOST_CONFIGURE_ARGS+= \ --without-cxx-main \ --without-pymalloc \ From b6973e5deb5a3172f303f4717e039bcb79c49469 Mon Sep 17 00:00:00 2001 From: Alexandru Ardelean Date: Wed, 14 Mar 2018 16:21:40 +0200 Subject: [PATCH 2/2] python,python3: remove `--with-system-ffi=no` config arg Report https://github.com/openwrt/packages/issues/5638 It was mentioned that this causes build failures on Mac OS X. The default behavior [in the setup.py script] is to check whether `--with-system-ffi` is present in the CONFIG_ARGS env var. However that back-fires a bit when `--with-system-ffi=no`, because the condition `not '--with-system-ffi' in sysconfig.get_config_var("CONFIG_ARGS")` evaluates to true. This is a small bug in the `setup.py` script, but it looks like the easiest/cleanest way to address it on our end is to just remove it entirely from the HOST_CONFIGURE_ARGS. At least that's how it looks like when testing on a Linux machine. Signed-off-by: Alexandru Ardelean --- lang/python/python/Makefile | 1 - lang/python/python3/Makefile | 1 - 2 files changed, 2 deletions(-) diff --git a/lang/python/python/Makefile b/lang/python/python/Makefile index 5f698888a2..0948e35007 100644 --- a/lang/python/python/Makefile +++ b/lang/python/python/Makefile @@ -282,7 +282,6 @@ HOST_CONFIGURE_ARGS+= \ --prefix=$(HOST_PYTHON_DIR) \ --exec-prefix=$(HOST_PYTHON_DIR) \ --with-system-expat=$(STAGING_DIR_HOSTPKG) \ - --with-system-ffi=no \ --with-ensurepip=install \ CONFIG_SITE= diff --git a/lang/python/python3/Makefile b/lang/python/python3/Makefile index 794a2bf75e..85952c2986 100644 --- a/lang/python/python3/Makefile +++ b/lang/python/python3/Makefile @@ -278,7 +278,6 @@ HOST_CONFIGURE_ARGS+= \ --prefix=$(HOST_PYTHON3_DIR) \ --exec-prefix=$(HOST_PYTHON3_DIR) \ --with-system-expat=$(STAGING_DIR_HOSTPKG) \ - --with-system-ffi=no \ --with-ensurepip=install \ CONFIG_SITE=