Initial Commit

- initial default booting image
This commit is contained in:
2026-11-06 20:45:42 +01:00
commit b8783708ae
15201 changed files with 602532 additions and 0 deletions

View File

@@ -0,0 +1,66 @@
From 3e9f278145fafbfe15a868d0f9032ba590078c3b 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>
[buildroot@heine.tech:
1.42.0 added new logic to handle older glibc without pthread_setname_np()
but is still not sufficient for all cases. So alter the patch to wrap all
this with our cmake based workaround.
See: https://github.com/grpc/grpc/pull/27540
]
Signed-off-by: Michael Nosthoff <buildroot@heine.tech>
---
CMakeLists.txt | 6 ++++++
include/grpc/support/port_platform.h | 2 ++
2 files changed, 8 insertions(+)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f652a4055c..a2c978c7d8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -303,6 +303,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/support/port_platform.h b/include/grpc/support/port_platform.h
index 04a90fbf8a..6718233782 100644
--- a/include/grpc/support/port_platform.h
+++ b/include/grpc/support/port_platform.h
@@ -236,6 +236,7 @@
#endif /* _LP64 */
#ifdef __GLIBC__
#define GPR_POSIX_CRASH_HANDLER 1
+#if defined(HAVE_PTHREAD_SETNAME_NP)
#ifdef __GLIBC_PREREQ
#if __GLIBC_PREREQ(2, 12)
#define GPR_LINUX_PTHREAD_NAME 1
@@ -244,6 +245,7 @@
// musl libc & others
#define GPR_LINUX_PTHREAD_NAME 1
#endif
+#endif /* HAVE_PTHREAD_SETNAME_NP */
#include <linux/version.h>
#else /* musl libc */
#define GPR_MUSL_LIBC_COMPAT 1
--
2.43.0

View File

@@ -0,0 +1,215 @@
From fd7f0877e1e4f2305946a5579353d252012ea9e8 Mon Sep 17 00:00:00 2001
From: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
Date: Tue, 25 May 2021 14:55:23 +0200
Subject: [PATCH] Add option to restrict building of (host-)grpc to
grpc_cpp_plugin only.
This avoids unnecessary dependencies on big packages like libabseil-cpp and
others.
Upstream: not accepted (see https://github.com/grpc/grpc/issues/25322)
Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Updated for 1.76.0:
[build utf8_range_lib as it is now explicitly required]
Signed-off-by: Michael Nosthoff <buildroot@heine.tech>
[Bernd: rebased for 1.80.0]
Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
---
CMakeLists.txt | 39 +++++++++++++++++++++++++++++++++------
1 file changed, 33 insertions(+), 6 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bc86c00463..08441ddbd2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -50,12 +50,16 @@ set(gRPC_BUILD_MSVC_MP_COUNT 0 CACHE STRING "The maximum number of processes for
option(gRPC_BUILD_TESTS "Build tests" OFF)
option(gRPC_BUILD_CODEGEN "Build codegen" ON)
option(gRPC_DOWNLOAD_ARCHIVES "Download archives for empty 3rd party directories" ON)
+option(gRPC_BUILD_PLUGIN_SUPPORT_ONLY "Build plugin support only" OFF)
set(gRPC_INSTALL_default ON)
if(NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
# Disable gRPC_INSTALL by default if building as a submodule
set(gRPC_INSTALL_default OFF)
endif()
+if(gRPC_BUILD_PLUGIN_SUPPORT_ONLY)
+ set(gRPC_INSTALL_default OFF)
+endif()
set(gRPC_INSTALL ${gRPC_INSTALL_default} CACHE BOOL
"Generate installation target")
@@ -689,6 +693,8 @@ add_custom_target(plugins
DEPENDS ${_gRPC_PLUGIN_LIST}
)
+if (NOT gRPC_BUILD_PLUGIN_SUPPORT_ONLY)
+
add_custom_target(tools_c
DEPENDS
)
@@ -700,6 +706,8 @@ add_custom_target(tools_cxx
add_custom_target(tools
DEPENDS tools_c tools_cxx)
+endif() # gRPC_BUILD_PLUGIN_SUPPORT_ONLY
+
protobuf_generate_grpc_cpp_with_import_path_correction(
src/core/ext/transport/chaotic_good/chaotic_good_frame.proto src/core/ext/transport/chaotic_good/chaotic_good_frame.proto
)
@@ -1986,7 +1994,7 @@ if(gRPC_BUILD_TESTS)
DEPENDS buildtests_c buildtests_cxx)
endif()
-
+if (NOT gRPC_BUILD_PLUGIN_SUPPORT_ONLY)
add_library(address_sorting
third_party/address_sorting/address_sorting.c
@@ -3221,6 +3229,8 @@ if(gRPC_INSTALL)
)
endif()
+endif() # gRPC_BUILD_PLUGIN_SUPPORT_ONLY
+
if(gRPC_BUILD_TESTS)
add_library(grpc_test_util
@@ -3371,6 +3381,8 @@ endif()
endif()
+if(NOT gRPC_BUILD_PLUGIN_SUPPORT_ONLY)
+
add_library(grpc_unsecure
src/core/call/call_arena_allocator.cc
src/core/call/call_filters.cc
@@ -3951,6 +3963,8 @@ if(gRPC_INSTALL)
)
endif()
+endif() # gRPC_BUILD_PLUGIN_SUPPORT_ONLY
+
if(gRPC_BUILD_TESTS)
add_library(gtest
@@ -4025,6 +4039,8 @@ target_link_libraries(gtest
endif()
+if(NOT gRPC_BUILD_PLUGIN_SUPPORT_ONLY)
+
add_library(upb_base_lib
third_party/upb/upb/base/status.c
)
@@ -4641,6 +4657,7 @@ if(gRPC_INSTALL)
)
endif()
+endif() # gRPC_BUILD_PLUGIN_SUPPORT_ONLY
add_library(utf8_range_lib
third_party/utf8_range/utf8_range.c
@@ -4681,7 +4698,7 @@ target_link_libraries(utf8_range_lib
${_gRPC_ALLTARGETS_LIBRARIES}
)
-
+if (NOT gRPC_BUILD_PLUGIN_SUPPORT_ONLY)
if(gRPC_INSTALL)
install(TARGETS utf8_range_lib EXPORT gRPCTargets
@@ -4692,6 +4709,8 @@ if(gRPC_INSTALL)
)
endif()
+endif() # gRPC_BUILD_PLUGIN_SUPPORT_ONLY
+
if(gRPC_BUILD_TESTS)
if(gRPC_BUILD_CODEGEN)
@@ -4784,6 +4803,8 @@ endif()
endif()
+if(NOT gRPC_BUILD_PLUGIN_SUPPORT_ONLY)
+
add_library(grpc++
src/cpp/client/call_credentials.cc
src/cpp/client/channel_cc.cc
@@ -5263,6 +5284,7 @@ if(gRPC_INSTALL)
)
endif()
+endif() # gRPC_BUILD_PLUGIN_SUPPORT_ONLY
if(gRPC_BUILD_CODEGEN)
add_library(grpc++_reflection ${_gRPC_STATIC_WIN32}
@@ -5537,6 +5559,8 @@ target_link_libraries(grpc++_test_util
endif()
+if(NOT gRPC_BUILD_PLUGIN_SUPPORT_ONLY)
+
add_library(grpc++_unsecure
src/cpp/client/call_credentials.cc
src/cpp/client/channel_cc.cc
@@ -6285,6 +6309,7 @@ if(gRPC_INSTALL)
)
endif()
+endif() # gRPC_BUILD_PLUGIN_SUPPORT_ONLY
add_library(grpc_plugin_support
src/compiler/cpp_generator.cc
@@ -6385,7 +6410,7 @@ foreach(_hdr
endforeach()
-if(gRPC_INSTALL)
+if(gRPC_INSTALL OR gRPC_BUILD_PLUGIN_SUPPORT_ONLY)
install(TARGETS grpc_plugin_support EXPORT gRPCTargets
RUNTIME DESTINATION ${gRPC_INSTALL_BINDIR}
BUNDLE DESTINATION ${gRPC_INSTALL_BINDIR}
@@ -18827,7 +18852,7 @@ target_link_libraries(grpc_completion_queue_test
endif()
-if(gRPC_BUILD_CODEGEN AND gRPC_BUILD_GRPC_CPP_PLUGIN)
+if(gRPC_BUILD_GRPC_CPP_PLUGIN)
add_executable(grpc_cpp_plugin
src/compiler/cpp_plugin.cc
@@ -18855,7 +18880,7 @@ target_link_libraries(grpc_cpp_plugin
-if(gRPC_INSTALL)
+if(gRPC_INSTALL OR gRPC_BUILD_PLUGIN_SUPPORT_ONLY)
install(TARGETS grpc_cpp_plugin EXPORT gRPCPluginTargets
RUNTIME DESTINATION ${gRPC_INSTALL_BINDIR}
BUNDLE DESTINATION ${gRPC_INSTALL_BINDIR}
@@ -51904,7 +51929,7 @@ endif()
-
+if (NOT gRPC_BUILD_PLUGIN_SUPPORT_ONLY)
if(gRPC_INSTALL)
install(EXPORT gRPCTargets
@@ -54105,6 +54105,8 @@
"-laddress_sorting -lupb_textformat_lib -lupb_reflection_lib -lupb_wire_lib -lupb_message_lib -lutf8_range_lib -lupb_mini_descriptor_lib -lupb_mini_table_lib -lupb_hash_lib -lupb_mem_lib -lupb_base_lib -lupb_lex_lib"
"grpc++_unsecure.pc")
+endif() # gRPC_BUILD_PLUGIN_SUPPORT_ONLY
+
if(gRPC_BUILD_GRPCPP_OTEL_PLUGIN)
# grpcpp_otel_plugin .pc file
generate_pkgconfig(
--
2.43.0

27
package/grpc/Config.in Normal file
View File

@@ -0,0 +1,27 @@
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_8 # libabseil-cpp, re2
depends on !BR2_STATIC_LIBS # protobuf, libabseil-cpp, re2
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 >= 8"
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_8
depends on BR2_PACKAGE_PROTOBUF_ARCH_SUPPORTS

3
package/grpc/grpc.hash Normal file
View File

@@ -0,0 +1,3 @@
# Locally computed
sha256 38f58596277fa632064cc0719b9ece4381c8c77461cb51e9b66ca149574b7865 grpc-1.80.0.tar.gz
sha256 58c86a3f2b5cca0ebdf9ed3e7f4e6dc38e3b38796d8c3dc92064c62a4e39d0dd LICENSE

90
package/grpc/grpc.mk Normal file
View File

@@ -0,0 +1,90 @@
################################################################################
#
# grpc
#
################################################################################
GRPC_VERSION = 1.80.0
GRPC_SITE = $(call github,grpc,grpc,v$(GRPC_VERSION))
GRPC_LICENSE = Apache-2.0, BSD-3-Clause (third_party code), MPL-2.0 (etc/roots.pem)
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-protobuf
# 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 = \
-DCMAKE_EXE_LINKER_FLAGS="$(GRPC_EXE_LINKER_FLAGS)" \
-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_CODEGEN=OFF \
-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 \
-DgRPC_DOWNLOAD_ARCHIVES=OFF
ifeq ($(BR2_PACKAGE_LIBEXECINFO),y)
GRPC_DEPENDENCIES += libexecinfo
GRPC_EXE_LINKER_FLAGS += -lexecinfo
endif
# grpc can use __atomic builtins, so we need to link with
# libatomic when available
ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
GRPC_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
GRPC_CONF_OPTS += \
-DCMAKE_C_FLAGS="$(GRPC_CFLAGS)" \
-DCMAKE_CXX_FLAGS="$(GRPC_CXXFLAGS)"
# For host-grpc, we only need the 'grpc_cpp_plugin' binary, which is needed for
# target grpc compilation. To avoid unnecessary build steps and host
# dependencies, supply enough options to pass the configure checks without
# requiring other host packages, unless those needed by grpc_cpp_plugin.
HOST_GRPC_CONF_OPTS = \
-DgRPC_PROTOBUF_PROVIDER=package \
-DgRPC_ABSL_PROVIDER=none \
-DgRPC_CARES_PROVIDER=none \
-DgRPC_RE2_PROVIDER=none \
-DgRPC_SSL_PROVIDER=none \
-DgRPC_ZLIB_PROVIDER=none \
-DgRPC_BUILD_CODEGEN=OFF \
-DgRPC_BUILD_PLUGIN_SUPPORT_ONLY=ON \
-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 \
-DgRPC_BUILD_GRPCPP_OTEL_PLUGIN=OFF \
-DgRPC_DOWNLOAD_ARCHIVES=OFF
$(eval $(cmake-package))
$(eval $(host-cmake-package))