From patchwork Sat Aug 1 16:52:19 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: 502834 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ozlabs.org (Postfix) with ESMTP id C16A3140319 for ; Sun, 2 Aug 2015 02:52:34 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 1016932C21; Sat, 1 Aug 2015 16:52:34 +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 GyZVBnMS5JsJ; Sat, 1 Aug 2015 16:52:31 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 15B48268FF; Sat, 1 Aug 2015 16:52:31 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id E30301C1FAD for ; Sat, 1 Aug 2015 16:52:29 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id DF9CD94CFC for ; Sat, 1 Aug 2015 16:52:29 +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 l3yyzynGr0jS for ; Sat, 1 Aug 2015 16:52:28 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mx02.posteo.de (mx02.posteo.de [89.146.194.165]) by hemlock.osuosl.org (Postfix) with ESMTPS id 4F26E94CEF for ; Sat, 1 Aug 2015 16:52:28 +0000 (UTC) Received: from dovecot04.posteo.de (unknown [185.67.36.27]) by mx02.posteo.de (Postfix) with ESMTPS id C829D25ACC33 for ; Sat, 1 Aug 2015 18:52:25 +0200 (CEST) Received: from mail.posteo.de (localhost [127.0.0.1]) by dovecot04.posteo.de (Postfix) with ESMTPSA id 3mkBNT1WdFzFpW5 for ; Sat, 1 Aug 2015 18:52:24 +0200 (CEST) Received: from nzxt.fritz.box (nzxt.localdomain [192.168.178.46]) (Authenticated sender: joerg.krause@embedded.rocks) by embedded.rocks (Postfix) with ESMTPSA id D353D980379; Sat, 1 Aug 2015 18:52:23 +0200 (CEST) From: =?UTF-8?q?J=C3=B6rg=20Krause?= To: buildroot@buildroot.org Date: Sat, 1 Aug 2015 18:52:19 +0200 Message-Id: <1438447939-25905-1-git-send-email-joerg.krause@embedded.rocks> X-Mailer: git-send-email 2.5.0 MIME-Version: 1.0 Subject: [Buildroot] [PATCH 1/1] package/nodejs/0.10.x: add patch to fix musl build error 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 musl C library does not understand the feature test macro __USE_MISC and so libuv (built-in dependency of nodejs) does not use the correct struct stat definition for musl: error: ‘uv_statbuf_t’ has no member named ‘st_ctimensec’ error: ‘uv_statbuf_t’ has no member named ‘st_mtimensec’ The macro __USE_MISC is defined by glibc if _BSD_SOURCE or _SVID_SOURCE is defined. The libuv build system enables the feature test macro _GNU_SOURCE for linux builds. Since glibc 2.19, defining _GNU_SOURCE also has the effect of implicitly defining _DEFAULT_SOURCE - the replacement for _BSD_SOURCE and _SVID_SOURCE. In glibc versions before 2.20, defining _GNU_SOURCE also had the effect of implicitly defining _BSD_SOURCE and _SVID_SOURCE. This is also true for uClibc. Alltogether, we can safely replace __USE_MISC by _GNU_SOURCE to support building nodejs 0.10.x with the musl C library. Signed-off-by: Jörg Krause --- .../0005-fix-musl-USE-MISC-build-issue.patch | 47 ++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 package/nodejs/0.10.40/0005-fix-musl-USE-MISC-build-issue.patch diff --git a/package/nodejs/0.10.40/0005-fix-musl-USE-MISC-build-issue.patch b/package/nodejs/0.10.40/0005-fix-musl-USE-MISC-build-issue.patch new file mode 100644 index 0000000..128058d --- /dev/null +++ b/package/nodejs/0.10.40/0005-fix-musl-USE-MISC-build-issue.patch @@ -0,0 +1,47 @@ +From 0bc482abeb814573251ecafb5a1e045c885b13a2 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?J=C3=B6rg=20Krause?= +Date: Mon, 25 May 2015 16:22:57 +0200 +Subject: [PATCH 1/1] Fix musl __USE_MISC issue +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The musl C library does not define __USE_MISC and so libuv (built-in dependency) +does not use the correct struct stat definition for musl. + +The feature test macro __USE_MISC is defined by glibc if _BSD_SOURCE or +_SVID_SOURCE is defined. + +The libuv build system enables the feature test macro _GNU_SOURCE for linux +builds. + +Since glibc 2.19, defining _GNU_SOURCE also has the effect of implicitly +defining _DEFAULT_SOURCE - the replacement for _BSD_SOURCE and _SVID_SOURCE. + +In glibc versions before 2.20, defining _GNU_SOURCE also had the effect of +implicitly defining _BSD_SOURCE and _SVID_SOURCE. This is also true for uClibc. + +Alltogether, we can safely replace __USE_MISC by _GNU_SOURCE to support building +nodejs 0.10.x with the musl C library. + +Signed-off-by: Jörg Krause +--- + deps/uv/src/fs-poll.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/deps/uv/src/fs-poll.c b/deps/uv/src/fs-poll.c +index ad27f18..094447e 100644 +--- a/deps/uv/src/fs-poll.c ++++ b/deps/uv/src/fs-poll.c +@@ -198,7 +198,7 @@ static int statbuf_eq(const uv_statbuf_t* a, const uv_statbuf_t* b) { + + /* Jump through a few hoops to get sub-second granularity on Linux. */ + # if defined(__linux__) +-# if defined(__USE_MISC) /* _BSD_SOURCE || _SVID_SOURCE */ ++# if defined(_GNU_SOURCE) /* _BSD_SOURCE || _SVID_SOURCE */ + if (a->st_ctim.tv_nsec != b->st_ctim.tv_nsec) return 0; + if (a->st_mtim.tv_nsec != b->st_mtim.tv_nsec) return 0; + # else +-- +2.4.1 +