From patchwork Tue May 26 10:25: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: 476426 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (silver.osuosl.org [140.211.166.136]) by ozlabs.org (Postfix) with ESMTP id 243EB140E11 for ; Tue, 26 May 2015 20:25:07 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 6A418333AB; Tue, 26 May 2015 10:25:06 +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 925MymT+9iNF; Tue, 26 May 2015 10:25:01 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 1BE6133380; Tue, 26 May 2015 10:25:00 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (fraxinus.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 0E0741C21E7 for ; Tue, 26 May 2015 10:24:59 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 081A0A3408 for ; Tue, 26 May 2015 10:24:59 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PG_i7NikHcsV for ; Tue, 26 May 2015 10:24:57 +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 fraxinus.osuosl.org (Postfix) with ESMTPS id 901AEA3406 for ; Tue, 26 May 2015 10:24:57 +0000 (UTC) Received: from dovecot03.posteo.de (unknown [185.67.36.28]) by mx02.posteo.de (Postfix) with ESMTPS id 07EA225C0084 for ; Tue, 26 May 2015 12:24:54 +0200 (CEST) Received: from mail.posteo.de (localhost [127.0.0.1]) by dovecot03.posteo.de (Postfix) with ESMTPSA id 3lwryG16vBz5vNM for ; Tue, 26 May 2015 12:24:54 +0200 (CEST) Received: from timelineX.localdomain (ip5b40199e.dynamic.kabel-deutschland.de [91.64.25.158]) (Authenticated sender: joerg.krause@embedded.rocks) by embedded.rocks (Postfix) with ESMTPSA id 31CC89804DD; Tue, 26 May 2015 12:24:53 +0200 (CEST) From: =?UTF-8?q?J=C3=B6rg=20Krause?= To: buildroot@buildroot.org Date: Tue, 26 May 2015 12:25:41 +0200 Message-Id: <1432635941-25395-1-git-send-email-joerg.krause@embedded.rocks> X-Mailer: git-send-email 2.4.1 MIME-Version: 1.0 Subject: [Buildroot] [PATCH v2 1/1] package/mtd: add patch to fix host build error with gcc 5.1 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" host-mtd build fails with gcc 5.1: error: redefinition of ‘hashtable_iterator_key’ error: redefinition of ‘hashtable_iterator_value’ Indeed, both functions are defined twice - once in the header and once in the source file. This is permitted in C11 (and maybe in C99). Add a patch sent upstream, but not accepted yet. Fetch from: https://patchwork.ozlabs.org/patch/467254/ Signed-off-by: Jörg Krause --- Changes v1 -> v2: - Use (identical) patch sent upstream --- .../0005-mkfs.ubifs-Fix-build-with-gcc-5.1.patch | 72 ++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 package/mtd/0005-mkfs.ubifs-Fix-build-with-gcc-5.1.patch diff --git a/package/mtd/0005-mkfs.ubifs-Fix-build-with-gcc-5.1.patch b/package/mtd/0005-mkfs.ubifs-Fix-build-with-gcc-5.1.patch new file mode 100644 index 0000000..1fb9372 --- /dev/null +++ b/package/mtd/0005-mkfs.ubifs-Fix-build-with-gcc-5.1.patch @@ -0,0 +1,72 @@ +From patchwork Sat May 2 12:38:06 2015 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Subject: mkfs.ubifs: Fix build with gcc 5.1 +From: Bernhard Walle +X-Patchwork-Id: 467254 +Message-Id: <1430570286-30434-1-git-send-email-bernhard@bwalle.de> +To: linux-mtd@lists.infradead.org +Cc: Bernhard Walle +Date: Sat, 2 May 2015 14:38:06 +0200 + +In gcc 5.1, the default C standard which is used to compile a C file, +has changed from gnu89 to gnu11. This changed the meaning of 'extern +inline'. See https://gcc.gnu.org/gcc-5/porting_to.html. + +In mkfs.ubifs, this leads to multiple definitions of +hashtable_iterator_key and -hashtable_iterator_value. I think the most +pragmatic way to fix the issue is to replace 'extern inline' with +'static inline' here. + +Signed-off-by: Bernhard Walle +--- + mkfs.ubifs/hashtable/hashtable_itr.c | 12 ------------ + mkfs.ubifs/hashtable/hashtable_itr.h | 4 ++-- + 2 files changed, 2 insertions(+), 14 deletions(-) + +diff --git a/mkfs.ubifs/hashtable/hashtable_itr.c b/mkfs.ubifs/hashtable/hashtable_itr.c +index 24f4dde..d102453 100644 +--- a/mkfs.ubifs/hashtable/hashtable_itr.c ++++ b/mkfs.ubifs/hashtable/hashtable_itr.c +@@ -35,18 +35,6 @@ hashtable_iterator(struct hashtable *h) + } + + /*****************************************************************************/ +-/* key - return the key of the (key,value) pair at the current position */ +-/* value - return the value of the (key,value) pair at the current position */ +- +-void * +-hashtable_iterator_key(struct hashtable_itr *i) +-{ return i->e->k; } +- +-void * +-hashtable_iterator_value(struct hashtable_itr *i) +-{ return i->e->v; } +- +-/*****************************************************************************/ + /* advance - advance the iterator to the next element + * returns zero if advanced to end of table */ + +diff --git a/mkfs.ubifs/hashtable/hashtable_itr.h b/mkfs.ubifs/hashtable/hashtable_itr.h +index 87a97eb..5c94a04 100644 +--- a/mkfs.ubifs/hashtable/hashtable_itr.h ++++ b/mkfs.ubifs/hashtable/hashtable_itr.h +@@ -28,7 +28,7 @@ hashtable_iterator(struct hashtable *h); + /* hashtable_iterator_key + * - return the value of the (key,value) pair at the current position */ + +-extern inline void * ++static inline void * + hashtable_iterator_key(struct hashtable_itr *i) + { + return i->e->k; +@@ -37,7 +37,7 @@ hashtable_iterator_key(struct hashtable_itr *i) + /*****************************************************************************/ + /* value - return the value of the (key,value) pair at the current position */ + +-extern inline void * ++static inline void * + hashtable_iterator_value(struct hashtable_itr *i) + { + return i->e->v;