From patchwork Tue Jan 12 06:30:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gwenhael Goavec-Merou X-Patchwork-Id: 1425000 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) 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=trabucayre.com 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 4DFLLm1pp5z9sWK for ; Tue, 12 Jan 2021 17:31:07 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id BFAB5272F6; Tue, 12 Jan 2021 06:30: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 FJOOejLD5uUX; Tue, 12 Jan 2021 06:30:41 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 8562920484; Tue, 12 Jan 2021 06:30:40 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 740391BF2F9 for ; Tue, 12 Jan 2021 06:30:39 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 6F09686726 for ; Tue, 12 Jan 2021 06:30:39 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id XFavoOUKtgHh for ; Tue, 12 Jan 2021 06:30:37 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from smtp2-g21.free.fr (smtp2-g21.free.fr [212.27.42.2]) by whitealder.osuosl.org (Postfix) with ESMTPS id 6AB0B866B6 for ; Tue, 12 Jan 2021 06:30:37 +0000 (UTC) Received: from x230.trabucayre.com (unknown [IPv6:2a01:e34:efc8:1080:3e97:eff:fe89:644f]) by smtp2-g21.free.fr (Postfix) with ESMTP id 109AD200381; Tue, 12 Jan 2021 07:30:32 +0100 (CET) From: Gwenhael Goavec-Merou To: buildroot@buildroot.org Date: Tue, 12 Jan 2021 07:30:27 +0100 Message-Id: <20210112063027.27344-1-gwenj@trabucayre.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Subject: [Buildroot] [PATCH] package/uhd: fix build with riscV 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: , Cc: Gwenhael Goavec-Merou Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Gwenhael Goavec-Merou When the target CPU is riscV, msgpack is unable to detect endianness with a list of errors like: uhd/host/lib/deps/rpclib/include/rpc/msgpack/pack.hpp:190:2: error: #error msgpack-c supports only big endian and little endian 190 | #error msgpack-c supports only big endian and little endian | ^~~~~ and with subsequent errors: uhd0/host/lib/deps/rpclib/include/rpc/msgpack/pack.hpp:236:46: error: there are no arguments to 'take8_8' that depend on a template parameter, so a declaration of 'take8_8' must be available [-fpermissive] 236 | char buf[2] = {static_cast(0xccu), take8_8(d)}; | This is due to a missing support for this architecture in msgpack. This patch adapt commit from https://github.com/boostorg/predef [backported from https://github.com/EttusResearch/uhd/pull/400] Fix: - http://autobuild.buildroot.net/results/afacf5c5c2cd9dff6962523f1fdded9b474b9d66/ - http://autobuild.buildroot.net/results/91530538d630a7f09d85327e514f01b45253c1a6/ - http://autobuild.buildroot.net/results/91530538d630a7f09d85327e514f01b45253c1a6/ - and others Signed-off-by: Gwenhael Goavec-Merou --- .../0003-add-RISC-V-endian-detection.patch | 113 ++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 package/uhd/0003-add-RISC-V-endian-detection.patch diff --git a/package/uhd/0003-add-RISC-V-endian-detection.patch b/package/uhd/0003-add-RISC-V-endian-detection.patch new file mode 100644 index 0000000000..fb1168ba3e --- /dev/null +++ b/package/uhd/0003-add-RISC-V-endian-detection.patch @@ -0,0 +1,113 @@ +From d4717a38d2287c2f583fefb2a0ed273337a92bb6 Mon Sep 17 00:00:00 2001 +From: Gwenhael Goavec-Merou +Date: Mon, 11 Jan 2021 18:18:26 +0100 +Subject: [PATCH] msgpack/predef: add riscV support + +When the target CPU is riscV, msgpack is unable to detect endianness with a list of errors like: + +uhd/host/lib/deps/rpclib/include/rpc/msgpack/pack.hpp:190:2: error: #error msgpack-c supports only big endian and little endian + 190 | #error msgpack-c supports only big endian and little endian + | ^~~~~ + +and with subsequent errors: + +uhd0/host/lib/deps/rpclib/include/rpc/msgpack/pack.hpp:236:46: error: there are no arguments to 'take8_8' that depend on a template parameter, so a declaration of 'take8_8' must be available [-fpermissive] + 236 | char buf[2] = {static_cast(0xccu), take8_8(d)}; + | + +This is due to a missing support for this architecture in msgpack. +This patch adapt commit from https://github.com/boostorg/predef + +[backported from https://github.com/EttusResearch/uhd/pull/400] + +Signed-off-by: Gwenhael Goavec-Merou +--- + .../include/rpc/msgpack/predef/architecture.h | 1 + + .../rpc/msgpack/predef/architecture/riscv.h | 48 +++++++++++++++++++ + .../include/rpc/msgpack/predef/other/endian.h | 3 +- + 3 files changed, 51 insertions(+), 1 deletion(-) + create mode 100644 host/lib/deps/rpclib/include/rpc/msgpack/predef/architecture/riscv.h + +diff --git a/host/lib/deps/rpclib/include/rpc/msgpack/predef/architecture.h b/host/lib/deps/rpclib/include/rpc/msgpack/predef/architecture.h +index 4a0ce2749..1bd998c59 100644 +--- a/host/lib/deps/rpclib/include/rpc/msgpack/predef/architecture.h ++++ b/host/lib/deps/rpclib/include/rpc/msgpack/predef/architecture.h +@@ -18,6 +18,7 @@ http://www.boost.org/LICENSE_1_0.txt) + #include + #include + #include ++#include + #include + #include + #include +diff --git a/host/lib/deps/rpclib/include/rpc/msgpack/predef/architecture/riscv.h b/host/lib/deps/rpclib/include/rpc/msgpack/predef/architecture/riscv.h +new file mode 100644 +index 000000000..8b819d77e +--- /dev/null ++++ b/host/lib/deps/rpclib/include/rpc/msgpack/predef/architecture/riscv.h +@@ -0,0 +1,48 @@ ++/* ++Copyright Andreas Schwab 2019 ++Distributed under the Boost Software License, Version 1.0. ++(See accompanying file LICENSE_1_0.txt or copy at ++http://www.boost.org/LICENSE_1_0.txt) ++*/ ++ ++#ifndef BOOST_PREDEF_ARCHITECTURE_RISCV_H ++#define BOOST_PREDEF_ARCHITECTURE_RISCV_H ++ ++#include ++#include ++ ++/* tag::reference[] ++= `BOOST_ARCH_RISCV` ++ ++http://en.wikipedia.org/wiki/RISC-V[RISC-V] architecture. ++ ++[options="header"] ++|=== ++| {predef_symbol} | {predef_version} ++ ++| `+__riscv+` | {predef_detection} ++|=== ++*/ // end::reference[] ++ ++#define BOOST_ARCH_RISCV BOOST_VERSION_NUMBER_NOT_AVAILABLE ++ ++#if defined(__riscv) ++# undef BOOST_ARCH_RISCV ++# define BOOST_ARCH_RISCV BOOST_VERSION_NUMBER_AVAILABLE ++#endif ++ ++#if BOOST_ARCH_RISCV ++# define BOOST_ARCH_RISCV_AVAILABLE ++#endif ++ ++#if BOOST_ARCH_RISCV ++# undef BOOST_ARCH_WORD_BITS_32 ++# define BOOST_ARCH_WORD_BITS_32 BOOST_VERSION_NUMBER_AVAILABLE ++#endif ++ ++#define BOOST_ARCH_RISCV_NAME "RISC-V" ++ ++#endif ++ ++#include ++BOOST_PREDEF_DECLARE_TEST(BOOST_ARCH_RISCV,BOOST_ARCH_RISCV_NAME) +diff --git a/host/lib/deps/rpclib/include/rpc/msgpack/predef/other/endian.h b/host/lib/deps/rpclib/include/rpc/msgpack/predef/other/endian.h +index 3f367b3d4..a7c1fb4dc 100644 +--- a/host/lib/deps/rpclib/include/rpc/msgpack/predef/other/endian.h ++++ b/host/lib/deps/rpclib/include/rpc/msgpack/predef/other/endian.h +@@ -127,7 +127,8 @@ information and acquired knowledge: + defined(__AARCH64EL__) || \ + defined(_MIPSEL) || \ + defined(__MIPSEL) || \ +- defined(__MIPSEL__) ++ defined(__MIPSEL__) || \ ++ defined(__riscv) + # undef MSGPACK_ENDIAN_LITTLE_BYTE + # define MSGPACK_ENDIAN_LITTLE_BYTE MSGPACK_VERSION_NUMBER_AVAILABLE + # endif +-- +2.26.2 +