From e3b2ef74e9797d9e3537ff1dac612afa7919a64c Mon Sep 17 00:00:00 2001 From: Alexandru Ardelean Date: Sun, 13 Aug 2017 22:01:11 +0300 Subject: [PATCH 1/2] libffi: fix install location of host libffi headers Seems that the header files for the host libffi headers are installed in the wrong place. i.e. $(STAGING_DIR_HOSTPKG)/lib/libffi-3.2.1/include when it should be $(STAGING_DIR_HOSTPKG)/include Signed-off-by: Alexandru Ardelean --- libs/libffi/Makefile | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/libs/libffi/Makefile b/libs/libffi/Makefile index a967d6aca..be1763c93 100644 --- a/libs/libffi/Makefile +++ b/libs/libffi/Makefile @@ -9,11 +9,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libffi PKG_VERSION:=3.2.1 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=ftp://sourceware.org/pub/libffi/ -PKG_MD5SUM:=83b89587607e3eb65c70d361f13bab43 +PKG_HASH:=d06ebb8e1d9a22d19e38d63fdb83954253f39bedc5d46232a05645685722ca37 PKG_LICENSE:=MIT PKG_LICENSE_FILES:=LICENSE @@ -78,5 +78,15 @@ define Package/libffi/install $(1)/usr/lib/ endef +define Host/Install + $(call Host/Install/Default) + # Adjust host libffi headers ; the default rule does + # not seem to install them to the proper include folder + $(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/include + $(CP) \ + $(STAGING_DIR_HOSTPKG)/lib/libffi-$(PKG_VERSION)/include/*.h \ + $(STAGING_DIR_HOSTPKG)/include +endef + $(eval $(call HostBuild)) $(eval $(call BuildPackage,libffi)) From 4d94943818e918676a161a218b0778ad14c30471 Mon Sep 17 00:00:00 2001 From: Alexandru Ardelean Date: Sun, 13 Aug 2017 22:06:08 +0300 Subject: [PATCH 2/2] python,python3: add host-flags/settings to host pip install rules The host pip install should have the host's CFLAGS, LDFLAGS, etc available. And not the target's flags. Otherwise, weird things can happen when installing packages (host-side) that need to build C code. Signed-off-by: Alexandru Ardelean --- lang/python/python/files/python-host.mk | 24 ++++++++++++++--------- lang/python/python3/files/python3-host.mk | 24 ++++++++++++++--------- 2 files changed, 30 insertions(+), 18 deletions(-) diff --git a/lang/python/python/files/python-host.mk b/lang/python/python/files/python-host.mk index f20dbdeab..e836eae71 100644 --- a/lang/python/python/files/python-host.mk +++ b/lang/python/python/files/python-host.mk @@ -37,21 +37,26 @@ define HostPython $(HOST_PYTHON_BIN) $(2); endef +define host_python_settings + ARCH="$(HOST_ARCH)" \ + CC="$(HOSTCC)" \ + CCSHARED="$(HOSTCC) $(HOST_FPIC)" \ + CXX="$(HOSTCXX)" \ + LD="$(HOSTCC)" \ + LDSHARED="$(HOSTCC) -shared" \ + CFLAGS="$(HOST_CFLAGS)" \ + CPPFLAGS="$(HOST_CPPFLAGS) -I$(HOST_PYTHON_INC_DIR)" \ + LDFLAGS="$(HOST_LDFLAGS) -lpython$(PYTHON_VERSION) -Wl$(comma)-rpath=$(STAGING_DIR_HOSTPKG)/lib" \ + _PYTHON_HOST_PLATFORM=linux2 +endef + # $(1) => commands to execute before running pythons script # $(2) => python script and its arguments # $(3) => additional variables define Build/Compile/HostPyRunHost $(call HostPython, \ $(if $(1),$(1);) \ - CC="$(HOSTCC)" \ - CCSHARED="$(HOSTCC) $(HOST_FPIC)" \ - CXX="$(HOSTCXX)" \ - LD="$(HOSTCC)" \ - LDSHARED="$(HOSTCC) -shared" \ - CFLAGS="$(HOST_CFLAGS)" \ - CPPFLAGS="$(HOST_CPPFLAGS) -I$(HOST_PYTHON_INC_DIR)" \ - LDFLAGS="$(HOST_LDFLAGS) -lpython$(PYTHON_VERSION) -Wl$(comma)-rpath=$(STAGING_DIR_HOSTPKG)/lib" \ - _PYTHON_HOST_PLATFORM=linux2 \ + $(call host_python_settings) \ $(3) \ , \ $(2) \ @@ -63,6 +68,7 @@ endef # Note: I shamelessly copied this from Yousong's logic (from python-packages); HOST_PYTHON_PIP:=$(STAGING_DIR_HOSTPKG)/bin/pip$(PYTHON_VERSION) define host_python_pip_install + $(call host_python_settings) \ $(HOST_PYTHON_PIP) install \ --root=$(1) \ --prefix=$(2) \ diff --git a/lang/python/python3/files/python3-host.mk b/lang/python/python3/files/python3-host.mk index 96bbc19cc..4990d33a0 100644 --- a/lang/python/python3/files/python3-host.mk +++ b/lang/python/python3/files/python3-host.mk @@ -37,21 +37,26 @@ define HostPython3 $(HOST_PYTHON3_BIN) $(2); endef +define host_python3_settings + ARCH="$(HOST_ARCH)" \ + CC="$(HOSTCC)" \ + CCSHARED="$(HOSTCC) $(HOST_FPIC)" \ + CXX="$(HOSTCXX)" \ + LD="$(HOSTCC)" \ + LDSHARED="$(HOSTCC) -shared" \ + CFLAGS="$(HOST_CFLAGS)" \ + CPPFLAGS="$(HOST_CPPFLAGS) -I$(HOST_PYTHON3_INC_DIR)" \ + LDFLAGS="$(HOST_LDFLAGS) -lpython$(PYTHON3_VERSION) -Wl$(comma)-rpath=$(STAGING_DIR_HOSTPKG)/lib" \ + _PYTHON_HOST_PLATFORM=linux2 +endef + # $(1) => commands to execute before running pythons script # $(2) => python script and its arguments # $(3) => additional variables define Build/Compile/HostPy3RunHost $(call HostPython3, \ $(if $(1),$(1);) \ - CC="$(HOSTCC)" \ - CCSHARED="$(HOSTCC) $(HOST_FPIC)" \ - CXX="$(HOSTCXX)" \ - LD="$(HOSTCC)" \ - LDSHARED="$(HOSTCC) -shared" \ - CFLAGS="$(HOST_CFLAGS)" \ - CPPFLAGS="$(HOST_CPPFLAGS) -I$(HOST_PYTHON3_INC_DIR)" \ - LDFLAGS="$(HOST_LDFLAGS) -lpython$(PYTHON3_VERSION) -Wl$(comma)-rpath=$(STAGING_DIR_HOSTPKG)/lib" \ - _PYTHON_HOST_PLATFORM=linux2 \ + $(call host_python3_settings) \ $(3) \ , \ $(2) \ @@ -63,6 +68,7 @@ endef # Note: I shamelessly copied this from Yousong's logic (from python-packages); HOST_PYTHON3_PIP:=$(STAGING_DIR_HOSTPKG)/bin/pip$(PYTHON3_VERSION) define host_python3_pip_install + $(call host_python3_settings) \ $(HOST_PYTHON3_PIP) install \ --root=$(1) \ --prefix=$(2) \