Initial commit
This commit is contained in:
+32
@@ -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
|
||||
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
From 45fdade6c0415ec5af3f9312e6311a4ccc682a7b Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Wed, 28 Dec 2022 18:24:21 -0800
|
||||
Subject: [PATCH] direct_mmap: Use off_t on linux
|
||||
|
||||
off64_t is not provided without defining _LARGEFILE64_SOURCE on musl
|
||||
this define is not defined automatically like glibc where it gets
|
||||
defined when _GNU_SOURCE is defined. Using off_t makes it portable
|
||||
across musl/glibc and for using 64bit off_t on glibc 32bit systems
|
||||
-D_FILE_OFFSET_BITS=64 can be defined during build via CXXFLAGS
|
||||
|
||||
Upstream-Status: Submitted [https://github.com/abseil/abseil-cpp/pull/1349]
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
absl/base/internal/direct_mmap.h | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/absl/base/internal/direct_mmap.h b/absl/base/internal/direct_mmap.h
|
||||
index 815b8d23..fdf88f0b 100644
|
||||
--- a/absl/base/internal/direct_mmap.h
|
||||
+++ b/absl/base/internal/direct_mmap.h
|
||||
@@ -72,7 +72,7 @@ namespace base_internal {
|
||||
// Platform specific logic extracted from
|
||||
// https://chromium.googlesource.com/linux-syscall-support/+/master/linux_syscall_support.h
|
||||
inline void* DirectMmap(void* start, size_t length, int prot, int flags, int fd,
|
||||
- off64_t offset) noexcept {
|
||||
+ off_t offset) noexcept {
|
||||
#if defined(__i386__) || defined(__ARM_ARCH_3__) || defined(__ARM_EABI__) || \
|
||||
defined(__m68k__) || defined(__sh__) || \
|
||||
(defined(__hppa__) && !defined(__LP64__)) || \
|
||||
@@ -102,7 +102,7 @@ inline void* DirectMmap(void* start, size_t length, int prot, int flags, int fd,
|
||||
#else
|
||||
return reinterpret_cast<void*>(
|
||||
syscall(SYS_mmap2, start, length, prot, flags, fd,
|
||||
- static_cast<off_t>(offset / pagesize)));
|
||||
+ offset / pagesize));
|
||||
#endif
|
||||
#elif defined(__s390x__)
|
||||
// On s390x, mmap() arguments are passed in memory.
|
||||
--
|
||||
2.39.0
|
||||
|
||||
+73
@@ -0,0 +1,73 @@
|
||||
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(-)
|
||||
|
||||
--- a/setup.py
|
||||
+++ b/setup.py
|
||||
@@ -206,8 +206,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)
|
||||
@@ -216,8 +219,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)
|
||||
--- a/src/python/grpcio/commands.py
|
||||
+++ b/src/python/grpcio/commands.py
|
||||
@@ -228,8 +228,10 @@ class BuildExt(build_ext.build_ext):
|
||||
"""
|
||||
try:
|
||||
# TODO(lidiz) Remove the generated a.out for success tests.
|
||||
- cc = os.environ.get('CC', 'cc')
|
||||
- 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)
|
||||
+27
@@ -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
|
||||
|
||||
+88
@@ -0,0 +1,88 @@
|
||||
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>
|
||||
---
|
||||
Upstream-Status: Pending
|
||||
|
||||
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(-)
|
||||
|
||||
--- 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__
|
||||
--- 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__)
|
||||
--- 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__)
|
||||
--- a/absl/base/internal/unscaledcycleclock_config.h
|
||||
+++ b/absl/base/internal/unscaledcycleclock_config.h
|
||||
@@ -21,7 +21,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
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
Upstream-Status: Pending
|
||||
|
||||
--- 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
|
||||
+17
@@ -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
|
||||
@@ -96,6 +96,9 @@ extern "C" {
|
||||
#elif defined(__ARMEL__) || defined(_M_ARM)
|
||||
#define OPENSSL_32_BIT
|
||||
#define OPENSSL_ARM
|
||||
+#elif (defined(__PPC__) || defined(__powerpc__))
|
||||
+#define OPENSSL_32_BIT
|
||||
+#define OPENSSL_PPC
|
||||
#elif defined(__MIPSEL__) && !defined(__LP64__)
|
||||
#define OPENSSL_32_BIT
|
||||
#define OPENSSL_MIPS
|
||||
Reference in New Issue
Block a user