From patchwork Fri Nov 20 20:54:41 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?J=C3=B6rg_Krause?= X-Patchwork-Id: 547042 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ozlabs.org (Postfix) with ESMTP id 1CE47141489 for ; Sat, 21 Nov 2015 07:55:25 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="key not found in DNS" (0-bit key; unprotected) header.d=embedded.rocks header.i=@embedded.rocks header.b=TlJBItN+; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 2491D95970; Fri, 20 Nov 2015 20:55:24 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9iRlk55B1dCj; Fri, 20 Nov 2015 20:55:23 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 49A399560D; Fri, 20 Nov 2015 20:55:23 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id BC6101C1562 for ; Fri, 20 Nov 2015 20:55:21 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id B76EF8AF99 for ; Fri, 20 Nov 2015 20:55:21 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GWliymjeUPqi for ; Fri, 20 Nov 2015 20:55:20 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mout01.posteo.de (mout01.posteo.de [185.67.36.65]) by whitealder.osuosl.org (Postfix) with ESMTPS id 4366B918D1 for ; Fri, 20 Nov 2015 20:55:20 +0000 (UTC) Received: from dovecot03.posteo.de (dovecot03.posteo.de [172.16.0.13]) by mout01.posteo.de (Postfix) with ESMTPS id E830F20A30 for ; Fri, 20 Nov 2015 21:55:17 +0100 (CET) Received: from mail.posteo.de (localhost [127.0.0.1]) by dovecot03.posteo.de (Postfix) with ESMTPSA id 3p2VWT5GlWz5vN8 for ; Fri, 20 Nov 2015 21:55:17 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail.embedded.rocks (Postfix) with ESMTP id 4CB46EE0C54; Fri, 20 Nov 2015 21:55:16 +0100 (CET) Authentication-Results: mail.embedded.rocks (amavisd-new); dkim=pass reason="pass (just generated, assumed good)" header.d=embedded.rocks DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embedded.rocks; h=content-transfer-encoding:content-type:content-type :mime-version:references:in-reply-to:x-mailer:message-id:date :date:subject:subject:from:from:received:received; s=default; t= 1448052904; x=1448657705; bh=3d/0MdD88Ah4oXp3zj5N3xrODW4mNnHMR24 pLgSRs7Y=; b=TlJBItN+JB08NQnOyKqLrEFSkeyPYiwtGwVIZr6gW3u7rtXzMxJ 333oQrwOY96tR8hKc6VdkS4nsN8sibb6z37JQJ76HPhex6+OnVphJeB99TvbgxQF 4ZOgYOdBznfGGK+bnpmrs+eKdkrEUxWE+FdvIa5gZrGHHVA55wfq/AQcQH6lqa7I hN/MHAWGL8E9r35/RKacFRuADQbAcSDhZs9FLmvnz2kmOP/Mz+P8wTUMYdeq9CC8 ZQ5zKAfXRt6DgfGGHHRNLbrggJ6fc/yV0DYkEIHMAifxRfmeEFoAuKoiuiAA2wCc /UdPlYgfWxiPRACpRylb6YXidW5yLeLcznA== X-Virus-Scanned: Debian amavisd-new at mail.embedded.rocks Received: from mail.embedded.rocks ([127.0.0.1]) by localhost (mail.embedded.rocks [127.0.0.1]) (amavisd-new, port 10025) with ESMTP id Pe2quRdcZ9nW; Fri, 20 Nov 2015 21:55:04 +0100 (CET) Received: from nzxt.fritz.box (x5f72ec37.dyn.telefonica.de [95.114.236.55]) (Authenticated sender: joerg.krause@embedded.rocks) by mail.embedded.rocks (Postfix) with ESMTPSA; Fri, 20 Nov 2015 21:55:04 +0100 (CET) From: =?UTF-8?q?J=C3=B6rg=20Krause?= To: buildroot@buildroot.org Date: Fri, 20 Nov 2015 21:54:41 +0100 Message-Id: <1448052881-29222-3-git-send-email-joerg.krause@embedded.rocks> X-Mailer: git-send-email 2.6.2 In-Reply-To: <1448052881-29222-1-git-send-email-joerg.krause@embedded.rocks> References: <1448052881-29222-1-git-send-email-joerg.krause@embedded.rocks> MIME-Version: 1.0 Subject: [Buildroot] [PATCH 3/3] package/zmqpp: fix static build issues X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" The Makefile for zmqpp builds both shared and static libraries and the client binary. This leads to several build issues in pure static library contexts: * R_ARM_TLS_LE32 relocation not permitted in shared object * relocation R_ARC_32_ME against `_ZSt7nothrow' can not be used when making a shared object; recompile with -fPIC We add a minimal patch to add some basic handling of building a shared or a static library only. Additionally, disable the client for static only builds. Fixes: http://autobuild.buildroot.net/results/345/345771eb488c60585e388fbbf4490df936e88e19/ http://autobuild.buildroot.net/results/21b/21b6912c70a5c300bdabde53bee6a1d9cc3bbb02/ http://autobuild.buildroot.net/results/d98/d9882d2ba00da16f76cea6d86a84cd4815ebbba2/ Signed-off-by: Jörg Krause --- ...imal-support-for-disabling-shared-library.patch | 75 ++++++++++++++++++++++ package/zmqpp/Config.in | 5 +- package/zmqpp/zmqpp.mk | 6 +- 3 files changed, 83 insertions(+), 3 deletions(-) create mode 100644 package/zmqpp/0002-Add-minimal-support-for-disabling-shared-library.patch diff --git a/package/zmqpp/0002-Add-minimal-support-for-disabling-shared-library.patch b/package/zmqpp/0002-Add-minimal-support-for-disabling-shared-library.patch new file mode 100644 index 0000000..c0d4e8f --- /dev/null +++ b/package/zmqpp/0002-Add-minimal-support-for-disabling-shared-library.patch @@ -0,0 +1,75 @@ +From 547d707370c128f223a6147de6b012a83a9fc3f3 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?J=C3=B6rg=20Krause?= +Date: Fri, 20 Nov 2015 19:51:50 +0100 +Subject: [PATCH 2/2] Add minimal support for disabling shared library +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Jörg Krause +--- + Makefile | 13 +++++++++---- + 1 file changed, 9 insertions(+), 4 deletions(-) + +diff --git a/Makefile b/Makefile +index 7d63077..2e9aed3 100644 +--- a/Makefile ++++ b/Makefile +@@ -71,7 +71,7 @@ ifneq (,$(findstring $(CONFIG),release loadtest)) + CONFIG_FLAGS = -O3 -funroll-loops -ffast-math -finline-functions -fomit-frame-pointer -DNO_DEBUG_LOG -DNO_TRACE_LOG -DNDEBUG + endif + +-COMMON_FLAGS = -MMD -std=c++0x -pipe -Wall -fPIC \ ++COMMON_FLAGS = -MMD -std=c++0x -pipe -Wall \ + -DBUILD_ENV=$(CONFIG) \ + -DBUILD_VERSION='"$(APP_VERSION)"' \ + -DBUILD_VERSION_MAJOR=$(VERSION_MAJOR) \ +@@ -82,6 +82,10 @@ COMMON_FLAGS = -MMD -std=c++0x -pipe -Wall -fPIC \ + -DBUILD_CLIENT_NAME='"$(CLIENT_TARGET)"' \ + -I$(SRC_PATH) + ++ifeq ($(BUILD_SHARED),yes) ++COMMON_FLAGS += -fPIC ++endif ++ + COMMON_LIBS = -lzmq + + LIBRARY_LIBS = +@@ -125,9 +129,11 @@ check: $(LIBRARY_SHARED) $(LIBRARY_ARCHIVE) test + + install: + install -m 644 $(ALL_LIBRARY_INCLUDES) $(INCLUDEDIR)/$(LIBRARY_DIR) ++ifeq ($(BUILD_SHARED),yes) + install -m 755 $(BUILD_PATH)/$(LIBRARY_SHARED).$(VERSION_MAJOR) $(LIBDIR)/$(LIBRARY_SHARED).$(APP_VERSION) + ln -sf $(LIBRARY_SHARED).$(APP_VERSION) $(LIBDIR)/$(LIBRARY_SHARED).$(VERSION_MAJOR) + ln -sf $(LIBRARY_SHARED).$(APP_VERSION) $(LIBDIR)/$(LIBRARY_SHARED) ++endif + if [ -f $(BUILD_PATH)/$(CLIENT_TARGET) ]; then install -m 755 $(BUILD_PATH)/$(CLIENT_TARGET) $(BINDIR); fi + $(LDCONFIG) + @echo "use make installcheck to test the install" +@@ -148,7 +154,7 @@ clean: + + client: $(CLIENT_TARGET) + +-library: $(LIBRARY_SHARED) $(LIBRARY_ARCHIVE) ++library: $(if $(BUILD_SHARED),$(LIBRARY_SHARED)) $(LIBRARY_ARCHIVE) + + # + # BUILD Targets +@@ -160,7 +166,7 @@ $(LIBRARY_SHARED): $(ALL_LIBRARY_OBJECTS) + $(LIBRARY_ARCHIVE): $(ALL_LIBRARY_OBJECTS) + $(AR) crf $(BUILD_PATH)/$@ $^ + +-$(CLIENT_TARGET): $(LIBRARY_SHARED) $(LIBRARY_ARCHIVE) $(ALL_CLIENT_OBJECTS) ++$(CLIENT_TARGET): $(if $(BUILD_SHARED),$(LIBRARY_SHARED)) $(LIBRARY_ARCHIVE) $(ALL_CLIENT_OBJECTS) + $(LD) $(LDFLAGS) -o $(BUILD_PATH)/$@ $(ALL_CLIENT_OBJECTS) $(CLIENT_LIBS) $(COMMON_LIBS) + + $(TESTS_TARGET): $(LIBRARY_SHARED) $(LIBRARY_ARCHIVE) $(ALL_TEST_OBJECTS) +@@ -187,4 +193,3 @@ test: $(TESTS_TARGET) + $(OBJECT_PATH)/%.o: $(SRC_PATH)/%.cpp + -mkdir -p $(dir $@) + $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(COMMON_FLAGS) $(CONFIG_FLAGS) -c -o $@ $< +- +-- +2.6.2 + diff --git a/package/zmqpp/Config.in b/package/zmqpp/Config.in index a10602f..0379224 100644 --- a/package/zmqpp/Config.in +++ b/package/zmqpp/Config.in @@ -22,6 +22,7 @@ if BR2_PACKAGE_ZMQPP config BR2_PACKAGE_ZMQPP_CLIENT bool "zmqpp client" + depends on !BR2_STATIC_LIBS depends on BR2_TOOLCHAIN_HAS_THREADS # boost depends on BR2_PACKAGE_BOOST_ARCH_SUPPORTS select BR2_PACKAGE_BOOST @@ -30,8 +31,8 @@ config BR2_PACKAGE_ZMQPP_CLIENT Build and install the zmqpp client, a command line tool that can be used to listen or send to zeromq sockets. -comment "zmqpp client needs a toolchain w/ threads" +comment "zmqpp client needs a toolchain w/ dynamic library, threads" depends on BR2_PACKAGE_BOOST_ARCH_SUPPORTS - depends on !BR2_TOOLCHAIN_HAS_THREADS + depends on BR2_STATIC_LIBS || !BR2_TOOLCHAIN_HAS_THREADS endif diff --git a/package/zmqpp/zmqpp.mk b/package/zmqpp/zmqpp.mk index e506eaf..77ff209 100644 --- a/package/zmqpp/zmqpp.mk +++ b/package/zmqpp/zmqpp.mk @@ -19,10 +19,14 @@ ifeq ($(BR2_PACKAGE_ZMQPP_CLIENT),y) ZMQPP_DEPENDENCIES += boost endif +ifeq ($(BR2_SHARED_LIBS),y) +TARGET_CONFIGURE_OPTS += BUILD_SHARED=yes +endif + define ZMQPP_BUILD_CMDS $(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) \ LDFLAGS="$(ZMQPP_LDFLAGS)" \ - $(ZMQPP_MAKE_OPTS) $(if $(BR2_PACKAGE_ZMQPP_CLIENT),all) -C $(@D) + $(ZMQPP_MAKE_OPTS) $(if $(BR2_PACKAGE_ZMQPP_CLIENT),client,library) -C $(@D) endef define ZMQPP_INSTALL_TARGET_CMDS