From: Yann E. MORIN <yann.morin.1998@free.fr>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 1/2] package/libabseil-cpp: fix build on RISC-V 32-bits
Date: Sun, 9 Aug 2020 18:55:59 +0200 [thread overview]
Message-ID: <20200809165559.GC13263@scaer> (raw)
In-Reply-To: <20200808153945.734250-1-thomas.petazzoni@bootlin.com>
thomas, All,
On 2020-08-08 17:39 +0200, Thomas Petazzoni spake thusly:
> This commit backports an upstream patch that fixes the build on RISC-V
> 32-bits.
>
> Fixes:
>
> http://autobuild.buildroot.net/results/c6c2c99bdba8c840d52fe0464d26aca169ea1d90/
>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Both applied to master, thanks.
Regards,
Yann E. MORIN.
> ---
> .../0003-Fix-build-on-riscv32-675.patch | 77 +++++++++++++++++++
> 1 file changed, 77 insertions(+)
> create mode 100644 package/libabseil-cpp/0003-Fix-build-on-riscv32-675.patch
>
> diff --git a/package/libabseil-cpp/0003-Fix-build-on-riscv32-675.patch b/package/libabseil-cpp/0003-Fix-build-on-riscv32-675.patch
> new file mode 100644
> index 0000000000..0077c5fe9b
> --- /dev/null
> +++ b/package/libabseil-cpp/0003-Fix-build-on-riscv32-675.patch
> @@ -0,0 +1,77 @@
> +From 3f347c46272886a099852a4cd303ecf37a054de8 Mon Sep 17 00:00:00 2001
> +From: Khem Raj <raj.khem@gmail.com>
> +Date: Mon, 18 May 2020 10:23:50 -0700
> +Subject: [PATCH] Fix build on riscv32 (#675)
> +
> +[Backport from upstream commit 3f347c46272886a099852a4cd303ecf37a054de8]
> +Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> +---
> + absl/base/internal/direct_mmap.h | 5 +++++
> + absl/base/internal/spinlock_linux.inc | 8 ++++++++
> + absl/synchronization/internal/waiter.cc | 8 ++++++++
> + 3 files changed, 21 insertions(+)
> +
> +diff --git a/absl/base/internal/direct_mmap.h b/absl/base/internal/direct_mmap.h
> +index 5618867..16accf0 100644
> +--- a/absl/base/internal/direct_mmap.h
> ++++ b/absl/base/internal/direct_mmap.h
> +@@ -61,6 +61,10 @@ extern "C" void* __mmap2(void*, size_t, int, int, int, size_t);
> + #endif
> + #endif // __BIONIC__
> +
> ++#if defined(__NR_mmap2) && !defined(SYS_mmap2)
> ++#define SYS_mmap2 __NR_mmap2
> ++#endif
> ++
> + namespace absl {
> + ABSL_NAMESPACE_BEGIN
> + namespace base_internal {
> +@@ -72,6 +76,7 @@ inline void* DirectMmap(void* start, size_t length, int prot, int flags, int fd,
> + #if defined(__i386__) || defined(__ARM_ARCH_3__) || defined(__ARM_EABI__) || \
> + (defined(__mips__) && _MIPS_SIM == _MIPS_SIM_ABI32) || \
> + (defined(__PPC__) && !defined(__PPC64__)) || \
> ++ (defined(__riscv) && __riscv_xlen == 32) || \
> + (defined(__s390__) && !defined(__s390x__))
> + // On these architectures, implement mmap with mmap2.
> + static int pagesize = 0;
> +diff --git a/absl/base/internal/spinlock_linux.inc b/absl/base/internal/spinlock_linux.inc
> +index 323edd6..e31c6ed 100644
> +--- a/absl/base/internal/spinlock_linux.inc
> ++++ b/absl/base/internal/spinlock_linux.inc
> +@@ -46,6 +46,14 @@ static_assert(sizeof(std::atomic<uint32_t>) == sizeof(int),
> + #endif
> + #endif
> +
> ++#if defined(__NR_futex_time64) && !defined(SYS_futex_time64)
> ++#define SYS_futex_time64 __NR_futex_time64
> ++#endif
> ++
> ++#if defined(SYS_futex_time64) && !defined(SYS_futex)
> ++#define SYS_futex SYS_futex_time64
> ++#endif
> ++
> + extern "C" {
> +
> + ABSL_ATTRIBUTE_WEAK void AbslInternalSpinLockDelay(
> +diff --git a/absl/synchronization/internal/waiter.cc b/absl/synchronization/internal/waiter.cc
> +index 2949f5a..b6150b9 100644
> +--- a/absl/synchronization/internal/waiter.cc
> ++++ b/absl/synchronization/internal/waiter.cc
> +@@ -86,6 +86,14 @@ static void MaybeBecomeIdle() {
> + #endif
> + #endif
> +
> ++#if defined(__NR_futex_time64) && !defined(SYS_futex_time64)
> ++#define SYS_futex_time64 __NR_futex_time64
> ++#endif
> ++
> ++#if defined(SYS_futex_time64) && !defined(SYS_futex)
> ++#define SYS_futex SYS_futex_time64
> ++#endif
> ++
> + class Futex {
> + public:
> + static int WaitUntil(std::atomic<int32_t> *v, int32_t val,
> +--
> +2.26.2
> +
> --
> 2.26.2
>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
prev parent reply other threads:[~2020-08-09 16:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-08 15:39 [Buildroot] [PATCH 1/2] package/libabseil-cpp: fix build on RISC-V 32-bits Thomas Petazzoni
2020-08-08 15:39 ` [Buildroot] [PATCH 2/2] package/libabseil-cpp: add BR2_PACKAGE_LIBABSEIL_CPP_ARCH_SUPPORTS Thomas Petazzoni
2020-08-09 16:55 ` Yann E. MORIN [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200809165559.GC13263@scaer \
--to=yann.morin.1998@free.fr \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox