From patchwork Mon Nov 2 18:57:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabrice Fontaine X-Patchwork-Id: 1392450 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=bE9A/c9/; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CQ2JT45fBz9sTD for ; Tue, 3 Nov 2020 05:59:05 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id C509F20455; Mon, 2 Nov 2020 18:59:03 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id F7zOi3E5R+xa; Mon, 2 Nov 2020 18:59:00 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 74542203E3; Mon, 2 Nov 2020 18:59:00 +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 662031BF37E for ; Mon, 2 Nov 2020 18:58:59 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 62F65867A9 for ; Mon, 2 Nov 2020 18:58:59 +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 T+c7ILSDMQXv for ; Mon, 2 Nov 2020 18:58:56 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) by whitealder.osuosl.org (Postfix) with ESMTPS id 481F98678E for ; Mon, 2 Nov 2020 18:58:56 +0000 (UTC) Received: by mail-wr1-f49.google.com with SMTP id b3so9937719wrx.11 for ; Mon, 02 Nov 2020 10:58:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=RcsMSUXPeaMuT79eDbae5vsVwInkYdtkUPYiUJPBkC4=; b=bE9A/c9/ajXw0DTo++ouo6CxkGFipzABT5ahirMq/UznuAfHj0Y1yWmdrd/brd01iz UtxbGX7ix7HHgc+b1z1gxPx63hAsG0QceyRSRah2ZStyE4bIK7/A3VMqnURHyeNLm3bF flEWl0FeKitgWCMRZNytgyKevYRUkPAcvZ0JwQmk0IZkABMDX/VFp8cUlif537/mPhlR NHrYaqW2c1am+YgD8NtJdfvmKyC5zAZYvvnuakcjKEs85SyG5EYIqx6kQbqOer+WgaIV GghgfcHoly6bYVerW5p4rlJzLjaiFQpbfeawHs8BAtmSjebyxNkheyWhQuhZzymhGDBL lhFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=RcsMSUXPeaMuT79eDbae5vsVwInkYdtkUPYiUJPBkC4=; b=naZU3st/8nbjK8DP6CxNTDeu6OMECBJOmiUoqEXci9NvOe+HUPfT9s9TcLU3qkiPtw ifFXWxACWedM8xD7rxD046WhM9VlEYaBDipDD8NMDGsDUPyKQEnYSaJutaU9ZYpypl8L 67uUmNJcZ/pzFDKr/G5xnw6cSnv2D5wgho+TsOE0VbewtpK3OSvS9JpLVrxEDjoDzBGU b1BgtFkDKslHMhE2Endf2H/Awq7c34NV4o8F6UiAznz5bQSRpCQS7F7pkgx1nK6DULu6 rdXzFHAZAzyt/pPXB7IF2/dU5Vah8dAYWSY02S5CLjWL9nr4q2Hyd76W/oAvaAnHGMMK Lq+g== X-Gm-Message-State: AOAM530ThKqj5SKCXnDqUozaz427nxghK7Z1H8ImCFKQSXojuMk2zoPl PLz7al3m5o/XfoVT0jMCd7iIr47NPAE= X-Google-Smtp-Source: ABdhPJz3FBngiP/5fRgbZzqgA/2Ik30+48RCCfKLFGhfu3L5p49OTsxy94PBj6jXvD40ZsccFo3B4A== X-Received: by 2002:a5d:6681:: with SMTP id l1mr22289296wru.356.1604343534380; Mon, 02 Nov 2020 10:58:54 -0800 (PST) Received: from kali.home (2a01cb0881b76d00c2afd0dfa851d2b9.ipv6.abo.wanadoo.fr. [2a01:cb08:81b7:6d00:c2af:d0df:a851:d2b9]) by smtp.gmail.com with ESMTPSA id c64sm355564wme.29.2020.11.02.10.58.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Nov 2020 10:58:53 -0800 (PST) From: Fabrice Fontaine To: buildroot@buildroot.org Date: Mon, 2 Nov 2020 19:57:57 +0100 Message-Id: <20201102185757.79877-1-fontaine.fabrice@gmail.com> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Subject: [Buildroot] [PATCH 1/1] package/zeromq: add libbsd optional dependency X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fabrice Fontaine , Asaf Kahlon Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" libbsd is an optional dependency which is enabled by default since version 4.3.3 and https://github.com/zeromq/libzmq/commit/068385c951c0608edec6264d55ba9c4c923acccc Fixes: - http://autobuild.buildroot.org/results/51220b1b82774e8f6f6ed8593c58d2e3c31a1531 Signed-off-by: Fabrice Fontaine --- ...pp-fix-build-with-libbsd-and-strlcpy.patch | 107 ++++++++++++++++++ package/zeromq/zeromq.mk | 9 ++ 2 files changed, 116 insertions(+) create mode 100644 package/zeromq/0001-src-compat.hpp-fix-build-with-libbsd-and-strlcpy.patch diff --git a/package/zeromq/0001-src-compat.hpp-fix-build-with-libbsd-and-strlcpy.patch b/package/zeromq/0001-src-compat.hpp-fix-build-with-libbsd-and-strlcpy.patch new file mode 100644 index 0000000000..ea1166fd55 --- /dev/null +++ b/package/zeromq/0001-src-compat.hpp-fix-build-with-libbsd-and-strlcpy.patch @@ -0,0 +1,107 @@ +From 8cb5708829df9eacd58e1215ce7a1c135eb912b1 Mon Sep 17 00:00:00 2001 +From: Fabrice Fontaine +Date: Mon, 2 Nov 2020 00:04:14 +0100 +Subject: [PATCH] src/compat.hpp: fix build with libbsd and strlcpy + +Don't include bsd/string.h if strlcpy is also defined in string.h to +avoid the following build failure on uclibc: + +In file included from src/compat.hpp:41:0, + from src/ipc_address.cpp:31: +/tmp/instance-0/output-1/host/mips64el-buildroot-linux-uclibc/sysroot/usr/include/bsd/string.h:44:54: error: declaration of 'size_t strlcpy(char*, const char*, size_t)' has a different exception specifier + size_t strlcpy(char *dst, const char *src, size_t siz); + ^ +In file included from src/compat.hpp:34:0, + from src/ipc_address.cpp:31: +/tmp/instance-0/output-1/host/mips64el-buildroot-linux-uclibc/sysroot/usr/include/string.h:424:15: error: from previous declaration 'size_t strlcpy(char*, const char*, size_t) throw ()' + extern size_t strlcpy(char *__restrict dst, const char *__restrict src, + ^ + +Fixes: + - http://autobuild.buildroot.org/results/51220b1b82774e8f6f6ed8593c58d2e3c31a1531 + +Signed-off-by: Fabrice Fontaine +[Retrieved from: +https://github.com/zeromq/libzmq/commit/b2a0842063aaa464ca2d182f9d3fefc6493906d0] +--- + CMakeLists.txt | 4 +--- + configure.ac | 26 ++++++++++++-------------- + src/compat.hpp | 4 +++- + 3 files changed, 16 insertions(+), 18 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 85747f626..74dd99ae0 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -250,9 +250,7 @@ if(NOT MSVC) + set(ZMQ_HAVE_LIBBSD 1) + endif() + endif() +- if(NOT WITH_LIBBSD OR NOT LIBBSD_FOUND) +- check_cxx_symbol_exists(strlcpy string.h ZMQ_HAVE_STRLCPY) +- endif() ++ check_cxx_symbol_exists(strlcpy string.h ZMQ_HAVE_STRLCPY) + endif() + + # Select curve encryption library, defaults to tweetnacl To use libsodium instead, use --with-libsodium(must be +diff --git a/configure.ac b/configure.ac +index 58a78e75e..a7a1609af 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -812,20 +812,18 @@ if test "x$enable_libbsd" != "xno"; then + fi + ]) + fi +-if test "x$found_libbsd" != "xyes"; then +- AC_MSG_CHECKING([whether strlcpy is available]) +- AC_COMPILE_IFELSE( +- [AC_LANG_PROGRAM( +- [[#include ]], +- [[char buf [100]; size_t bar = strlcpy (buf, "foo", 100); (void)bar; return 0;]]) +- ],[ +- AC_MSG_RESULT([yes]) +- AC_DEFINE(ZMQ_HAVE_STRLCPY, [1], +- [strlcpy is available]) +- ],[ +- AC_MSG_RESULT([no]) +- ]) +-fi ++AC_MSG_CHECKING([whether strlcpy is available]) ++AC_COMPILE_IFELSE( ++ [AC_LANG_PROGRAM( ++ [[#include ]], ++ [[char buf [100]; size_t bar = strlcpy (buf, "foo", 100); (void)bar; return 0;]]) ++ ],[ ++ AC_MSG_RESULT([yes]) ++ AC_DEFINE(ZMQ_HAVE_STRLCPY, [1], ++ [strlcpy is available]) ++ ],[ ++ AC_MSG_RESULT([no]) ++]) + + # pthread_setname is non-posix, and there are at least 4 different implementations + AC_MSG_CHECKING([whether signature of pthread_setname_np() has 1 argument]) +diff --git a/src/compat.hpp b/src/compat.hpp +index 7c7a89275..47744b98e 100644 +--- a/src/compat.hpp ++++ b/src/compat.hpp +@@ -37,9 +37,10 @@ + #define strcasecmp _stricmp + #define strtok_r strtok_s + #else ++#ifndef ZMQ_HAVE_STRLCPY + #ifdef ZMQ_HAVE_LIBBSD + #include +-#elif !defined(ZMQ_HAVE_STRLCPY) ++#else + static inline size_t + strlcpy (char *dest_, const char *src_, const size_t dest_size_) + { +@@ -50,6 +51,7 @@ strlcpy (char *dest_, const char *src_, const size_t dest_size_) + return dest_size_ - remain; + } + #endif ++#endif + template + static inline int strcpy_s (char (&dest_)[size], const char *const src_) + { diff --git a/package/zeromq/zeromq.mk b/package/zeromq/zeromq.mk index 1520ea4411..2851af8bea 100644 --- a/package/zeromq/zeromq.mk +++ b/package/zeromq/zeromq.mk @@ -11,6 +11,8 @@ ZEROMQ_DEPENDENCIES = util-linux-libs ZEROMQ_CONF_OPTS = --disable-Werror --without-documentation ZEROMQ_LICENSE = LGPL-3.0+ with exceptions ZEROMQ_LICENSE_FILES = COPYING COPYING.LESSER +# We're patching configure.ac +ZEROMQ_AUTORECONF = YES # Assume these flags are always available. It is true, at least for # SOCK_CLOEXEC, since linux v2.6.27. @@ -53,6 +55,13 @@ else ZEROMQ_CONF_OPTS += --disable-drafts endif +ifeq ($(BR2_PACKAGE_LIBBSD),y) +ZEROMQ_DEPENDENCIES += libbsd +ZEROMQ_CONF_OPTS += --enable-libbsd +else +ZEROMQ_CONF_OPTS += --disable-libbsd +endif + # ZeroMQ uses libsodium if it's available. ifeq ($(BR2_PACKAGE_LIBSODIUM),y) ZEROMQ_DEPENDENCIES += libsodium