Bump buildroot to 2019.02
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
From aa18148e392ef28275a182db34397ccb66fb4617 Mon Sep 17 00:00:00 2001
|
||||
From: Robert Rose <robertroyrose@gmail.com>
|
||||
Date: Wed, 28 Nov 2018 09:41:52 -0800
|
||||
Subject: [PATCH] CMakeLists.txt: allow passing a pre-existing grpc_cpp_plugin
|
||||
|
||||
The grpc_cpp_plugin is meant to be executed during the build process
|
||||
of grpc. As such, in cross-compilation contexts, this program needs to
|
||||
be built for the host machine and not the target machine. In order to
|
||||
allow this, this commit adds an option gRPC_NATIVE_CPP_PLUGIN that can
|
||||
be passed on the command line, with the path to an existing
|
||||
grpc_cpp_plugin binary. If not passed, grpc_cpp_plugin is built as
|
||||
usual.
|
||||
|
||||
Signed-off-by: Robert Rose <robertroyrose@gmail.com>
|
||||
---
|
||||
CMakeLists.txt | 13 +++++++++++++
|
||||
1 file changed, 13 insertions(+)
|
||||
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index fc76cf5..7a22b08 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -13108,6 +13108,18 @@ target_link_libraries(grpc_cli
|
||||
endif (gRPC_BUILD_TESTS)
|
||||
if (gRPC_BUILD_CODEGEN)
|
||||
|
||||
+if (gRPC_NATIVE_CPP_PLUGIN)
|
||||
+
|
||||
+add_executable(grpc_cpp_plugin
|
||||
+ IMPORTED
|
||||
+)
|
||||
+
|
||||
+set_property(TARGET grpc_cpp_plugin
|
||||
+ PROPERTY IMPORTED_LOCATION ${gRPC_NATIVE_CPP_PLUGIN}
|
||||
+)
|
||||
+
|
||||
+else()
|
||||
+
|
||||
add_executable(grpc_cpp_plugin
|
||||
src/compiler/cpp_plugin.cc
|
||||
)
|
||||
@@ -13143,6 +13155,7 @@ if (gRPC_INSTALL)
|
||||
ARCHIVE DESTINATION ${gRPC_INSTALL_LIBDIR}
|
||||
)
|
||||
endif()
|
||||
+endif()
|
||||
|
||||
endif (gRPC_BUILD_CODEGEN)
|
||||
if (gRPC_BUILD_CODEGEN)
|
||||
--
|
||||
2.20.0.rc0.387.gc7a69e6b6c-goog
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
From 0aeefca28104f86f14b511feee8d5711f2e8bcb5 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 fc76cf50da..8dd457fb1a 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -94,6 +94,12 @@ endif()
|
||||
|
||||
set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
|
||||
|
||||
+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 ()
|
||||
+
|
||||
add_definitions(-DPB_FIELD_16BIT)
|
||||
|
||||
if (MSVC)
|
||||
diff --git a/include/grpc/impl/codegen/port_platform.h b/include/grpc/impl/codegen/port_platform.h
|
||||
index b2028a6305..dc89e6ed57 100644
|
||||
--- a/include/grpc/impl/codegen/port_platform.h
|
||||
+++ b/include/grpc/impl/codegen/port_platform.h
|
||||
@@ -173,7 +173,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.20.1
|
||||
|
||||
25
bsp/buildroot/package/grpc/Config.in
Normal file
25
bsp/buildroot/package/grpc/Config.in
Normal file
@@ -0,0 +1,25 @@
|
||||
config BR2_PACKAGE_GRPC
|
||||
bool "grpc"
|
||||
depends on BR2_INSTALL_LIBSTDCPP # protobuf
|
||||
depends on BR2_TOOLCHAIN_HAS_THREADS # protobuf
|
||||
depends on BR2_PACKAGE_PROTOBUF_ARCH_SUPPORTS # protobuf
|
||||
depends on BR2_HOST_GCC_AT_LEAST_4_8 # protobuf
|
||||
depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 # protobuf
|
||||
depends on !BR2_STATIC_LIBS # protobuf
|
||||
depends on BR2_TOOLCHAIN_HAS_SYNC_4 || BR2_TOOLCHAIN_HAS_ATOMIC
|
||||
select BR2_PACKAGE_C_ARES
|
||||
select BR2_PACKAGE_OPENSSL
|
||||
select BR2_PACKAGE_PROTOBUF
|
||||
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, host and target gcc >= 4.8"
|
||||
depends on BR2_TOOLCHAIN_HAS_SYNC_4 || BR2_TOOLCHAIN_HAS_ATOMIC
|
||||
depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS \
|
||||
|| BR2_STATIC_LIBS || !BR2_HOST_GCC_AT_LEAST_4_8 \
|
||||
|| !BR2_TOOLCHAIN_GCC_AT_LEAST_4_8
|
||||
depends on BR2_PACKAGE_PROTOBUF_ARCH_SUPPORTS
|
||||
3
bsp/buildroot/package/grpc/grpc.hash
Normal file
3
bsp/buildroot/package/grpc/grpc.hash
Normal file
@@ -0,0 +1,3 @@
|
||||
# Locally computed
|
||||
sha256 a5342629fe1b689eceb3be4d4f167b04c70a84b9d61cf8b555e968bc500bdb5a grpc-v1.16.1.tar.gz
|
||||
sha256 cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30 LICENSE
|
||||
41
bsp/buildroot/package/grpc/grpc.mk
Normal file
41
bsp/buildroot/package/grpc/grpc.mk
Normal file
@@ -0,0 +1,41 @@
|
||||
################################################################################
|
||||
#
|
||||
# grpc
|
||||
#
|
||||
################################################################################
|
||||
|
||||
GRPC_VERSION = v1.16.1
|
||||
GRPC_SITE = $(call github,grpc,grpc,$(GRPC_VERSION))
|
||||
GRPC_LICENSE = Apache-2.0
|
||||
GRPC_LICENSE_FILES = LICENSE
|
||||
|
||||
GRPC_INSTALL_STAGING = YES
|
||||
|
||||
# Need to use host grpc_cpp_plugin during cross compilation.
|
||||
GRPC_DEPENDENCIES = c-ares host-grpc openssl protobuf zlib
|
||||
HOST_GRPC_DEPENDENCIES = host-c-ares host-openssl host-protobuf host-zlib
|
||||
|
||||
GRPC_CONF_OPTS = \
|
||||
-D_gRPC_CARES_LIBRARIES=cares \
|
||||
-DgRPC_CARES_PROVIDER=none \
|
||||
-DgRPC_PROTOBUF_PROVIDER=package \
|
||||
-DgRPC_SSL_PROVIDER=package \
|
||||
-DgRPC_ZLIB_PROVIDER=package \
|
||||
-DgRPC_NATIVE_CPP_PLUGIN=$(HOST_DIR)/bin/grpc_cpp_plugin
|
||||
|
||||
# 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
|
||||
|
||||
HOST_GRPC_CONF_OPTS = \
|
||||
-D_gRPC_CARES_LIBRARIES=cares \
|
||||
-DgRPC_CARES_PROVIDER=none \
|
||||
-DgRPC_CARES_PROVIDER=none \
|
||||
-DgRPC_PROTOBUF_PROVIDER=package \
|
||||
-DgRPC_SSL_PROVIDER=package \
|
||||
-DgRPC_ZLIB_PROVIDER=package
|
||||
|
||||
$(eval $(cmake-package))
|
||||
$(eval $(host-cmake-package))
|
||||
Reference in New Issue
Block a user