diff options
| -rw-r--r-- | meta-oe/recipes-devtools/abseil-cpp/abseil-cpp/0001-Fix-build-on-riscv32.patch | 74 | ||||
| -rw-r--r-- | meta-oe/recipes-devtools/abseil-cpp/abseil-cpp_git.bb | 1 |
2 files changed, 75 insertions, 0 deletions
diff --git a/meta-oe/recipes-devtools/abseil-cpp/abseil-cpp/0001-Fix-build-on-riscv32.patch b/meta-oe/recipes-devtools/abseil-cpp/abseil-cpp/0001-Fix-build-on-riscv32.patch new file mode 100644 index 0000000000..e7c9b43c29 --- /dev/null +++ b/meta-oe/recipes-devtools/abseil-cpp/abseil-cpp/0001-Fix-build-on-riscv32.patch | |||
| @@ -0,0 +1,74 @@ | |||
| 1 | From 04e28fdda03b545a0f7b446a784ec2fa7249cbb8 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Wed, 29 Apr 2020 15:37:40 -0700 | ||
| 4 | Subject: [PATCH] Fix build on riscv32 | ||
| 5 | |||
| 6 | Define __NR_mmap in terms of __NR_mmap2 and __NR_futex interms of | ||
| 7 | __NR_futex_time64 for rv32, since there calls dont exist for rv32 | ||
| 8 | |||
| 9 | Also recognise rv32 as a new 32bit platform | ||
| 10 | |||
| 11 | Upstream-Status: Submitted [https://github.com/abseil/abseil-cpp/pull/675] | ||
| 12 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 13 | --- | ||
| 14 | absl/base/internal/direct_mmap.h | 5 +++++ | ||
| 15 | absl/base/internal/spinlock_linux.inc | 4 ++++ | ||
| 16 | absl/synchronization/internal/waiter.cc | 4 ++++ | ||
| 17 | 3 files changed, 13 insertions(+) | ||
| 18 | |||
| 19 | diff --git a/absl/base/internal/direct_mmap.h b/absl/base/internal/direct_mmap.h | ||
| 20 | index 5618867..90cfeca 100644 | ||
| 21 | --- a/absl/base/internal/direct_mmap.h | ||
| 22 | +++ b/absl/base/internal/direct_mmap.h | ||
| 23 | @@ -26,6 +26,10 @@ | ||
| 24 | |||
| 25 | #ifdef __linux__ | ||
| 26 | |||
| 27 | +#if !defined(__NR_mmap) && defined(__riscv) && __riscv_xlen == 32 | ||
| 28 | +# define __NR_mmap __NR_mmap2 | ||
| 29 | +#endif | ||
| 30 | + | ||
| 31 | #include <sys/types.h> | ||
| 32 | #ifdef __BIONIC__ | ||
| 33 | #include <sys/syscall.h> | ||
| 34 | @@ -72,6 +76,7 @@ inline void* DirectMmap(void* start, size_t length, int prot, int flags, int fd, | ||
| 35 | #if defined(__i386__) || defined(__ARM_ARCH_3__) || defined(__ARM_EABI__) || \ | ||
| 36 | (defined(__mips__) && _MIPS_SIM == _MIPS_SIM_ABI32) || \ | ||
| 37 | (defined(__PPC__) && !defined(__PPC64__)) || \ | ||
| 38 | + (defined(__riscv) && __riscv_xlen == 32) || \ | ||
| 39 | (defined(__s390__) && !defined(__s390x__)) | ||
| 40 | // On these architectures, implement mmap with mmap2. | ||
| 41 | static int pagesize = 0; | ||
| 42 | diff --git a/absl/base/internal/spinlock_linux.inc b/absl/base/internal/spinlock_linux.inc | ||
| 43 | index 323edd6..3dca444 100644 | ||
| 44 | --- a/absl/base/internal/spinlock_linux.inc | ||
| 45 | +++ b/absl/base/internal/spinlock_linux.inc | ||
| 46 | @@ -14,6 +14,10 @@ | ||
| 47 | // | ||
| 48 | // This file is a Linux-specific part of spinlock_wait.cc | ||
| 49 | |||
| 50 | +#if !defined(__NR_futex) && defined(__riscv) && __riscv_xlen == 32 | ||
| 51 | +# define __NR_futex __NR_futex_time64 | ||
| 52 | +#endif | ||
| 53 | + | ||
| 54 | #include <linux/futex.h> | ||
| 55 | #include <sys/syscall.h> | ||
| 56 | #include <unistd.h> | ||
| 57 | diff --git a/absl/synchronization/internal/waiter.cc b/absl/synchronization/internal/waiter.cc | ||
| 58 | index 2949f5a..7411042 100644 | ||
| 59 | --- a/absl/synchronization/internal/waiter.cc | ||
| 60 | +++ b/absl/synchronization/internal/waiter.cc | ||
| 61 | @@ -24,6 +24,10 @@ | ||
| 62 | #include <unistd.h> | ||
| 63 | #endif | ||
| 64 | |||
| 65 | +#if !defined(__NR_futex) && defined(__riscv) && __riscv_xlen == 32 | ||
| 66 | +# define __NR_futex __NR_futex_time64 | ||
| 67 | +#endif | ||
| 68 | + | ||
| 69 | #ifdef __linux__ | ||
| 70 | #include <linux/futex.h> | ||
| 71 | #include <sys/syscall.h> | ||
| 72 | -- | ||
| 73 | 2.26.2 | ||
| 74 | |||
diff --git a/meta-oe/recipes-devtools/abseil-cpp/abseil-cpp_git.bb b/meta-oe/recipes-devtools/abseil-cpp/abseil-cpp_git.bb index 9a44133c56..e874e4a5ea 100644 --- a/meta-oe/recipes-devtools/abseil-cpp/abseil-cpp_git.bb +++ b/meta-oe/recipes-devtools/abseil-cpp/abseil-cpp_git.bb | |||
| @@ -16,6 +16,7 @@ SRC_URI = "git://github.com/abseil/abseil-cpp;branch=${BRANCH} \ | |||
| 16 | file://0003-Add-fPIC-option.patch \ | 16 | file://0003-Add-fPIC-option.patch \ |
| 17 | file://0001-Add-RISCV-support-to-GetProgramCounter.patch \ | 17 | file://0001-Add-RISCV-support-to-GetProgramCounter.patch \ |
| 18 | file://0001-absl-always-use-asm-sgidefs.h.patch \ | 18 | file://0001-absl-always-use-asm-sgidefs.h.patch \ |
| 19 | file://0001-Fix-build-on-riscv32.patch \ | ||
| 19 | " | 20 | " |
| 20 | 21 | ||
| 21 | S = "${WORKDIR}/git" | 22 | S = "${WORKDIR}/git" |
