diff options
| -rw-r--r-- | meta-python/recipes-devtools/python/python3-grpcio/0001-setup.py-Do-not-mix-C-and-C-compiler-options.patch | 16 | ||||
| -rw-r--r-- | meta-python/recipes-devtools/python/python3-grpcio/abseil-ppc-fixes.patch | 37 | ||||
| -rw-r--r-- | meta-python/recipes-devtools/python/python3-grpcio/boring_ssl.patch | 50 | ||||
| -rw-r--r-- | meta-python/recipes-devtools/python/python3-grpcio/ppc-boringssl-support.patch | 8 | ||||
| -rw-r--r-- | meta-python/recipes-devtools/python/python3-grpcio_1.56.0.bb (renamed from meta-python/recipes-devtools/python/python3-grpcio_1.51.1.bb) | 8 |
5 files changed, 27 insertions, 92 deletions
diff --git a/meta-python/recipes-devtools/python/python3-grpcio/0001-setup.py-Do-not-mix-C-and-C-compiler-options.patch b/meta-python/recipes-devtools/python/python3-grpcio/0001-setup.py-Do-not-mix-C-and-C-compiler-options.patch index 1f465dbb6e..13911ddcf3 100644 --- a/meta-python/recipes-devtools/python/python3-grpcio/0001-setup.py-Do-not-mix-C-and-C-compiler-options.patch +++ b/meta-python/recipes-devtools/python/python3-grpcio/0001-setup.py-Do-not-mix-C-and-C-compiler-options.patch | |||
| @@ -29,11 +29,9 @@ Signed-off-by: Wang Mingyu <wangmy@fujitsu.com> | |||
| 29 | src/python/grpcio/commands.py | 5 ++++- | 29 | src/python/grpcio/commands.py | 5 ++++- |
| 30 | 2 files changed, 11 insertions(+), 5 deletions(-) | 30 | 2 files changed, 11 insertions(+), 5 deletions(-) |
| 31 | 31 | ||
| 32 | diff --git a/setup.py b/setup.py | ||
| 33 | index 3a50c97..bb2386d 100644 | ||
| 34 | --- a/setup.py | 32 | --- a/setup.py |
| 35 | +++ b/setup.py | 33 | +++ b/setup.py |
| 36 | @@ -205,8 +205,11 @@ def check_linker_need_libatomic(): | 34 | @@ -206,8 +206,11 @@ def check_linker_need_libatomic(): |
| 37 | """Test if linker on system needs libatomic.""" | 35 | """Test if linker on system needs libatomic.""" |
| 38 | code_test = (b'#include <atomic>\n' + | 36 | code_test = (b'#include <atomic>\n' + |
| 39 | b'int main() { return std::atomic<int64_t>{}; }') | 37 | b'int main() { return std::atomic<int64_t>{}; }') |
| @@ -47,7 +45,7 @@ index 3a50c97..bb2386d 100644 | |||
| 47 | stdin=PIPE, | 45 | stdin=PIPE, |
| 48 | stdout=PIPE, | 46 | stdout=PIPE, |
| 49 | stderr=PIPE) | 47 | stderr=PIPE) |
| 50 | @@ -215,8 +218,8 @@ def check_linker_need_libatomic(): | 48 | @@ -216,8 +219,8 @@ def check_linker_need_libatomic(): |
| 51 | return False | 49 | return False |
| 52 | # Double-check to see if -latomic actually can solve the problem. | 50 | # Double-check to see if -latomic actually can solve the problem. |
| 53 | # https://github.com/grpc/grpc/issues/22491 | 51 | # https://github.com/grpc/grpc/issues/22491 |
| @@ -58,15 +56,14 @@ index 3a50c97..bb2386d 100644 | |||
| 58 | stdin=PIPE, | 56 | stdin=PIPE, |
| 59 | stdout=PIPE, | 57 | stdout=PIPE, |
| 60 | stderr=PIPE) | 58 | stderr=PIPE) |
| 61 | diff --git a/src/python/grpcio/commands.py b/src/python/grpcio/commands.py | ||
| 62 | index d93b6c7..a8c4a51 100644 | ||
| 63 | --- a/src/python/grpcio/commands.py | 59 | --- a/src/python/grpcio/commands.py |
| 64 | +++ b/src/python/grpcio/commands.py | 60 | +++ b/src/python/grpcio/commands.py |
| 65 | @@ -228,7 +228,10 @@ class BuildExt(build_ext.build_ext): | 61 | @@ -228,8 +228,10 @@ class BuildExt(build_ext.build_ext): |
| 66 | """ | 62 | """ |
| 67 | try: | 63 | try: |
| 68 | # TODO(lidiz) Remove the generated a.out for success tests. | 64 | # TODO(lidiz) Remove the generated a.out for success tests. |
| 69 | - cc_test = subprocess.Popen(['cc', '-x', 'c', '-std=c++14', '-'], | 65 | - cc = os.environ.get('CC', 'cc') |
| 66 | - cc_test = subprocess.Popen([cc, '-x', 'c', '-std=c++14', '-'], | ||
| 70 | + cc_test, cc_args = os.environ.get('CC').split(' ', 1) or 'gcc' | 67 | + cc_test, cc_args = os.environ.get('CC').split(' ', 1) or 'gcc' |
| 71 | + if not cc_args: | 68 | + if not cc_args: |
| 72 | + cc_args = "-g" | 69 | + cc_args = "-g" |
| @@ -74,6 +71,3 @@ index d93b6c7..a8c4a51 100644 | |||
| 74 | stdin=subprocess.PIPE, | 71 | stdin=subprocess.PIPE, |
| 75 | stdout=subprocess.PIPE, | 72 | stdout=subprocess.PIPE, |
| 76 | stderr=subprocess.PIPE) | 73 | stderr=subprocess.PIPE) |
| 77 | -- | ||
| 78 | 2.25.1 | ||
| 79 | |||
diff --git a/meta-python/recipes-devtools/python/python3-grpcio/abseil-ppc-fixes.patch b/meta-python/recipes-devtools/python/python3-grpcio/abseil-ppc-fixes.patch index 3de3d0f083..4100cf63f7 100644 --- a/meta-python/recipes-devtools/python/python3-grpcio/abseil-ppc-fixes.patch +++ b/meta-python/recipes-devtools/python/python3-grpcio/abseil-ppc-fixes.patch | |||
| @@ -18,8 +18,6 @@ Upstream-Status: Pending | |||
| 18 | absl/debugging/internal/stacktrace_config.h | 2 +- | 18 | absl/debugging/internal/stacktrace_config.h | 2 +- |
| 19 | 4 files changed, 12 insertions(+), 5 deletions(-) | 19 | 4 files changed, 12 insertions(+), 5 deletions(-) |
| 20 | 20 | ||
| 21 | diff --git a/absl/base/internal/unscaledcycleclock.cc b/absl/base/internal/unscaledcycleclock.cc | ||
| 22 | index b1c396c..d62bfd6 100644 | ||
| 23 | --- a/absl/base/internal/unscaledcycleclock.cc | 21 | --- a/absl/base/internal/unscaledcycleclock.cc |
| 24 | +++ b/absl/base/internal/unscaledcycleclock.cc | 22 | +++ b/absl/base/internal/unscaledcycleclock.cc |
| 25 | @@ -20,7 +20,7 @@ | 23 | @@ -20,7 +20,7 @@ |
| @@ -40,22 +38,6 @@ index b1c396c..d62bfd6 100644 | |||
| 40 | 38 | ||
| 41 | int64_t UnscaledCycleClock::Now() { | 39 | int64_t UnscaledCycleClock::Now() { |
| 42 | #ifdef __GLIBC__ | 40 | #ifdef __GLIBC__ |
| 43 | diff --git a/absl/base/internal/unscaledcycleclock.h b/absl/base/internal/unscaledcycleclock.h | ||
| 44 | index 2cbeae3..683a5ef 100644 | ||
| 45 | --- a/absl/base/internal/unscaledcycleclock.h | ||
| 46 | +++ b/absl/base/internal/unscaledcycleclock.h | ||
| 47 | @@ -46,7 +46,8 @@ | ||
| 48 | |||
| 49 | // The following platforms have an implementation of a hardware counter. | ||
| 50 | #if defined(__i386__) || defined(__x86_64__) || defined(__aarch64__) || \ | ||
| 51 | - defined(__powerpc__) || defined(__ppc__) || defined(__riscv) || \ | ||
| 52 | + ((defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__)) || \ | ||
| 53 | + defined(__riscv) || \ | ||
| 54 | defined(_M_IX86) || (defined(_M_X64) && !defined(_M_ARM64EC)) | ||
| 55 | #define ABSL_HAVE_UNSCALED_CYCLECLOCK_IMPLEMENTATION 1 | ||
| 56 | #else | ||
| 57 | diff --git a/absl/debugging/internal/examine_stack.cc b/absl/debugging/internal/examine_stack.cc | ||
| 58 | index 5bdd341..a784e0d 100644 | ||
| 59 | --- a/absl/debugging/internal/examine_stack.cc | 41 | --- a/absl/debugging/internal/examine_stack.cc |
| 60 | +++ b/absl/debugging/internal/examine_stack.cc | 42 | +++ b/absl/debugging/internal/examine_stack.cc |
| 61 | @@ -33,6 +33,10 @@ | 43 | @@ -33,6 +33,10 @@ |
| @@ -69,7 +51,7 @@ index 5bdd341..a784e0d 100644 | |||
| 69 | #include "absl/base/attributes.h" | 51 | #include "absl/base/attributes.h" |
| 70 | #include "absl/base/internal/raw_logging.h" | 52 | #include "absl/base/internal/raw_logging.h" |
| 71 | #include "absl/base/macros.h" | 53 | #include "absl/base/macros.h" |
| 72 | @@ -174,8 +178,10 @@ void* GetProgramCounter(void* const vuc) { | 54 | @@ -174,8 +178,10 @@ void* GetProgramCounter(void* const vuc) |
| 73 | return reinterpret_cast<void*>(context->uc_mcontext.pc); | 55 | return reinterpret_cast<void*>(context->uc_mcontext.pc); |
| 74 | #elif defined(__powerpc64__) | 56 | #elif defined(__powerpc64__) |
| 75 | return reinterpret_cast<void*>(context->uc_mcontext.gp_regs[32]); | 57 | return reinterpret_cast<void*>(context->uc_mcontext.gp_regs[32]); |
| @@ -81,8 +63,6 @@ index 5bdd341..a784e0d 100644 | |||
| 81 | #elif defined(__riscv) | 63 | #elif defined(__riscv) |
| 82 | return reinterpret_cast<void*>(context->uc_mcontext.__gregs[REG_PC]); | 64 | return reinterpret_cast<void*>(context->uc_mcontext.__gregs[REG_PC]); |
| 83 | #elif defined(__s390__) && !defined(__s390x__) | 65 | #elif defined(__s390__) && !defined(__s390x__) |
| 84 | diff --git a/absl/debugging/internal/stacktrace_config.h b/absl/debugging/internal/stacktrace_config.h | ||
| 85 | index 3929b1b..23d5e50 100644 | ||
| 86 | --- a/absl/debugging/internal/stacktrace_config.h | 66 | --- a/absl/debugging/internal/stacktrace_config.h |
| 87 | +++ b/absl/debugging/internal/stacktrace_config.h | 67 | +++ b/absl/debugging/internal/stacktrace_config.h |
| 88 | @@ -60,7 +60,7 @@ | 68 | @@ -60,7 +60,7 @@ |
| @@ -94,6 +74,15 @@ index 3929b1b..23d5e50 100644 | |||
| 94 | #define ABSL_STACKTRACE_INL_HEADER \ | 74 | #define ABSL_STACKTRACE_INL_HEADER \ |
| 95 | "absl/debugging/internal/stacktrace_powerpc-inl.inc" | 75 | "absl/debugging/internal/stacktrace_powerpc-inl.inc" |
| 96 | #elif defined(__aarch64__) | 76 | #elif defined(__aarch64__) |
| 97 | -- | 77 | --- a/absl/base/internal/unscaledcycleclock_config.h |
| 98 | 2.25.1 | 78 | +++ b/absl/base/internal/unscaledcycleclock_config.h |
| 99 | 79 | @@ -21,7 +21,8 @@ | |
| 80 | |||
| 81 | // The following platforms have an implementation of a hardware counter. | ||
| 82 | #if defined(__i386__) || defined(__x86_64__) || defined(__aarch64__) || \ | ||
| 83 | - defined(__powerpc__) || defined(__ppc__) || defined(__riscv) || \ | ||
| 84 | + ((defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__)) || \ | ||
| 85 | + defined(__riscv) || \ | ||
| 86 | defined(_M_IX86) || (defined(_M_X64) && !defined(_M_ARM64EC)) | ||
| 87 | #define ABSL_HAVE_UNSCALED_CYCLECLOCK_IMPLEMENTATION 1 | ||
| 88 | #else | ||
diff --git a/meta-python/recipes-devtools/python/python3-grpcio/boring_ssl.patch b/meta-python/recipes-devtools/python/python3-grpcio/boring_ssl.patch deleted file mode 100644 index d12e35a993..0000000000 --- a/meta-python/recipes-devtools/python/python3-grpcio/boring_ssl.patch +++ /dev/null | |||
| @@ -1,50 +0,0 @@ | |||
| 1 | From f71b32eb8a5c173fc5733847437b9485d75bb2e5 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Leon Anavi <leon.anavi@konsulko.com> | ||
| 3 | Date: Fri, 9 Apr 2021 14:06:36 +0300 | ||
| 4 | Subject: [PATCH] setup.py: Fix determining target platform | ||
| 5 | |||
| 6 | Do not poke at the build machine to determine target platform or architecture | ||
| 7 | pass it from environment instead for cross compiling to work | ||
| 8 | |||
| 9 | Upstream-Status: Inappropriate [OE-Specific] | ||
| 10 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 11 | Signed-off-by: Leon Anavi <leon.anavi@konsulko.com> | ||
| 12 | --- | ||
| 13 | setup.py | 11 +++++++---- | ||
| 14 | 1 file changed, 7 insertions(+), 4 deletions(-) | ||
| 15 | |||
| 16 | diff --git a/setup.py b/setup.py | ||
| 17 | index c93d419f32..71a944a9d0 100644 | ||
| 18 | --- a/setup.py | ||
| 19 | +++ b/setup.py | ||
| 20 | @@ -116,6 +116,9 @@ def _env_bool_value(env_name, default): | ||
| 21 | BUILD_WITH_BORING_SSL_ASM = _env_bool_value('GRPC_BUILD_WITH_BORING_SSL_ASM', | ||
| 22 | 'True') | ||
| 23 | |||
| 24 | +BORING_SSL_PLATFORM = os.environ.get('GRPC_BORING_SSL_PLATFORM', | ||
| 25 | + 'True') | ||
| 26 | + | ||
| 27 | # Export this environment variable to override the platform variant that will | ||
| 28 | # be chosen for boringssl assembly optimizations. This option is useful when | ||
| 29 | # crosscompiling and the host platform as obtained by distutils.utils.get_platform() | ||
| 30 | @@ -336,13 +339,13 @@ if BUILD_WITH_BORING_SSL_ASM and not BUILD_WITH_SYSTEM_OPENSSL: | ||
| 31 | LINUX_X86_64 = 'linux-x86_64' | ||
| 32 | LINUX_ARM = 'linux-arm' | ||
| 33 | LINUX_AARCH64 = 'linux-aarch64' | ||
| 34 | - if LINUX_X86_64 == boringssl_asm_platform: | ||
| 35 | + if LINUX_X86_64 == BORING_SSL_PLATFORM: | ||
| 36 | asm_key = 'crypto_linux_x86_64' | ||
| 37 | - elif LINUX_ARM == boringssl_asm_platform: | ||
| 38 | + elif LINUX_ARM == BORING_SSL_PLATFORM: | ||
| 39 | asm_key = 'crypto_linux_arm' | ||
| 40 | - elif LINUX_AARCH64 == boringssl_asm_platform: | ||
| 41 | + elif LINUX_AARCH64 == BORING_SSL_PLATFORM: | ||
| 42 | asm_key = 'crypto_linux_aarch64' | ||
| 43 | - elif "mac" in boringssl_asm_platform and "x86_64" in boringssl_asm_platform: | ||
| 44 | + elif "mac" in boringssl_asm_platform and "x86_64" in BORING_SSL_PLATFORM: | ||
| 45 | asm_key = 'crypto_mac_x86_64' | ||
| 46 | else: | ||
| 47 | print("ASM Builds for BoringSSL currently not supported on:", | ||
| 48 | -- | ||
| 49 | 2.17.1 | ||
| 50 | |||
diff --git a/meta-python/recipes-devtools/python/python3-grpcio/ppc-boringssl-support.patch b/meta-python/recipes-devtools/python/python3-grpcio/ppc-boringssl-support.patch index 5c9be443d8..5dacc689fc 100644 --- a/meta-python/recipes-devtools/python/python3-grpcio/ppc-boringssl-support.patch +++ b/meta-python/recipes-devtools/python/python3-grpcio/ppc-boringssl-support.patch | |||
| @@ -5,10 +5,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com> | |||
| 5 | 5 | ||
| 6 | --- a/third_party/boringssl-with-bazel/src/include/openssl/base.h | 6 | --- a/third_party/boringssl-with-bazel/src/include/openssl/base.h |
| 7 | +++ b/third_party/boringssl-with-bazel/src/include/openssl/base.h | 7 | +++ b/third_party/boringssl-with-bazel/src/include/openssl/base.h |
| 8 | @@ -99,6 +99,9 @@ extern "C" { | 8 | @@ -96,6 +96,9 @@ extern "C" { |
| 9 | #elif (defined(__PPC64__) || defined(__powerpc64__)) && defined(_LITTLE_ENDIAN) | 9 | #elif defined(__ARMEL__) || defined(_M_ARM) |
| 10 | #define OPENSSL_64_BIT | 10 | #define OPENSSL_32_BIT |
| 11 | #define OPENSSL_PPC64LE | 11 | #define OPENSSL_ARM |
| 12 | +#elif (defined(__PPC__) || defined(__powerpc__)) | 12 | +#elif (defined(__PPC__) || defined(__powerpc__)) |
| 13 | +#define OPENSSL_32_BIT | 13 | +#define OPENSSL_32_BIT |
| 14 | +#define OPENSSL_PPC | 14 | +#define OPENSSL_PPC |
diff --git a/meta-python/recipes-devtools/python/python3-grpcio_1.51.1.bb b/meta-python/recipes-devtools/python/python3-grpcio_1.56.0.bb index 7a9b7d8018..33c13b0a01 100644 --- a/meta-python/recipes-devtools/python/python3-grpcio_1.51.1.bb +++ b/meta-python/recipes-devtools/python/python3-grpcio_1.56.0.bb | |||
| @@ -8,13 +8,12 @@ DEPENDS += "${PYTHON_PN}-protobuf" | |||
| 8 | 8 | ||
| 9 | SRC_URI += "file://0001-setup.py-Do-not-mix-C-and-C-compiler-options.patch" | 9 | SRC_URI += "file://0001-setup.py-Do-not-mix-C-and-C-compiler-options.patch" |
| 10 | SRC_URI:append:class-target = " file://ppc-boringssl-support.patch \ | 10 | SRC_URI:append:class-target = " file://ppc-boringssl-support.patch \ |
| 11 | file://boring_ssl.patch \ | ||
| 12 | file://mips_bigendian.patch \ | 11 | file://mips_bigendian.patch \ |
| 13 | file://0001-Include-missing-cstdint-header.patch \ | 12 | file://0001-Include-missing-cstdint-header.patch \ |
| 14 | file://abseil-ppc-fixes.patch;patchdir=third_party/abseil-cpp \ | 13 | file://abseil-ppc-fixes.patch;patchdir=third_party/abseil-cpp \ |
| 15 | file://0001-zlib-Include-unistd.h-for-open-close-C-APIs.patch \ | 14 | file://0001-zlib-Include-unistd.h-for-open-close-C-APIs.patch \ |
| 16 | " | 15 | " |
| 17 | SRC_URI[sha256sum] = "e6dfc2b6567b1c261739b43d9c59d201c1b89e017afd9e684d85aa7a186c9f7a" | 16 | SRC_URI[sha256sum] = "4c08ee21b3d10315b8dc26f6c13917b20ed574cdbed2d2d80c53d5508fdcc0f2" |
| 18 | 17 | ||
| 19 | RDEPENDS:${PN} = "${PYTHON_PN}-protobuf \ | 18 | RDEPENDS:${PN} = "${PYTHON_PN}-protobuf \ |
| 20 | ${PYTHON_PN}-setuptools \ | 19 | ${PYTHON_PN}-setuptools \ |
| @@ -30,11 +29,14 @@ export GRPC_PYTHON_DISABLE_LIBC_COMPATIBILITY = "1" | |||
| 30 | 29 | ||
| 31 | BORING_SSL_PLATFORM:arm = "linux-arm" | 30 | BORING_SSL_PLATFORM:arm = "linux-arm" |
| 32 | BORING_SSL_PLATFORM:x86-64 = "linux-x86_64" | 31 | BORING_SSL_PLATFORM:x86-64 = "linux-x86_64" |
| 32 | BORING_SSL_PLATFORM:aarch64 = "linux-aarch64" | ||
| 33 | BORING_SSL_PLATFORM ?= "unsupported" | 33 | BORING_SSL_PLATFORM ?= "unsupported" |
| 34 | export GRPC_BORING_SSL_PLATFORM = "${BORING_SSL_PLATFORM}" | 34 | export GRPC_BORING_SSL_PLATFORM = "${BORING_SSL_PLATFORM}" |
| 35 | export GRPC_BUILD_OVERRIDE_BORING_SSL_ASM_PLATFORM = "${BORING_SSL_PLATFORM}" | ||
| 35 | 36 | ||
| 36 | BORING_SSL:x86-64 = "1" | ||
| 37 | BORING_SSL:arm = "1" | 37 | BORING_SSL:arm = "1" |
| 38 | BORING_SSL:x86-64 = "1" | ||
| 39 | BORING_SSL:aarch64 = "1" | ||
| 38 | BORING_SSL ?= "0" | 40 | BORING_SSL ?= "0" |
| 39 | export GRPC_BUILD_WITH_BORING_SSL_ASM = "${BORING_SSL}" | 41 | export GRPC_BUILD_WITH_BORING_SSL_ASM = "${BORING_SSL}" |
| 40 | 42 | ||
