From patchwork Fri Apr 6 08:18:35 2018 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: 895632 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@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=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=embedded.rocks 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 40HXf66t6kz9s16 for ; Fri, 6 Apr 2018 18:18:54 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id BB8A82281E; Fri, 6 Apr 2018 08:18:51 +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 kd89Ap1oeplK; Fri, 6 Apr 2018 08:18:50 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 1C2E72266B; Fri, 6 Apr 2018 08:18:50 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id BA3891C219A for ; Fri, 6 Apr 2018 08:18:48 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id B731A2266B for ; Fri, 6 Apr 2018 08:18:48 +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 lSntbq+amp5H for ; Fri, 6 Apr 2018 08:18:46 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mout01.posteo.de (mout01.posteo.de [185.67.36.141]) by silver.osuosl.org (Postfix) with ESMTPS id 7A2E822665 for ; Fri, 6 Apr 2018 08:18:46 +0000 (UTC) Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id 6645F2106F for ; Fri, 6 Apr 2018 10:18:43 +0200 (CEST) Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 40HXdq66qGz9rxK for ; Fri, 6 Apr 2018 10:18:39 +0200 (CEST) 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 37sbaiOzSwqu; Fri, 6 Apr 2018 10:18:37 +0200 (CEST) Received: from nzxt.fritz.box (port-92-195-26-226.dynamic.qsc.de [92.195.26.226]) (Authenticated sender: joerg.krause@embedded.rocks) by mail.embedded.rocks (Postfix) with ESMTPSA; Fri, 6 Apr 2018 10:18:37 +0200 (CEST) From: =?utf-8?q?J=C3=B6rg_Krause?= To: buildroot@buildroot.org Date: Fri, 6 Apr 2018 10:18:35 +0200 Message-Id: <20180406081835.4239-1-joerg.krause@embedded.rocks> X-Mailer: git-send-email 2.17.0 MIME-Version: 1.0 Subject: [Buildroot] [PATCH] libbsd: add upstream patch to fix musl build issue X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 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" Commit d879be3049598f35d7b959784e1a6c2811ba2036 enabled the build for non-glibc toolchains and added a patch from upstream to fix one remaining build issue with musl. The upstream patch defines the glibc specific macro `__GLIBC_PREREQ` in `include/bsd/sys/cdefs.h`, but the patch does not include this header file in `include/bsd/stdlib.h` which uses the macro. Upstream did committed an earlier patch which adds this header inclusion to `include/bsd/stdlib.h`. So, add this upstream patch as well to fix a build error when building the hcitop tool from the not yet added package bluez-alsa. Note, that the upstream patch address the issue that `` is a non-portable header. However, this is not the issue which needs to be fixed by this patch, but solely the needed inclusion of the `include/bsd/stdlib.h` header file, to see the definition of `__GLIBC_PREREQ`. Backported from: 11ec8f1e5dfa1c10e0c9fb94879b6f5b96ba52dd Signed-off-by: Jörg Krause --- ...3-Handle-systems-missing-sys-cdefs.h.patch | 230 ++++++++++++++++++ 1 file changed, 230 insertions(+) create mode 100644 package/libbsd/0003-Handle-systems-missing-sys-cdefs.h.patch diff --git a/package/libbsd/0003-Handle-systems-missing-sys-cdefs.h.patch b/package/libbsd/0003-Handle-systems-missing-sys-cdefs.h.patch new file mode 100644 index 0000000000..2cf7a5f09f --- /dev/null +++ b/package/libbsd/0003-Handle-systems-missing-sys-cdefs.h.patch @@ -0,0 +1,230 @@ +From 11ec8f1e5dfa1c10e0c9fb94879b6f5b96ba52dd Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Tue, 6 Mar 2018 01:41:35 +0100 +Subject: [PATCH] Handle systems missing +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This is a non-portable header, and we cannot expect it to be provided by +the system libc (e.g. musl). We just need and rely on declaration that +we have defined ourselves in our own . So we switch to +only ever assume that. + +Fixes: https://bugs.freedesktop.org/105281 + +Backported from: 11ec8f1e5dfa1c10e0c9fb94879b6f5b96ba52dd + +Signed-off-by: Guillem Jover +Signed-off-by: Jörg Krause +--- + include/bsd/libutil.h | 4 ++++ + include/bsd/md5.h | 4 ++++ + include/bsd/nlist.h | 4 ++++ + include/bsd/readpassphrase.h | 4 ++++ + include/bsd/stdlib.h | 4 ++++ + include/bsd/string.h | 4 ++++ + include/bsd/stringlist.h | 5 +++++ + include/bsd/sys/queue.h | 4 ++++ + include/bsd/sys/tree.h | 4 ++++ + include/bsd/timeconv.h | 4 ++++ + include/bsd/vis.h | 4 ++++ + include/bsd/wchar.h | 4 ++++ + 12 files changed, 49 insertions(+) + +diff --git a/include/bsd/libutil.h b/include/bsd/libutil.h +index 45b3b15..ccca29a 100644 +--- a/include/bsd/libutil.h ++++ b/include/bsd/libutil.h +@@ -40,7 +40,11 @@ + #define LIBBSD_LIBUTIL_H + + #include ++#ifdef LIBBSD_OVERLAY + #include ++#else ++#include ++#endif + #include + #include + #include +diff --git a/include/bsd/md5.h b/include/bsd/md5.h +index 5f3ae46..bf36a30 100644 +--- a/include/bsd/md5.h ++++ b/include/bsd/md5.h +@@ -27,7 +27,11 @@ typedef struct MD5Context { + uint8_t buffer[MD5_BLOCK_LENGTH]; /* input buffer */ + } MD5_CTX; + ++#ifdef LIBBSD_OVERLAY + #include ++#else ++#include ++#endif + #include + + __BEGIN_DECLS +diff --git a/include/bsd/nlist.h b/include/bsd/nlist.h +index cb297e8..8767117 100644 +--- a/include/bsd/nlist.h ++++ b/include/bsd/nlist.h +@@ -27,7 +27,11 @@ + #ifndef LIBBSD_NLIST_H + #define LIBBSD_NLIST_H + ++#ifdef LIBBSD_OVERLAY + #include ++#else ++#include ++#endif + + struct nlist { + union { +diff --git a/include/bsd/readpassphrase.h b/include/bsd/readpassphrase.h +index 14744b8..5eb8021 100644 +--- a/include/bsd/readpassphrase.h ++++ b/include/bsd/readpassphrase.h +@@ -31,7 +31,11 @@ + #define RPP_SEVENBIT 0x10 /* Strip the high bit from input. */ + #define RPP_STDIN 0x20 /* Read from stdin, not /dev/tty */ + ++#ifdef LIBBSD_OVERLAY + #include ++#else ++#include ++#endif + #include + + __BEGIN_DECLS +diff --git a/include/bsd/stdlib.h b/include/bsd/stdlib.h +index ebc9638..8d33d1f 100644 +--- a/include/bsd/stdlib.h ++++ b/include/bsd/stdlib.h +@@ -42,7 +42,11 @@ + #ifndef LIBBSD_STDLIB_H + #define LIBBSD_STDLIB_H + ++#ifdef LIBBSD_OVERLAY + #include ++#else ++#include ++#endif + #include + #include + +diff --git a/include/bsd/string.h b/include/bsd/string.h +index 6798bf6..29097f6 100644 +--- a/include/bsd/string.h ++++ b/include/bsd/string.h +@@ -33,7 +33,11 @@ + #ifndef LIBBSD_STRING_H + #define LIBBSD_STRING_H + ++#ifdef LIBBSD_OVERLAY + #include ++#else ++#include ++#endif + #include + + __BEGIN_DECLS +diff --git a/include/bsd/stringlist.h b/include/bsd/stringlist.h +index ff30cac..dd71496 100644 +--- a/include/bsd/stringlist.h ++++ b/include/bsd/stringlist.h +@@ -31,7 +31,12 @@ + + #ifndef LIBBSD_STRINGLIST_H + #define LIBBSD_STRINGLIST_H ++ ++#ifdef LIBBSD_OVERLAY + #include ++#else ++#include ++#endif + #include + + /* +diff --git a/include/bsd/sys/queue.h b/include/bsd/sys/queue.h +index 4a94ea7..ac00026 100644 +--- a/include/bsd/sys/queue.h ++++ b/include/bsd/sys/queue.h +@@ -33,7 +33,11 @@ + #ifndef LIBBSD_SYS_QUEUE_H + #define LIBBSD_SYS_QUEUE_H + ++#ifdef LIBBSD_OVERLAY + #include ++#else ++#include ++#endif + + /* + * This file defines four types of data structures: singly-linked lists, +diff --git a/include/bsd/sys/tree.h b/include/bsd/sys/tree.h +index 628bec0..325b382 100644 +--- a/include/bsd/sys/tree.h ++++ b/include/bsd/sys/tree.h +@@ -30,7 +30,11 @@ + #ifndef LIBBSD_SYS_TREE_H + #define LIBBSD_SYS_TREE_H + ++#ifdef LIBBSD_OVERLAY + #include ++#else ++#include ++#endif + + /* + * This file defines data structures for different types of trees: +diff --git a/include/bsd/timeconv.h b/include/bsd/timeconv.h +index e2a2c55..a426bd3 100644 +--- a/include/bsd/timeconv.h ++++ b/include/bsd/timeconv.h +@@ -41,7 +41,11 @@ + #ifndef LIBBSD_TIMECONV_H + #define LIBBSD_TIMECONV_H + ++#ifdef LIBBSD_OVERLAY + #include ++#else ++#include ++#endif + #include + #include + +diff --git a/include/bsd/vis.h b/include/bsd/vis.h +index 970dfdd..ab5430c 100644 +--- a/include/bsd/vis.h ++++ b/include/bsd/vis.h +@@ -72,7 +72,11 @@ + */ + #define UNVIS_END 1 /* no more characters */ + ++#ifdef LIBBSD_OVERLAY + #include ++#else ++#include ++#endif + + __BEGIN_DECLS + char *vis(char *, int, int, int); +diff --git a/include/bsd/wchar.h b/include/bsd/wchar.h +index 33a500e..7216503 100644 +--- a/include/bsd/wchar.h ++++ b/include/bsd/wchar.h +@@ -40,7 +40,11 @@ + #define LIBBSD_WCHAR_H + + #include ++#ifdef LIBBSD_OVERLAY + #include ++#else ++#include ++#endif + #include + + __BEGIN_DECLS +-- +2.17.0 +