diff options
author | Khem Raj <raj.khem@gmail.com> | 2020-04-29 21:32:43 -0700 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2020-04-29 22:32:17 -0700 |
commit | e25bae55c290be7532a642f179b379c48460f968 (patch) | |
tree | d04d90a8e5aa3d1e6f457daef55e041aee4017b2 /meta-python/recipes-devtools/python/python3-grpcio/0001-Fix-build-on-riscv32.patch | |
parent | 243a28db17dc446819e3b4719b5699b5392b7ad8 (diff) | |
download | meta-openembedded-e25bae55c290be7532a642f179b379c48460f968.tar.gz |
python3-grpcio: Fix build with riscv32
Ensure libseil-cpp can build for rv32 and boringssl riscv patch
considers rv32 separate from rv64
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-python/recipes-devtools/python/python3-grpcio/0001-Fix-build-on-riscv32.patch')
-rw-r--r-- | meta-python/recipes-devtools/python/python3-grpcio/0001-Fix-build-on-riscv32.patch | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/meta-python/recipes-devtools/python/python3-grpcio/0001-Fix-build-on-riscv32.patch b/meta-python/recipes-devtools/python/python3-grpcio/0001-Fix-build-on-riscv32.patch new file mode 100644 index 0000000000..920fc1169d --- /dev/null +++ b/meta-python/recipes-devtools/python/python3-grpcio/0001-Fix-build-on-riscv32.patch | |||
@@ -0,0 +1,65 @@ | |||
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 | --- a/third_party/abseil-cpp/absl/base/internal/direct_mmap.h | ||
20 | +++ b/third_party/abseil-cpp/absl/base/internal/direct_mmap.h | ||
21 | @@ -26,6 +26,10 @@ | ||
22 | |||
23 | #ifdef __linux__ | ||
24 | |||
25 | +#if !defined(__NR_mmap) && defined(__riscv) && __riscv_xlen == 32 | ||
26 | +# define __NR_mmap __NR_mmap2 | ||
27 | +#endif | ||
28 | + | ||
29 | #include <sys/types.h> | ||
30 | #ifdef __BIONIC__ | ||
31 | #include <sys/syscall.h> | ||
32 | @@ -72,6 +76,7 @@ inline void* DirectMmap(void* start, siz | ||
33 | #if defined(__i386__) || defined(__ARM_ARCH_3__) || defined(__ARM_EABI__) || \ | ||
34 | (defined(__mips__) && _MIPS_SIM == _MIPS_SIM_ABI32) || \ | ||
35 | (defined(__PPC__) && !defined(__PPC64__)) || \ | ||
36 | + (defined(__riscv) && __riscv_xlen == 32) || \ | ||
37 | (defined(__s390__) && !defined(__s390x__)) | ||
38 | // On these architectures, implement mmap with mmap2. | ||
39 | static int pagesize = 0; | ||
40 | --- a/third_party/abseil-cpp/absl/base/internal/spinlock_linux.inc | ||
41 | +++ b/third_party/abseil-cpp/absl/base/internal/spinlock_linux.inc | ||
42 | @@ -14,6 +14,10 @@ | ||
43 | // | ||
44 | // This file is a Linux-specific part of spinlock_wait.cc | ||
45 | |||
46 | +#if !defined(__NR_futex) && defined(__riscv) && __riscv_xlen == 32 | ||
47 | +# define __NR_futex __NR_futex_time64 | ||
48 | +#endif | ||
49 | + | ||
50 | #include <linux/futex.h> | ||
51 | #include <sys/syscall.h> | ||
52 | #include <unistd.h> | ||
53 | --- a/third_party/abseil-cpp/absl/synchronization/internal/waiter.cc | ||
54 | +++ b/third_party/abseil-cpp/absl/synchronization/internal/waiter.cc | ||
55 | @@ -24,6 +24,10 @@ | ||
56 | #include <unistd.h> | ||
57 | #endif | ||
58 | |||
59 | +#if !defined(__NR_futex) && defined(__riscv) && __riscv_xlen == 32 | ||
60 | +# define __NR_futex __NR_futex_time64 | ||
61 | +#endif | ||
62 | + | ||
63 | #ifdef __linux__ | ||
64 | #include <linux/futex.h> | ||
65 | #include <sys/syscall.h> | ||