From 45d2000f9caed2d797199dcfbaaac120dce00d99 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Mon, 17 Jun 2019 11:07:23 -0700 Subject: [PATCH 1/5] boost: Install HOST libraries to HOSTPKG After talking to @jow on IRC, we found two problems. STAGING_DIR_HOST is designed for tools, not host packages. Changing this to HOSTPKG allows CMake and pkgconfig to work properly with fbthrift. The host-libraries should not be modular like this for host packages. Changed to eliminate them and to only build the needed ones. This can be changed as conditions change. Signed-off-by: Rosen Penev --- libs/boost/Makefile | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/libs/boost/Makefile b/libs/boost/Makefile index b858822cd..9f0c0b473 100644 --- a/libs/boost/Makefile +++ b/libs/boost/Makefile @@ -13,7 +13,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=boost PKG_VERSION:=1.70.0 PKG_SOURCE_VERSION:=1_70_0 -PKG_RELEASE:=5 +PKG_RELEASE:=6 PKG_SOURCE:=$(PKG_NAME)_$(PKG_SOURCE_VERSION).tar.bz2 PKG_SOURCE_URL:=@SF/$(PKG_NAME)/$(PKG_NAME)/$(PKG_VERSION) https://dl.bintray.com/boostorg/release/$(PKG_VERSION)/source/ @@ -294,16 +294,6 @@ define Package/boost/config ) endmenu - menu "Select Boost libraries for Host build" - comment "Libraries for Host build" - - $(foreach lib,$(BOOST_LIBS), \ - config boost-host-build-$(lib) - bool "Boost $(lib) $(if $(findstring python,$(lib)),$(paren_left)v$(if $(findstring 3,$(lib)),$(BOOST_PYTHON3_VER),$(BOOST_PYTHON_VER))$(paren_right) ,)library." - default n - ) - endmenu - endef PKG_CONFIG_DEPENDS:= CONFIG_PACKAGE_boost-test @@ -326,7 +316,6 @@ define DefineBoostLibrary BOOST_DEPENDS+= +$(if $(4),$(4):boost-$(1),boost-$(1)) PKG_CONFIG_DEPENDS+= CONFIG_PACKAGE_boost-$(1) - HOST_CONFIG_DEPENDS+= CONFIG_boost-host-build-$(1) BOOST_LIBS+= $(1) @@ -379,11 +368,8 @@ define Host/Compile ( cd $(HOST_BUILD_DIR)/tools/build/src/engine ; ./build.sh gcc ) ( cd $(HOST_BUILD_DIR) ; \ - ./bootstrap.sh --prefix=$(STAGING_DIR_HOST) \ - --with-libraries=$(subst $() $(),$(comma),$(strip \ - headers \ - $(foreach lib,$(BOOST_LIBS), \ - $(if $(findstring python,$(lib)),,$(if $(CONFIG_boost-host-build-$(lib)),$(lib)))))) ; \ + ./bootstrap.sh --prefix=$(STAGING_DIR_HOSTPKG) \ + --with-libraries=atomic,chrono,date_time,filesystem,headers,thread,system ;\ ./b2 --ignore-site-config install ) endef From 2838fbc38db60c686bf6cd9f1b361d3b50326fd1 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Mon, 17 Jun 2019 11:32:52 -0700 Subject: [PATCH 2/5] libfolly: Fix compilation for older ARM platforms ARM6 and below do not support the yield instruction. Do not use it there. Signed-off-by: Rosen Penev --- libs/libfolly/Makefile | 2 +- libs/libfolly/patches/103-arm-yield.patch | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 libs/libfolly/patches/103-arm-yield.patch diff --git a/libs/libfolly/Makefile b/libs/libfolly/Makefile index 8f4cc9dc6..b731a7d69 100644 --- a/libs/libfolly/Makefile +++ b/libs/libfolly/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libfolly PKG_VERSION:=2019.06.10.00 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/facebook/folly/tar.gz/v$(PKG_VERSION)? diff --git a/libs/libfolly/patches/103-arm-yield.patch b/libs/libfolly/patches/103-arm-yield.patch new file mode 100644 index 000000000..f8695261f --- /dev/null +++ b/libs/libfolly/patches/103-arm-yield.patch @@ -0,0 +1,11 @@ +--- a/folly/portability/Asm.h ++++ b/folly/portability/Asm.h +@@ -38,7 +38,7 @@ inline void asm_volatile_pause() { + ::_mm_pause(); + #elif defined(__i386__) || FOLLY_X64 + asm volatile("pause"); +-#elif FOLLY_AARCH64 || defined(__arm__) ++#elif FOLLY_AARCH64 || (defined(__arm__) && !(__ARM_ARCH < 7)) + asm volatile("yield"); + #elif FOLLY_PPC64 + asm volatile("or 27,27,27"); From 9af485036fdf94e00c1e1a32dab986299681dbd3 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Mon, 17 Jun 2019 11:34:47 -0700 Subject: [PATCH 3/5] fbthrift: Install to STAGING_DIR_HOSTPKG As part of the boost change. Also get rid of various CMake options as CMake can find everything properly now. Signed-off-by: Rosen Penev --- libs/fbthrift/Makefile | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/libs/fbthrift/Makefile b/libs/fbthrift/Makefile index 7abdd4c97..823436fd8 100644 --- a/libs/fbthrift/Makefile +++ b/libs/fbthrift/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=fbthrift PKG_VERSION:=2019.06.10.00 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/facebook/fbthrift/tar.gz/v$(PKG_VERSION)? @@ -12,10 +12,9 @@ PKG_MAINTAINER:=Amol Bhave PKG_LICENSE:=Apache-2.0 PKG_LICENSE_FILES:=LICENSE -HOST_BUILD_DEPENDS:=boost/host libmstch/host +HOST_BUILD_DEPENDS:=libmstch/host PKG_BUILD_DEPENDS:=fbthrift/host -HOST_BUILD_PREFIX:=$(STAGING_DIR_HOST) HOST_BUILD_PARALLEL:=1 PKG_BUILD_PARALLEL:=1 CMAKE_INSTALL:=1 @@ -28,9 +27,7 @@ define Package/fbthrift SECTION:=libs CATEGORY:=Libraries TITLE:=Facebook's branch of Apache Thrift, including a new C++ server. - DEPENDS:=+libwangle +libfmt +libmstch +librsocket-cpp \ - +@boost-host-build-chrono +@boost-host-build-date_time +@boost-host-build-atomic \ - +@boost-host-build-thread +@boost-host-build-system +@boost-host-build-filesystem + DEPENDS:=+libwangle +libfmt +librsocket-cpp endef define Package/fbthrift/description @@ -39,17 +36,17 @@ endef CMAKE_HOST_OPTIONS += \ -DBoost_NO_BOOST_CMAKE=ON \ - -Dcompiler_only=ON \ -DCMAKE_SKIP_RPATH=FALSE \ - -DCMAKE_INSTALL_RPATH="${STAGING_DIR_HOST}/lib" \ + -DCMAKE_INSTALL_RPATH="${STAGING_DIR_HOSTPKG}/lib" \ + -Dcompiler_only=ON CMAKE_OPTIONS += \ -DBoost_NO_BOOST_CMAKE=ON \ -DBUILD_SHARED_LIBS=ON \ -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ -Dlib_only=ON \ - -DTHRIFT1="$(STAGING_DIR_HOST)/bin/thrift1" \ - -DTHRIFT_COMPILER_INCLUDE="$(STAGING_DIR_HOST)/include/" + -DTHRIFT1="$(STAGING_DIR_HOSTPKG)/bin/thrift1" \ + -DTHRIFT_COMPILER_INCLUDE="$(STAGING_DIR_HOSTPKG)/include/" define Package/fbthrift/install $(INSTALL_DIR) $(1)/usr/lib From e4da1cb462a4f3d90674042f8e01b8c8c0224230 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Mon, 17 Jun 2019 12:11:52 -0700 Subject: [PATCH 4/5] libmstch: Switch HOST to HOSTPKG HOST should be used by tools only, not for host packages. Other minor cleanups. Signed-off-by: Rosen Penev --- libs/libmstch/Makefile | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/libs/libmstch/Makefile b/libs/libmstch/Makefile index a5d128552..bff939a4e 100644 --- a/libs/libmstch/Makefile +++ b/libs/libmstch/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libmstch PKG_VERSION:=1.0.2 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/no1msd/mstch/tar.gz/$(PKG_VERSION)? @@ -10,36 +10,32 @@ PKG_HASH:=811ed61400d4e9d4f9ae0f7679a2ffd590f0b3c06b16f2798e1f89ab917cba6c PKG_BUILD_DIR:=$(BUILD_DIR)/mstch-$(PKG_VERSION) HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/mstch-$(PKG_VERSION) +PKG_MAINTAINER:=Amol Bhave PKG_LICENSE:=MIT PKG_LICENSE_FILES:=LICENSE -HOST_BUILD_DEPENDS:=boost boost/host - -PKG_BUILD_DEPENDS:=boost +HOST_BUILD_DEPENDS:=boost/host +PKG_BUILD_PARALLEL:=1 +CMAKE_INSTALL:=1 include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/host-build.mk include $(INCLUDE_DIR)/cmake.mk -HOST_BUILD_PREFIX:=$(STAGING_DIR_HOST) - -PKG_BUILD_PARALLEL:=1 -CMAKE_INSTALL:=1 -CMAKE_OPTIONS:= \ - -DCMAKE_POSITION_INDEPENDENT_CODE=True - define Package/libmstch SECTION:=libs CATEGORY:=Libraries TITLE:=Complete implementation of {{mustache}} templates using modern C++ DEPENDS:=+boost +boost-container URL:=https://github.com/no1msd/mstch - MAINTAINER:=Amol Bhave endef define Package/libmstch/description mstch is a complete implementation of {{mustache}} templates using modern C++ endef +CMAKE_OPTIONS += \ + -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE + $(eval $(call BuildPackage,libmstch)) $(eval $(call HostBuild)) From 4fe5a63b5e282ff77627e443402c6501bb286f52 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Mon, 17 Jun 2019 14:24:59 -0700 Subject: [PATCH 5/5] fbzmq: Switch to HOSTPKG Signed-off-by: Rosen Penev --- libs/fbzmq/Makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libs/fbzmq/Makefile b/libs/fbzmq/Makefile index d74ef4f6b..f25ed7c76 100644 --- a/libs/fbzmq/Makefile +++ b/libs/fbzmq/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=fbzmq PKG_VERSION:=2019.06.10.00 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/facebook/fbzmq/tar.gz/v$(PKG_VERSION)? @@ -12,6 +12,7 @@ PKG_MAINTAINER:=Amol Bhave PKG_LICENSE:=MIT PKG_LICENSE_FILES:=LICENSE +CMAKE_SOURCE_SUBDIR:=fbzmq PKG_BUILD_PARALLEL:=1 CMAKE_INSTALL:=1 @@ -29,13 +30,12 @@ define Package/fbzmq/description Facebook ZeroMQ wrappers. endef -CMAKE_SOURCE_SUBDIR:=fbzmq -CMAKE_OPTIONS:= \ +CMAKE_OPTIONS += \ -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ -DBUILD_TESTS=OFF \ -DBUILD_SHARED_LIBS=ON \ - -DTHRIFT1="$(STAGING_DIR_HOST)/bin/thrift1" \ - -DTHRIFT_COMPILER_INCLUDE="$(STAGING_DIR_HOST)/include/" + -DTHRIFT1="$(STAGING_DIR_HOSTPKG)/bin/thrift1" \ + -DTHRIFT_COMPILER_INCLUDE="$(STAGING_DIR_HOSTPKG)/include/" define Package/fbzmq/install $(INSTALL_DIR) $(1)/usr/lib