From patchwork Fri Sep 23 21:42:27 2016 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: 674238 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3sgn065QYhz9t1j for ; Sat, 24 Sep 2016 07:42:46 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="key not found in DNS" (0-bit key; unprotected) header.d=embedded.rocks header.i=@embedded.rocks header.b=kBQ0czOM; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 172D3C11FF; Fri, 23 Sep 2016 21:42:45 +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 AAS46y1QdgWb; Fri, 23 Sep 2016 21:42:44 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 013F6C1234; Fri, 23 Sep 2016 21:42:44 +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 A6D311C2A5D for ; Fri, 23 Sep 2016 21:42:42 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 98A2D32208 for ; Fri, 23 Sep 2016 21:42:42 +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 wN4PGZh+lfba for ; Fri, 23 Sep 2016 21:42:41 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mout02.posteo.de (mout02.posteo.de [185.67.36.142]) by silver.osuosl.org (Postfix) with ESMTPS id 02FB931ACB for ; Fri, 23 Sep 2016 21:42:41 +0000 (UTC) Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 3sgmzx0H55z104T for ; Fri, 23 Sep 2016 23:42:35 +0200 (CEST) Authentication-Results: mail.embedded.rocks (amavisd-new); dkim=pass reason="pass (just generated, assumed good)" header.d=embedded.rocks DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embedded.rocks; h=content-transfer-encoding:content-type:content-type :mime-version:x-mailer:message-id:date:date:subject:subject:from :from:received:received; s=default; t=1474666954; x=1475271755; bh=Fe4ezi+HSRXRWURUgHcpCTTWHNMP0sVHKgRIUQ8bRNs=; b=kBQ0czOM39M/ SuCbiFahtbSe3ReHIfmcMtDDCigb9phObTWJYJAB+406CnzSVDA7V80ULh/jWNrR OcUtc4omiX8gzEFD45o6rmh3gJoNOVxO41owmHeJZylIuK8nlhgvr9JuQmydsBzg xi4o1qZWtedkZ84zw6UCTm8QkItlmvSQ8EDqtTU44qFtJXbzUf0iNVIDgRvJFrvN O2oBVG6r11kHhAsp+bN8xuaILJHDHNc1KyGwtG7TGgTRq5IGBjDA+agNMKdLZ9L2 XgL6nE8NPIe+5pnsPShZZdxjkODac4J8l25SFKWxEmmOYaPtqRkzYp4k50CqZn3G e8w++WvWvw== 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 E9r2BNOemysG; Fri, 23 Sep 2016 23:42:34 +0200 (CEST) Received: from nzxt.fritz.box (x4d0ccd33.dyn.telefonica.de [77.12.205.51]) (Authenticated sender: joerg.krause@embedded.rocks) by mail.embedded.rocks (Postfix) with ESMTPSA; Fri, 23 Sep 2016 23:42:33 +0200 (CEST) From: =?UTF-8?q?J=C3=B6rg=20Krause?= To: buildroot@buildroot.org Date: Fri, 23 Sep 2016 23:42:27 +0200 Message-Id: <20160923214227.12888-1-joerg.krause@embedded.rocks> X-Mailer: git-send-email 2.10.0 MIME-Version: 1.0 Subject: [Buildroot] [PATCH] package/wvstreams: add patch to fix build with C99 compilers 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" wvstreams uses a bundled version of argp. Compiling argp fails for all compilers not using the C89 standard by default: """ In file included from argp-fmtstream.c:35:0: argp-namefrob.h:62:32: error: redefinition of ‘argp_fmtstream_write’ #define __argp_fmtstream_write argp_fmtstream_write ^ argp-fmtstream.c:395:1: note: in expansion of macro ‘__argp_fmtstream_write’ __argp_fmtstream_write (argp_fmtstream_t __fs, ^ In file included from argp-fmtstream.c:34:0: argp-fmtstream.h:209:32: note: previous definition of ‘argp_fmtstream_write’ was here #define __argp_fmtstream_write argp_fmtstream_write ^ argp-fmtstream.h:223:1: note: in expansion of macro ‘__argp_fmtstream_write’ __argp_fmtstream_write (argp_fmtstream_t __fs, ^ """ The issue is that C99 changed inline semantics. This patch takes these changes into account and allows to build the bundled argp and therefore wvstreams with non-C89-compilers. Note, that wvstreams is not maintained anymore. Last activity was on Github was 2011, the current version 1.6.1 dates from 2009. Fetch-from: http://review.gluster.org/6034 Fixes: http://autobuild.buildroot.net/results/f01/f0166f030875ecaf0d757790de6361339071831e/ http://autobuild.buildroot.net/results/32b/32b4eba8c7cbe8a3b1cde2d67f1af3f913fcc292/ http://autobuild.buildroot.net/results/38f/38fefa126596c6e267ffaf0f2dd9c5e3dcf09aff/ http://autobuild.buildroot.net/results/ea2/ea223c8a4f817541f55aa36c47b159a316031bff/ .. and many more. Signed-off-by: Jörg Krause --- .../0006-fix-build-with-C99-compilers.patch | 105 +++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 package/wvstreams/0006-fix-build-with-C99-compilers.patch diff --git a/package/wvstreams/0006-fix-build-with-C99-compilers.patch b/package/wvstreams/0006-fix-build-with-C99-compilers.patch new file mode 100644 index 0000000..2bd34a0 --- /dev/null +++ b/package/wvstreams/0006-fix-build-with-C99-compilers.patch @@ -0,0 +1,105 @@ +From b2dfa011a3fdcb7d22764d143517d0fbd1c2a201 Mon Sep 17 00:00:00 2001 +From: Emmanuel Dreyfus +Date: Wed, 22 Jan 2014 14:47:23 +0100 +Subject: [PATCH] Fix build with C99 compilers + +wvstreams uses a bundled version of argp. Compiling argp fails for all compilers +not using the C89 standard by default: + +""" +In file included from argp-fmtstream.c:35:0: +argp-namefrob.h:62:32: error: redefinition of ‘argp_fmtstream_write’ + #define __argp_fmtstream_write argp_fmtstream_write + ^ +argp-fmtstream.c:395:1: note: in expansion of macro ‘__argp_fmtstream_write’ + __argp_fmtstream_write (argp_fmtstream_t __fs, + ^ +In file included from argp-fmtstream.c:34:0: +argp-fmtstream.h:209:32: note: previous definition of ‘argp_fmtstream_write’ was here + #define __argp_fmtstream_write argp_fmtstream_write + ^ +argp-fmtstream.h:223:1: note: in expansion of macro ‘__argp_fmtstream_write’ + __argp_fmtstream_write (argp_fmtstream_t __fs, + ^ +""" + +The issue is that C99 changed inline semantics. This patch allows to build +argp with non-C89-compilers. + +Fetch-from: http://review.gluster.org/6034 + +Signed-off-by: Emmanuel Dreyfus +Reviewed-by: Harshavardhana +Tested-by: Gluster Build System + +[Adapt paths for wvstreams. Add commit message.] +Signed-off-by: Jörg Krause +--- + +diff --git a/argp/argp-fmtstream.c b/argp/argp-fmtstream.c +index 7f79285..494b6b3 100644 +--- a/argp/argp-fmtstream.c ++++ b/argp/argp-fmtstream.c +@@ -389,6 +389,7 @@ + weak_alias (__argp_fmtstream_printf, argp_fmtstream_printf) + #endif + ++#if __STDC_VERSION__ - 199900L < 1 + /* Duplicate the inline definitions in argp-fmtstream.h, for compilers + * that don't do inlining. */ + size_t +@@ -471,5 +472,6 @@ + __argp_fmtstream_update (__fs); + return __fs->point_col >= 0 ? __fs->point_col : 0; + } ++#endif /* __STDC_VERSION__ - 199900L < 1 */ + + #endif /* !ARGP_FMTSTREAM_USE_LINEWRAP */ +diff --git a/argp/argp-fmtstream.h b/argp/argp-fmtstream.h +index e797b11..828f435 100644 +--- a/argp/argp-fmtstream.h ++++ b/argp/argp-fmtstream.h +@@ -153,6 +153,7 @@ + __const char *__fmt, ...) + PRINTF_STYLE(2,3); + ++#if __STDC_VERSION__ - 199900L < 1 + extern int __argp_fmtstream_putc (argp_fmtstream_t __fs, int __ch); + extern int argp_fmtstream_putc (argp_fmtstream_t __fs, int __ch); + +@@ -163,6 +164,7 @@ + __const char *__str, size_t __len); + extern size_t argp_fmtstream_write (argp_fmtstream_t __fs, + __const char *__str, size_t __len); ++#endif /* __STDC_VERSION__ - 199900L < 1 */ + + /* Access macros for various bits of state. */ + #define argp_fmtstream_lmargin(__fs) ((__fs)->lmargin) +@@ -172,6 +174,7 @@ + #define __argp_fmtstream_rmargin argp_fmtstream_rmargin + #define __argp_fmtstream_wmargin argp_fmtstream_wmargin + ++#if __STDC_VERSION__ - 199900L < 1 + /* Set __FS's left margin to LMARGIN and return the old value. */ + extern size_t argp_fmtstream_set_lmargin (argp_fmtstream_t __fs, + size_t __lmargin); +@@ -193,6 +196,7 @@ + /* Return the column number of the current output point in __FS. */ + extern size_t argp_fmtstream_point (argp_fmtstream_t __fs); + extern size_t __argp_fmtstream_point (argp_fmtstream_t __fs); ++#endif /* __STDC_VERSION__ - 199900L < 1 */ + + /* Internal routines. */ + extern void _argp_fmtstream_update (argp_fmtstream_t __fs); +@@ -216,7 +220,11 @@ + #endif + + #ifndef ARGP_FS_EI ++#if defined(__GNUC__) && !defined(__GNUC_STDC_INLINE__) + #define ARGP_FS_EI extern inline ++#else ++#define ARGP_FS_EI inline ++#endif + #endif + + ARGP_FS_EI size_t