From patchwork Thu Sep 28 18:16:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baruch Siach X-Patchwork-Id: 819712 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y32w83tDDz9tX9 for ; Fri, 29 Sep 2017 04:17:12 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id CBA6530855; Thu, 28 Sep 2017 18:17:05 +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 y0GDhmuEOkRX; Thu, 28 Sep 2017 18:17:02 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id F19AD3083C; Thu, 28 Sep 2017 18:17:01 +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 1A2F81C0057 for ; Thu, 28 Sep 2017 18:17:00 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 0524D89650 for ; Thu, 28 Sep 2017 18:17:00 +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 NUyRZDYZcTGN for ; Thu, 28 Sep 2017 18:16:57 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mx.tkos.co.il (guitar.tcltek.co.il [192.115.133.116]) by whitealder.osuosl.org (Postfix) with ESMTPS id C4BA78963C for ; Thu, 28 Sep 2017 18:16:56 +0000 (UTC) Received: from tarshish.tkos.co.il (unknown [10.0.8.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx.tkos.co.il (Postfix) with ESMTPSA id 9D81D4400D6; Thu, 28 Sep 2017 21:16:35 +0300 (IDT) From: Baruch Siach To: buildroot@busybox.net Date: Thu, 28 Sep 2017 21:16:40 +0300 Message-Id: X-Mailer: git-send-email 2.14.2 Subject: [Buildroot] [PATCH v2] iproute2: fix static build with uClibc 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: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Version 4.13 added a local definition of strlcpy(). This clashes with the uClibc provided one when linking statically. Add a patch that detects libc provided strlcpy(), and avoids the multiple definition. Fixes: http://autobuild.buildroot.net/results/f34/f34684dcdb47938a3da8b00c8b29000cc23b4e3d/ http://autobuild.buildroot.net/results/a01/a01c5775945f5ffe75451722b676fc93333a0f14/ http://autobuild.buildroot.net/results/0ee/0eeab1a0ca943f9a035a0d458ddf9cc210bc87f4/ Signed-off-by: Baruch Siach --- v2: Fix order of strlcpy parameters in the patch as noted in upstream review --- .../0003-lib-fix-multiple-strlcpy-definition.patch | 103 +++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 package/iproute2/0003-lib-fix-multiple-strlcpy-definition.patch diff --git a/package/iproute2/0003-lib-fix-multiple-strlcpy-definition.patch b/package/iproute2/0003-lib-fix-multiple-strlcpy-definition.patch new file mode 100644 index 000000000000..05e9c38084ac --- /dev/null +++ b/package/iproute2/0003-lib-fix-multiple-strlcpy-definition.patch @@ -0,0 +1,103 @@ +From 5b55bbe48a29cf6a72cef9f424835f6244e66351 Mon Sep 17 00:00:00 2001 +From: Baruch Siach +Date: Tue, 26 Sep 2017 13:45:21 +0300 +Subject: [PATCH] lib: fix multiple strlcpy definition + +Some C libraries, like uClibc and musl, provide BSD compatible +strlcpy(). Add check_strlcpy() to configure, and avoid defining strlcpy +and strlcat when the C library provides them. + +This fixes the following static link error: + +.../sysroot/usr/lib/libc.a(strlcpy.os): In function `strlcpy': +strlcpy.c:(.text+0x0): multiple definition of `strlcpy' +../lib/libutil.a(utils.o):utils.c:(.text+0x1ddc): first defined here +collect2: error: ld returned 1 exit status + +[baruch: backported from upstream submission to 4.13] +Signed-off-by: Baruch Siach +--- +Upstream status: https://patchwork.ozlabs.org/patch/819705/ +--- + configure | 24 ++++++++++++++++++++++++ + lib/Makefile | 4 ++++ + lib/utils.c | 2 ++ + 3 files changed, 30 insertions(+) + +diff --git a/configure b/configure +index 88cbdb825689..4964b998059e 100755 +--- a/configure ++++ b/configure +@@ -325,6 +325,27 @@ EOF + rm -f $TMPDIR/dbtest.c $TMPDIR/dbtest + } + ++check_strlcpy() ++{ ++ cat >$TMPDIR/strtest.c < ++int main(int argc, char **argv) { ++ char dst[10]; ++ strlcpy(dst, "test", sizeof(dst)); ++ return 0; ++} ++EOF ++ $CC -I$INCLUDE -o $TMPDIR/strtest $TMPDIR/strtest.c >/dev/null 2>&1 ++ if [ $? -eq 0 ] ++ then ++ echo "no" ++ else ++ echo "NEED_STRLCPY:=y" >>Config ++ echo "yes" ++ fi ++ rm -f $TMPDIR/strtest.c $TMPDIR/strtest ++} ++ + quiet_config() + { + cat <