added my Recipes

This commit is contained in:
2024-07-11 14:16:35 +02:00
parent 38bc4f53ac
commit 09b621d929
7118 changed files with 525762 additions and 3 deletions

View File

@@ -0,0 +1,32 @@
From 752e30eebe5b91c323bafcbea8d450dd5683701a Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Mon, 30 Jan 2023 10:31:10 -0800
Subject: [PATCH] Include missing <cstdint> header
gcc 13 moved some includes around and as a result <cstdint> is
no longer transitively included [1]. Explicitly include it for
int32_t.
[1] https://gcc.gnu.org/gcc-13/porting_to.html#header-dep-changes
Upstream-Status: Submitted [https://code-review.googlesource.com/c/re2/+/60970]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
third_party/re2/util/pcre.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/third_party/re2/util/pcre.h b/third_party/re2/util/pcre.h
index 896b0bd..271a005 100644
--- a/third_party/re2/util/pcre.h
+++ b/third_party/re2/util/pcre.h
@@ -163,6 +163,7 @@
#include "util/util.h"
#include "re2/stringpiece.h"
+#include <cstdint>
#ifdef USEPCRE
#include <pcre.h>
--
2.39.1

View File

@@ -0,0 +1,79 @@
From de10fbc2386dcac3ab810c49b6977b2ee01bf426 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Wed, 17 Feb 2021 13:30:23 -0800
Subject: [PATCH] setup.py: Do not mix C and C++ compiler options
EXTRA_ENV_COMPILE_ARGS is used both with CC and CXX
so using -std=c++11 or -std=gnu99 together will cause
build time errors espcially with clang
Keep '-std=c++11' to fix native build error
with old gcc (such as gcc 5.4.0 on ubuntu 16.04), for clang
we will remove them through GRPC_PYTHON_CFLAGS at do_compile
in bb recipe.
While export CC="gcc ", cc_args is None, it will
cause subprocess.Popen always return 1. On centos 8, if you don't
install package libatomic, there will be a native build error
`cannot find /usr/lib64/libatomic.so.1.2.0'.
Add no harm '-g' to cc_args if cc_args is empty.
Upstream-Status: Inappropriate [oe specific]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Wang Mingyu <wangmy@fujitsu.com>
---
setup.py | 11 +++++++----
src/python/grpcio/commands.py | 5 ++++-
2 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/setup.py b/setup.py
index 3a50c97..bb2386d 100644
--- a/setup.py
+++ b/setup.py
@@ -205,8 +205,11 @@ def check_linker_need_libatomic():
"""Test if linker on system needs libatomic."""
code_test = (b'#include <atomic>\n' +
b'int main() { return std::atomic<int64_t>{}; }')
- cxx = shlex.split(os.environ.get('CXX', 'c++'))
- cpp_test = subprocess.Popen(cxx + ['-x', 'c++', '-std=c++14', '-'],
+ cxx, cxx_args = os.environ.get('CXX').split(' ', 1) or 'c++'
+ if not cxx_args:
+ cxx_args = "-g"
+
+ cpp_test = subprocess.Popen([cxx, cxx_args, '-x', 'c++', '-std=c++14', '-'],
stdin=PIPE,
stdout=PIPE,
stderr=PIPE)
@@ -215,8 +218,8 @@ def check_linker_need_libatomic():
return False
# Double-check to see if -latomic actually can solve the problem.
# https://github.com/grpc/grpc/issues/22491
- cpp_test = subprocess.Popen(cxx +
- ['-x', 'c++', '-std=c++14', '-', '-latomic'],
+ cpp_test = subprocess.Popen(
+ [cxx, cxx_args, '-x', 'c++', '-std=c++14', '-', '-latomic'],
stdin=PIPE,
stdout=PIPE,
stderr=PIPE)
diff --git a/src/python/grpcio/commands.py b/src/python/grpcio/commands.py
index d93b6c7..a8c4a51 100644
--- a/src/python/grpcio/commands.py
+++ b/src/python/grpcio/commands.py
@@ -228,7 +228,10 @@ class BuildExt(build_ext.build_ext):
"""
try:
# TODO(lidiz) Remove the generated a.out for success tests.
- cc_test = subprocess.Popen(['cc', '-x', 'c', '-std=c++14', '-'],
+ cc_test, cc_args = os.environ.get('CC').split(' ', 1) or 'gcc'
+ if not cc_args:
+ cc_args = "-g"
+ cc_test = subprocess.Popen([cc_test, cc_args, '-x', 'c', '-std=c++14', '-'],
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
--
2.25.1

View File

@@ -0,0 +1,27 @@
From 4432b9a296c9c287dfe281b4d464dfd03e4eb721 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sun, 12 Feb 2023 21:25:04 -0800
Subject: [PATCH] zlib: Include unistd.h for open/close C APIs
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
third_party/zlib/gzguts.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/third_party/zlib/gzguts.h b/third_party/zlib/gzguts.h
index 57faf37..3c700c2 100644
--- a/third_party/zlib/gzguts.h
+++ b/third_party/zlib/gzguts.h
@@ -19,6 +19,7 @@
#endif
#include <stdio.h>
+#include <unistd.h>
#include "zlib.h"
#ifdef STDC
# include <string.h>
--
2.39.1

View File

@@ -0,0 +1,97 @@
An all-in-one patch that fixes several issues:
1) UnscaledCycleClock not fully implemented for ppc*-musl (disabled on musl)
2) powerpc stacktrace implementation only works on glibc (disabled on musl)
3) powerpc stacktrace implementation has ppc64 assumptions (fixed)
4) examine_stack.cpp makes glibc assumptions on powerpc (fixed)
Sourced from void linux
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Xu Huan <xuhuan.fnst@fujitsu.com>
---
absl/base/internal/unscaledcycleclock.cc | 4 ++--
absl/base/internal/unscaledcycleclock.h | 3 ++-
absl/debugging/internal/examine_stack.cc | 8 +++++++-
absl/debugging/internal/stacktrace_config.h | 2 +-
4 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/absl/base/internal/unscaledcycleclock.cc b/absl/base/internal/unscaledcycleclock.cc
index b1c396c..d62bfd6 100644
--- a/absl/base/internal/unscaledcycleclock.cc
+++ b/absl/base/internal/unscaledcycleclock.cc
@@ -20,7 +20,7 @@
#include <intrin.h>
#endif
-#if defined(__powerpc__) || defined(__ppc__)
+#if (defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__)
#ifdef __GLIBC__
#include <sys/platform/ppc.h>
#elif defined(__FreeBSD__)
@@ -58,7 +58,7 @@ double UnscaledCycleClock::Frequency() {
return base_internal::NominalCPUFrequency();
}
-#elif defined(__powerpc__) || defined(__ppc__)
+#elif (defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__)
int64_t UnscaledCycleClock::Now() {
#ifdef __GLIBC__
diff --git a/absl/base/internal/unscaledcycleclock.h b/absl/base/internal/unscaledcycleclock.h
index 2cbeae3..683a5ef 100644
--- a/absl/base/internal/unscaledcycleclock.h
+++ b/absl/base/internal/unscaledcycleclock.h
@@ -46,7 +46,8 @@
// The following platforms have an implementation of a hardware counter.
#if defined(__i386__) || defined(__x86_64__) || defined(__aarch64__) || \
- defined(__powerpc__) || defined(__ppc__) || defined(__riscv) || \
+ ((defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__)) || \
+ defined(__riscv) || \
defined(_M_IX86) || (defined(_M_X64) && !defined(_M_ARM64EC))
#define ABSL_HAVE_UNSCALED_CYCLECLOCK_IMPLEMENTATION 1
#else
diff --git a/absl/debugging/internal/examine_stack.cc b/absl/debugging/internal/examine_stack.cc
index 5bdd341..a784e0d 100644
--- a/absl/debugging/internal/examine_stack.cc
+++ b/absl/debugging/internal/examine_stack.cc
@@ -33,6 +33,10 @@
#include <csignal>
#include <cstdio>
+#if defined(__powerpc__)
+#include <asm/ptrace.h>
+#endif
+
#include "absl/base/attributes.h"
#include "absl/base/internal/raw_logging.h"
#include "absl/base/macros.h"
@@ -174,8 +178,10 @@ void* GetProgramCounter(void* const vuc) {
return reinterpret_cast<void*>(context->uc_mcontext.pc);
#elif defined(__powerpc64__)
return reinterpret_cast<void*>(context->uc_mcontext.gp_regs[32]);
-#elif defined(__powerpc__)
+#elif defined(__powerpc__) && defined(__GLIBC__)
return reinterpret_cast<void*>(context->uc_mcontext.uc_regs->gregs[32]);
+#elif defined(__powerpc__)
+ return reinterpret_cast<void*>(((struct pt_regs *)context->uc_regs)->gregs[32]);
#elif defined(__riscv)
return reinterpret_cast<void*>(context->uc_mcontext.__gregs[REG_PC]);
#elif defined(__s390__) && !defined(__s390x__)
diff --git a/absl/debugging/internal/stacktrace_config.h b/absl/debugging/internal/stacktrace_config.h
index 3929b1b..23d5e50 100644
--- a/absl/debugging/internal/stacktrace_config.h
+++ b/absl/debugging/internal/stacktrace_config.h
@@ -60,7 +60,7 @@
#elif defined(__i386__) || defined(__x86_64__)
#define ABSL_STACKTRACE_INL_HEADER \
"absl/debugging/internal/stacktrace_x86-inl.inc"
-#elif defined(__ppc__) || defined(__PPC__)
+#elif (defined(__ppc__) || defined(__PPC__)) && defined(__GLIBC__)
#define ABSL_STACKTRACE_INL_HEADER \
"absl/debugging/internal/stacktrace_powerpc-inl.inc"
#elif defined(__aarch64__)
--
2.25.1

View File

@@ -0,0 +1,50 @@
From f71b32eb8a5c173fc5733847437b9485d75bb2e5 Mon Sep 17 00:00:00 2001
From: Leon Anavi <leon.anavi@konsulko.com>
Date: Fri, 9 Apr 2021 14:06:36 +0300
Subject: [PATCH] setup.py: Fix determining target platform
Do not poke at the build machine to determine target platform or architecture
pass it from environment instead for cross compiling to work
Upstream-Status: Inappropriate [OE-Specific]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Leon Anavi <leon.anavi@konsulko.com>
---
setup.py | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/setup.py b/setup.py
index c93d419f32..71a944a9d0 100644
--- a/setup.py
+++ b/setup.py
@@ -116,6 +116,9 @@ def _env_bool_value(env_name, default):
BUILD_WITH_BORING_SSL_ASM = _env_bool_value('GRPC_BUILD_WITH_BORING_SSL_ASM',
'True')
+BORING_SSL_PLATFORM = os.environ.get('GRPC_BORING_SSL_PLATFORM',
+ 'True')
+
# Export this environment variable to override the platform variant that will
# be chosen for boringssl assembly optimizations. This option is useful when
# crosscompiling and the host platform as obtained by distutils.utils.get_platform()
@@ -336,13 +339,13 @@ if BUILD_WITH_BORING_SSL_ASM and not BUILD_WITH_SYSTEM_OPENSSL:
LINUX_X86_64 = 'linux-x86_64'
LINUX_ARM = 'linux-arm'
LINUX_AARCH64 = 'linux-aarch64'
- if LINUX_X86_64 == boringssl_asm_platform:
+ if LINUX_X86_64 == BORING_SSL_PLATFORM:
asm_key = 'crypto_linux_x86_64'
- elif LINUX_ARM == boringssl_asm_platform:
+ elif LINUX_ARM == BORING_SSL_PLATFORM:
asm_key = 'crypto_linux_arm'
- elif LINUX_AARCH64 == boringssl_asm_platform:
+ elif LINUX_AARCH64 == BORING_SSL_PLATFORM:
asm_key = 'crypto_linux_aarch64'
- elif "mac" in boringssl_asm_platform and "x86_64" in boringssl_asm_platform:
+ elif "mac" in boringssl_asm_platform and "x86_64" in BORING_SSL_PLATFORM:
asm_key = 'crypto_mac_x86_64'
else:
print("ASM Builds for BoringSSL currently not supported on:",
--
2.17.1

View File

@@ -0,0 +1,15 @@
--- a/third_party/boringssl-with-bazel/src/include/openssl/base.h
+++ b/third_party/boringssl-with-bazel/src/include/openssl/base.h
@@ -102,10 +102,10 @@ extern "C" {
#elif (defined(__PPC__) || defined(__powerpc__))
#define OPENSSL_32_BIT
#define OPENSSL_PPC
-#elif defined(__MIPSEL__) && !defined(__LP64__)
+#elif defined(__mips__) && !defined(__LP64__)
#define OPENSSL_32_BIT
#define OPENSSL_MIPS
-#elif defined(__MIPSEL__) && defined(__LP64__)
+#elif defined(__mips__) && defined(__LP64__)
#define OPENSSL_64_BIT
#define OPENSSL_MIPS64
#elif defined(__riscv) && __SIZEOF_POINTER__ == 8

View File

@@ -0,0 +1,17 @@
Let boringSSL compile on ppc32 bit
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
--- a/third_party/boringssl-with-bazel/src/include/openssl/base.h
+++ b/third_party/boringssl-with-bazel/src/include/openssl/base.h
@@ -99,6 +99,9 @@ extern "C" {
#elif (defined(__PPC64__) || defined(__powerpc64__)) && defined(_LITTLE_ENDIAN)
#define OPENSSL_64_BIT
#define OPENSSL_PPC64LE
+#elif (defined(__PPC__) || defined(__powerpc__))
+#define OPENSSL_32_BIT
+#define OPENSSL_PPC
#elif defined(__MIPSEL__) && !defined(__LP64__)
#define OPENSSL_32_BIT
#define OPENSSL_MIPS