initial buildroot for linux 5.15

This commit is contained in:
Huan.Feng
2021-12-06 14:12:13 +08:00
parent d7767d594e
commit 7b6fc358fa
12736 changed files with 508822 additions and 0 deletions
@@ -0,0 +1,51 @@
From 0dfb289a3b362b082ac3608d887e42f09dadc0d2 Mon Sep 17 00:00:00 2001
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Date: Mon, 31 Dec 2018 16:22:07 +0100
Subject: [PATCH] Properly detect the availability of pthread_setname_np()
This commit adds a CMake check for the availability of
pthread_setname_np(), and only uses it on Linux when available.
Indeed, some C libraries, such as uClibc, do not provide this
non-POSIX function in all cases.
Upstream: https://github.com/grpc/grpc/pull/17610
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
CMakeLists.txt | 6 ++++++
include/grpc/impl/codegen/port_platform.h | 2 ++
2 files changed, 8 insertions(+)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 45c2fcb..0b2be4f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -208,6 +208,12 @@ if (NOT DEFINED CMAKE_POSITION_INDEPENDENT_CODE)
endif()
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")
+include(CheckSymbolExists)
+check_symbol_exists(pthread_setname_np pthread.h HAVE_PTHREAD_SETNAME_NP)
+if (HAVE_PTHREAD_SETNAME_NP)
+ add_definitions(-DHAVE_PTHREAD_SETNAME_NP)
+endif ()
+
if(MSVC)
include(cmake/msvc_static_runtime.cmake)
add_definitions(-D_WIN32_WINNT=0x600 -D_SCL_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS -D_WINSOCK_DEPRECATED_NO_WARNINGS)
diff --git a/include/grpc/impl/codegen/port_platform.h b/include/grpc/impl/codegen/port_platform.h
index 4f213ff..55ecd9d 100644
--- a/include/grpc/impl/codegen/port_platform.h
+++ b/include/grpc/impl/codegen/port_platform.h
@@ -168,7 +168,9 @@
#endif /* _LP64 */
#ifdef __GLIBC__
#define GPR_POSIX_CRASH_HANDLER 1
+#if defined(HAVE_PTHREAD_SETNAME_NP)
#define GPR_LINUX_PTHREAD_NAME 1
+#endif /* HAVE_PTHREAD_SETNAME_NP */
#include <linux/version.h>
#else /* musl libc */
#define GPR_MUSL_LIBC_COMPAT 1
--
2.26.63
@@ -0,0 +1,34 @@
From be030314805137cd63b46ea6eaa702b608669910 Mon Sep 17 00:00:00 2001
From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Date: Sun, 2 Jun 2019 17:45:47 +0200
Subject: [PATCH] wrap_memcpy.cc: add GPR_DISABLE_WRAPPED_MEMCPY
Add GPR_DISABLE_WRAPPED_MEMCPY to allow the user to disable wrapped
memcpy. This will fix build on x86_64 on musl/uclibc without changing
the cpu behavior.
Fixes:
- http://autobuild.buildroot.org/results/20d6f2489a4e291a53bd514da66105eb607e1014
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
[Upstream status: https://github.com/grpc/grpc/pull/19207]
---
src/core/lib/gpr/wrap_memcpy.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/core/lib/gpr/wrap_memcpy.cc b/src/core/lib/gpr/wrap_memcpy.cc
index 9b8608e056..38b76acf95 100644
--- a/src/core/lib/gpr/wrap_memcpy.cc
+++ b/src/core/lib/gpr/wrap_memcpy.cc
@@ -29,7 +29,7 @@
extern "C" {
#ifdef __linux__
#if defined(__x86_64__) && !defined(GPR_MUSL_LIBC_COMPAT) && \
- !defined(__ANDROID__)
+ !defined(__ANDROID__) && !defined(GPR_DISABLE_WRAPPED_MEMCPY)
__asm__(".symver memcpy,memcpy@GLIBC_2.2.5");
void* __wrap_memcpy(void* destination, const void* source, size_t num) {
return memcpy(destination, source, num);
--
2.20.1
+29
View File
@@ -0,0 +1,29 @@
config BR2_PACKAGE_GRPC
bool "grpc"
depends on BR2_INSTALL_LIBSTDCPP
depends on BR2_TOOLCHAIN_HAS_THREADS # protobuf, re2
depends on BR2_PACKAGE_PROTOBUF_ARCH_SUPPORTS # protobuf
depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 # protobuf, re2, libabseil-cpp
depends on BR2_HOST_GCC_AT_LEAST_4_9 # host-libabseil-cpp
depends on !BR2_STATIC_LIBS # protobuf, libabseil-cpp
depends on BR2_TOOLCHAIN_HAS_SYNC_4 || BR2_TOOLCHAIN_HAS_ATOMIC
depends on BR2_PACKAGE_LIBABSEIL_CPP_ARCH_SUPPORTS
select BR2_PACKAGE_C_ARES
select BR2_PACKAGE_LIBABSEIL_CPP
select BR2_PACKAGE_OPENSSL
select BR2_PACKAGE_PROTOBUF
select BR2_PACKAGE_RE2
select BR2_PACKAGE_ZLIB
help
A language-neutral, platform-neutral, open source, remote
procedure call (RPC) system initially developed at Google.
http://github.com/grpc/grpc
comment "grpc needs a toolchain w/ C++, threads, dynamic library, gcc >= 4.9, host gcc >= 4.9"
depends on BR2_PACKAGE_LIBABSEIL_CPP_ARCH_SUPPORTS
depends on BR2_TOOLCHAIN_HAS_SYNC_4 || BR2_TOOLCHAIN_HAS_ATOMIC
depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS \
|| BR2_STATIC_LIBS || !BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 \
|| !BR2_HOST_GCC_AT_LEAST_4_9
depends on BR2_PACKAGE_PROTOBUF_ARCH_SUPPORTS
+3
View File
@@ -0,0 +1,3 @@
# Locally computed
sha256 e5fb30aae1fa1cffa4ce00aa0bbfab908c0b899fcf0bbc30e268367d660d8656 grpc-1.41.0.tar.gz
sha256 cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30 LICENSE
+83
View File
@@ -0,0 +1,83 @@
################################################################################
#
# grpc
#
################################################################################
GRPC_VERSION = 1.41.0
GRPC_SITE = $(call github,grpc,grpc,v$(GRPC_VERSION))
GRPC_LICENSE = Apache-2.0
GRPC_LICENSE_FILES = LICENSE
GRPC_CPE_ID_VENDOR = grpc
GRPC_INSTALL_STAGING = YES
# Need to use host grpc_cpp_plugin during cross compilation.
GRPC_DEPENDENCIES = c-ares host-grpc libabseil-cpp openssl protobuf re2 zlib
HOST_GRPC_DEPENDENCIES = host-c-ares host-libabseil-cpp host-openssl host-protobuf \
host-re2 host-zlib
# gRPC_CARES_PROVIDER=package won't work because it requires c-ares to have
# installed a cmake config file, but buildroot uses c-ares' autotools build,
# which doesn't do this. These CARES settings trick the gRPC cmake code into
# not looking for c-ares at all and yet still linking with the library.
GRPC_CONF_OPTS = \
-DgRPC_ABSL_PROVIDER=package \
-D_gRPC_CARES_LIBRARIES=cares \
-DgRPC_CARES_PROVIDER=none \
-DgRPC_PROTOBUF_PROVIDER=package \
-DgRPC_RE2_PROVIDER=package \
-DgRPC_SSL_PROVIDER=package \
-DgRPC_ZLIB_PROVIDER=package \
-DgRPC_BUILD_GRPC_CPP_PLUGIN=OFF \
-DgRPC_BUILD_GRPC_CSHARP_PLUGIN=OFF \
-DgRPC_BUILD_GRPC_NODE_PLUGIN=OFF \
-DgRPC_BUILD_GRPC_OBJECTIVE_C_PLUGIN=OFF \
-DgRPC_BUILD_GRPC_PHP_PLUGIN=OFF \
-DgRPC_BUILD_GRPC_PYTHON_PLUGIN=OFF \
-DgRPC_BUILD_GRPC_RUBY_PLUGIN=OFF
# grpc can use __atomic builtins, so we need to link with
# libatomic when available
ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
GRPC_CONF_OPTS += -DCMAKE_EXE_LINKER_FLAGS=-latomic
endif
GRPC_CFLAGS = $(TARGET_CFLAGS)
GRPC_CXXFLAGS = $(TARGET_CXXFLAGS)
# Set GPR_DISABLE_WRAPPED_MEMCPY otherwise build will fail on x86_64 with uclibc
# because grpc tries to link with memcpy@GLIBC_2.2.5
ifeq ($(BR2_x86_64):$(BR2_TOOLCHAIN_USES_GLIBC),y:)
GRPC_CFLAGS += -DGPR_DISABLE_WRAPPED_MEMCPY
GRPC_CXXFLAGS += -DGPR_DISABLE_WRAPPED_MEMCPY
endif
ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_85180),y)
GRPC_CFLAGS += -O0
GRPC_CXXFLAGS += -O0
endif
# Toolchains older than gcc5 will fail to compile with -0s due to:
# error: failure memory model cannot be stronger than success memory model for
# '__atomic_compare_exchange', so we use -O2 in these cases
ifeq ($(BR2_TOOLCHAIN_GCC_AT_LEAST_5):$(BR2_OPTIMIZE_S),:y)
GRPC_CFLAGS += -O2
GRPC_CXXFLAGS += -O2
endif
GRPC_CONF_OPTS += \
-DCMAKE_C_FLAGS="$(GRPC_CFLAGS)" \
-DCMAKE_CXX_FLAGS="$(GRPC_CXXFLAGS)"
HOST_GRPC_CONF_OPTS = \
-DgRPC_ABSL_PROVIDER=package \
-D_gRPC_CARES_LIBRARIES=cares \
-DgRPC_CARES_PROVIDER=none \
-DgRPC_PROTOBUF_PROVIDER=package \
-DgRPC_RE2_PROVIDER=package \
-DgRPC_SSL_PROVIDER=package \
-DgRPC_ZLIB_PROVIDER=package
$(eval $(cmake-package))
$(eval $(host-cmake-package))