From patchwork Tue Oct 23 22:00:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Joel Carlson X-Patchwork-Id: 988383 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=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="qgXIO/Ri"; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42fnQJ6Q1Zz9sC7 for ; Wed, 24 Oct 2018 09:00:56 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id D8DD730B89; Tue, 23 Oct 2018 22:00: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 Q7BE98c4TlAR; Tue, 23 Oct 2018 22:00:45 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 7E29E233D8; Tue, 23 Oct 2018 22:00:41 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id D47AA1BF353 for ; Tue, 23 Oct 2018 22:00:39 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id CF701869B7 for ; Tue, 23 Oct 2018 22:00:39 +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 a1Ple38aeFPX for ; Tue, 23 Oct 2018 22:00:39 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-it1-f172.google.com (mail-it1-f172.google.com [209.85.166.172]) by fraxinus.osuosl.org (Postfix) with ESMTPS id EF1E8869A9 for ; Tue, 23 Oct 2018 22:00:38 +0000 (UTC) Received: by mail-it1-f172.google.com with SMTP id h6-v6so13409713ith.0 for ; Tue, 23 Oct 2018 15:00:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=8byTE57azD+wArybXNeFn44oTXbrtmZwk5G3e4mtsG0=; b=qgXIO/Riq39ziiVnXgfgcn0rRnCzCWSXWxw0M58MPs7tM7kLNisR0lGHHjNCdlHAZq UXarZBQ/R/IeeW0Z0l5BCP2eBwkKSiJFhorW9i3eCA7E5y7QPjwzk/oqPCUhebjaaJ1H ztc94RUjP3/1qiM0ziucWuA5FQUN2vC5r/DwVQAytzKDsVdM41Qbx4pzpBKKoXSC1VRP 0vP8QUzpdWQztVLpUicrL1emZuvsB4bNgsR7PFXjPyxFinJUkD2lf8Jd4V5diM4+ZllC bSWbCNfFVIgofvNrrfmndCkD4DOcVNEA0kg1DFFzv2Ee/taCHPvooaLPVIrbe5WsYczW 4OHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=8byTE57azD+wArybXNeFn44oTXbrtmZwk5G3e4mtsG0=; b=Xyv/t8kfG2br+x+39Aby5Iad9MDVF0t4A2uEI5aiaYjzGDoKlkZiVnVSkPuAgbD107 UbR5ebSaQecNTNJX64NinO7hOFP3j2ZhTlhKTJRJ+LI+BHnrpFk23z2hWdK9JKXM69dU 7GRFG5+0/5M4uUTuybPvZ2QTf+rgYEsGshOGYYpI33Kb1HRfPdTyFGiy0uLidMzThgNr ketXYLxKDfhbeQL5GS1IjbU7xt/Ro4lCml73KbyDBcNktaGKZPOe8el/NQmXDxDanCIW Nem43CZ4yolF/NwT9pItFih5GmXDnzSjeaSRnTXEkg94YiYc2V4KHJNOs8vySMmAX3k8 2gUA== X-Gm-Message-State: AGRZ1gLtRRPUiU7iqklUC4dyv/UGkTBDDfB2SdmCsH3OBfDVGfLfqLDx v9pQZ/67ifGg3FPGGLybFIaO45jC X-Google-Smtp-Source: AJdET5eHQ+KBZouMyeU5DgoyxQt/GqSm9j4dIv0LIT0h5wrmiki/TjVa1TeTrrjEZl0Idq6mO9eIsQ== X-Received: by 2002:a24:4f82:: with SMTP id c124-v6mr2487itb.108.1540332037731; Tue, 23 Oct 2018 15:00:37 -0700 (PDT) Received: from caes-s76-9.eng.cosmicaes.com (50-206-27-134-static.hfc.comcastbusiness.net. [50.206.27.134]) by smtp.gmail.com with ESMTPSA id s20-v6sm843953ioa.1.2018.10.23.15.00.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Oct 2018 15:00:36 -0700 (PDT) From: Joel Carlson X-Google-Original-From: Joel Carlson To: buildroot@buildroot.org Date: Tue, 23 Oct 2018 16:00:33 -0600 Message-Id: <20181023220033.13572-1-JoelsonCarl@gmail.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Subject: [Buildroot] [PATCH v2 1/1] c-capnproto: add package X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 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" Adds the c-capnproto package. This creates a C plugin for the regular capnproto capnpc compiler. It supports only serialization (no RPC). Since it depends on capnproto, the package selects capnproto and has the same requirements as capnproto. Includes a patch submitted upstream to fix a compilation error hit by some toolchains. Signed-off-by: Joel Carlson --- Changes v1 -> v2: - change from the call github hook to using the https URL. To use the git submodules variable I had to specify a git site method, but then it broke the download using the call github hook. I did not realize this was broken because I had a cached copy. --- DEVELOPERS | 1 + package/Config.in | 1 + ...r-str.h-include-stdarg.h-for-va_list.patch | 48 +++++++++++++++++++ package/c-capnproto/Config.in | 21 ++++++++ package/c-capnproto/c-capnproto.hash | 3 ++ package/c-capnproto/c-capnproto.mk | 23 +++++++++ 6 files changed, 97 insertions(+) create mode 100644 package/c-capnproto/0001-compiler-str.h-include-stdarg.h-for-va_list.patch create mode 100644 package/c-capnproto/Config.in create mode 100644 package/c-capnproto/c-capnproto.hash create mode 100644 package/c-capnproto/c-capnproto.mk diff --git a/DEVELOPERS b/DEVELOPERS index a3d97eb390..57cb7b3a8b 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -1038,6 +1038,7 @@ F: package/x11r7/xdriver_xf86-video-imx/ F: package/x11r7/xdriver_xf86-video-imx-viv/ N: Joel Carlson +F: package/c-capnproto/ F: package/capnproto/ F: package/cmocka/ F: package/flatcc/ diff --git a/package/Config.in b/package/Config.in index 710cde6691..1714d9ec27 100644 --- a/package/Config.in +++ b/package/Config.in @@ -1590,6 +1590,7 @@ menu "Other" source "package/bctoolbox/Config.in" source "package/bdwgc/Config.in" source "package/boost/Config.in" + source "package/c-capnproto/Config.in" source "package/capnproto/Config.in" source "package/clang/Config.in" source "package/clapack/Config.in" diff --git a/package/c-capnproto/0001-compiler-str.h-include-stdarg.h-for-va_list.patch b/package/c-capnproto/0001-compiler-str.h-include-stdarg.h-for-va_list.patch new file mode 100644 index 0000000000..f6d65ade38 --- /dev/null +++ b/package/c-capnproto/0001-compiler-str.h-include-stdarg.h-for-va_list.patch @@ -0,0 +1,48 @@ +From c9d899c7fbf6e445b44372ba4814dc7c1b8e702d Mon Sep 17 00:00:00 2001 +From: Joel Carlson +Date: Tue, 9 Oct 2018 15:40:46 -0600 +Subject: [PATCH] compiler/str.h: include stdarg.h for va_list +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +With some toolchains, compilation of str.c produced the following error: + +compiler/str.h:56:50: error: unknown type name ‘va_list’ + int str_vaddf(struct str *v, const char *format, va_list ap) ATTR(2,0); + ^~~~~~~ + +One toolchain had the following in its stdarg.h: +"We deliberately do not define va_list when called from +stdio.h, because ANSI C says that stdio.h is not supposed to +define va_list." + +str.c includes stdio.h, but none of the prior includes result in the +inclusion of stdarg.h. Therefore, explicitly include it in str.h to fix +the issue on toolchains following this ANSI C rule. + +Signed-off-by: Joel Carlson +--- + +Submitted upstream: +https://github.com/opensourcerouting/c-capnproto/pull/28 + +--- + compiler/str.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/compiler/str.h b/compiler/str.h +index 37a95a8..f2763c2 100644 +--- a/compiler/str.h ++++ b/compiler/str.h +@@ -9,6 +9,7 @@ + + #include + #include ++#include + + struct str { + char *str; +-- +2.17.1 + diff --git a/package/c-capnproto/Config.in b/package/c-capnproto/Config.in new file mode 100644 index 0000000000..3dd1d13762 --- /dev/null +++ b/package/c-capnproto/Config.in @@ -0,0 +1,21 @@ +config BR2_PACKAGE_C_CAPNPROTO + bool "c-capnproto" + depends on BR2_USE_MMU + depends on BR2_HOST_GCC_AT_LEAST_4_8 # C++11 + depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 # C++11 + depends on BR2_INSTALL_LIBSTDCPP + depends on BR2_TOOLCHAIN_HAS_THREADS + depends on BR2_TOOLCHAIN_HAS_ATOMIC + select BR2_PACKAGE_CAPNPROTO + help + A C plugin for Cap'n Proto. Generates the code generator + plugin for C. Requires regular Cap'n Proto and only + provides serialization (no RPC). + +comment "c-capnproto needs host and target gcc >= 4.8 w/ C++, threads, atomic" + depends on BR2_USE_MMU + depends on!BR2_HOST_GCC_AT_LEAST_4_8 || \ + !BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 || \ + !BR2_INSTALL_LIBSTDCPP || \ + !BR2_TOOLCHAIN_HAS_THREADS || \ + !BR2_TOOLCHAIN_HAS_ATOMIC diff --git a/package/c-capnproto/c-capnproto.hash b/package/c-capnproto/c-capnproto.hash new file mode 100644 index 0000000000..c1f5c278f6 --- /dev/null +++ b/package/c-capnproto/c-capnproto.hash @@ -0,0 +1,3 @@ +# Locally calculated +sha256 d6a93104bc0b47afa5dbfaaa39ee89319a2f41126d4959b6e772b843a1e0afd8 c-capnproto-c-capnproto-0.3.tar.gz +sha256 27797e6c7dce96675d79ed250584d157b7a86405db6eb6fba9644e6d96d42c57 COPYING diff --git a/package/c-capnproto/c-capnproto.mk b/package/c-capnproto/c-capnproto.mk new file mode 100644 index 0000000000..11ec07b47c --- /dev/null +++ b/package/c-capnproto/c-capnproto.mk @@ -0,0 +1,23 @@ +################################################################################ +# +# c-capnproto +# +################################################################################ + +C_CAPNPROTO_SHORT_VERSION = 0.3 +C_CAPNPROTO_VERSION = c-capnproto-$(C_CAPNPROTO_SHORT_VERSION) +C_CAPNPROTO_SITE = https://github.com/opensourcerouting/c-capnproto.git +C_CAPNPROTO_SITE_METHOD = git +C_CAPNPROTO_GIT_SUBMODULES = YES +C_CAPNPROTO_LICENSE = MIT +C_CAPNPROTO_LICENSE_FILES = COPYING +C_CAPNPROTO_INSTALL_STAGING = YES +# Fetched from Github with no configure script +C_CAPNPROTO_AUTORECONF = YES +# As a plugin for capnproto's capnpc, requires capnproto. Needs to be on the +# host to generate C code from message definitions. +C_CAPNPROTO_DEPENDENCIES = host-c-capnproto capnproto +HOST_C_CAPNPROTO_DEPENDENCIES = host-capnproto + +$(eval $(autotools-package)) +$(eval $(host-autotools-package))