package/grpc: bump to version 1.25.0
PATCH v4 1/1 package/grpc: bump to version 1.25.0
From: Adam Duskett <[email protected]>
Other changes:
- Remove upstream patch 0004-Fix-gettid-naming-conflict.patch
- Remove upstream patch 0005-Rename-gettid-functions.patch
- Add a check for BR2_TOOLCHAIN_GCC_AT_LEAST_5 in grpc.mk. If the selected toolchain is not at least version 5 or higher, set the GRPC_CFLAGS and GRPC_CXXFLAGS optimizations to -O3. This check prevents the following error:
error: failure memory model cannot be stronger than success memory model for '__atomic_compare_exchange'
Tested with test-pkg, all tests passed:
br-arm-full [1/6]: OK
br-arm-cortex-a9-glibc [2/6]: OK
br-arm-cortex-m4-full [3/6]: SKIPPED
br-x86-64-musl [4/6]: OK
br-arm-full-static [5/6]: SKIPPED---
Changes v1 -> v2:
- Fix the hceck for BR2_TOOLCHAIN_GCC_AT_LEAST_5. It should have read ifneq not ifeq.
Changes v2 -> v3:
- Move the comment explaining why CFLAGS and CXX flags are being set to -O0 if BR2_TOOLCHAIN_GCC_AT_LEAST_5 is not selected to the appropriate place. (Yann)
- Remove the # protobuf from depends on BR2_INSTALL_LIBSTDCPP as grpc now requires C++ on it's own. (Yann)
Changes v3 -> v4:
- Change -O0 to -O3. This not only works, but saves 8.5MB on space. (Thomas)
.../0001-target-build-using-host-plugin.patch | 4 +- ...the-availability-of-pthread_setname_.patch | 8 +- .../0004-Fix-gettid-naming-conflict.patch | 36 -------- .../grpc/0005-Rename-gettid-functions.patch | 83 ------------------- package/grpc/Config.in | 2 +- package/grpc/grpc.hash | 2 +- package/grpc/grpc.mk | 10 ++- 7 files changed, 17 insertions(+), 128 deletions(-) delete mode 100644 package/grpc/0004-Fix-gettid-naming-conflict.patch delete mode 100644 package/grpc/0005-Rename-gettid-functions.patch
package/grpc/0001-target-build-using-host-plugin.patch +2 -2
@@ -20,7 +20,7 @@ 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 +@@ -13420,6 +13420,18 @@ target_link_libraries(grpc_cli endif (gRPC_BUILD_TESTS) if (gRPC_BUILD_CODEGEN)
@@ -39,7 +39,7 @@ index fc76cf5..7a22b08 100644 add_executable(grpc_cpp_plugin src/compiler/cpp_plugin.cc ) -@@ -13143,6 +13155,7 @@ if (gRPC_INSTALL) +@@ -13457,6 +13469,7 @@ if (gRPC_INSTALL) ARCHIVE DESTINATION ${gRPC_INSTALL_LIBDIR} ) endif()
package/grpc/0002-Properly-detect-the-availability-of-pthread_setname_.patch +4 -4
@@ -20,7 +20,7 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt index 89e834b..c7bd2ad 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -94,6 +94,12 @@ endif() +@@ -97,6 +97,12 @@ endif() set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
@@ -30,14 +30,14 @@ index 89e834b..c7bd2ad 100644 + add_definitions(-DHAVE_PTHREAD_SETNAME_NP) +endif () + - add_definitions(-DPB_FIELD_32BIT) - 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 031c0c3..a29a9dc 100644 --- a/include/grpc/impl/codegen/port_platform.h +++ b/include/grpc/impl/codegen/port_platform.h -@@ -173,7 +173,9 @@ +@@ -181,7 +181,9 @@ #endif /* _LP64 */ #ifdef __GLIBC__ #define GPR_POSIX_CRASH_HANDLER 1
package/grpc/0004-Fix-gettid-naming-conflict.patch deleted +0 -36
@@ -1,36 +0,0 @@ -From de6255941a5e1c2fb2d50e57f84e38c09f45023d Mon Sep 17 00:00:00 2001 -From: Juanli Shen <[email protected]> -Date: Fri, 23 Aug 2019 08:46:09 -0700 -Subject: [PATCH] Fix gettid() naming conflict - -[Retrieved from: -https://github.com/grpc/grpc/commit/de6255941a5e1c2fb2d50e57f84e38c09f45023d] -Signed-off-by: Fabrice Fontaine <[email protected]> ---- - src/core/lib/gpr/log_linux.cc | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/src/core/lib/gpr/log_linux.cc b/src/core/lib/gpr/log_linux.cc -index 561276f0c20..81026e5689b 100644 ---- a/src/core/lib/gpr/log_linux.cc -+++ b/src/core/lib/gpr/log_linux.cc -@@ -40,7 +40,9 @@ - #include <time.h> - #include <unistd.h> - --static long gettid(void) { return syscall(__NR_gettid); } -+// Not naming it as gettid() to avoid duplicate declarations when complied with -+// GCC 9.1. -+static long local_gettid(void) { return syscall(__NR_gettid); } - - void gpr_log(const char* file, int line, gpr_log_severity severity, - const char* format, ...) { -@@ -70,7 +72,7 @@ void gpr_default_log(gpr_log_func_args* args) { - gpr_timespec now = gpr_now(GPR_CLOCK_REALTIME); - struct tm tm; - static __thread long tid = 0; -- if (tid == 0) tid = gettid(); -+ if (tid == 0) tid = local_gettid(); - - timer = static_cast<time_t>(now.tv_sec); - final_slash = strrchr(args->file, '/');
package/grpc/0005-Rename-gettid-functions.patch deleted +0 -83
83 lines not on this page · raw message
package/grpc/Config.in +1 -1
@@ -1,6 +1,6 @@ config BR2_PACKAGE_GRPC bool "grpc" - depends on BR2_INSTALL_LIBSTDCPP # protobuf + depends on BR2_INSTALL_LIBSTDCPP depends on BR2_TOOLCHAIN_HAS_THREADS # protobuf depends on BR2_PACKAGE_PROTOBUF_ARCH_SUPPORTS # protobuf depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 # protobuf
package/grpc/grpc.hash +1 -1
@@ -1,3 +1,3 @@ # Locally computed -sha256 f56ced18740895b943418fa29575a65cc2396ccfa3159fa40d318ef5f59471f9 grpc-1.23.0.tar.gz +sha256 ffbe61269160ea745e487f79b0fd06b6edd3d50c6d9123f053b5634737cf2f69 grpc-1.25.0.tar.gz sha256 cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30 LICENSE
package/grpc/grpc.mk +9 -1
@@ -4,7 +4,7 @@ # ################################################################################ -GRPC_VERSION = 1.23.0 +GRPC_VERSION = 1.25.0 GRPC_SITE = $(call github,grpc,grpc,v$(GRPC_VERSION)) GRPC_LICENSE = Apache-2.0 GRPC_LICENSE_FILES = LICENSE
@@ -48,6 +48,14 @@ 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' +ifneq ($(BR2_TOOLCHAIN_GCC_AT_LEAST_5),y) +GRPC_CFLAGS += -O3 +GRPC_CXXFLAGS += -O3 +endif + GRPC_CONF_OPTS += \ -DCMAKE_C_FLAGS="$(GRPC_CFLAGS)" \ -DCMAKE_CXX_FLAGS="$(GRPC_CXXFLAGS)"
Signature · 1 line
2.23.0
PATCH v4 1/1 package/grpc: bump to version 1.25.0
package/grpc/grpc.mk GRPC_CFLAGS += -O0 · line 54
Quoted 4 lines · On Fri, 6 Dec 2019 10:27:26 -0800 aduskett at gmail.com wrote:
package/grpc/grpc.mk +4
-0+# 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' +ifneq ($(BR2_TOOLCHAIN_GCC_AT_LEAST_5),y)
That's not what I want. What I want is:
ifeq ($(BR2_TOOLCHAIN_GCC_AT_LEAST_5):$(BR2_OPTIMIZE_S),:y) GRPC_CFLAGS += -O0GRPC_CXXFLAGS += -O0
endif
i.e, override the flags only when -Os is used.
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
PATCH v4 1/1 package/grpc: bump to version 1.25.0
Quoted 11 lines · Thomas Petazzoni
package/grpc/grpc.mk GRPC_CFLAGS += -O0 · line 54
Quoted 4 lines · On Fri, 6 Dec 2019 10:27:26 -0800 aduskett at gmail.com wrote:
package/grpc/grpc.mk +4
-0+# 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' +ifneq ($(BR2_TOOLCHAIN_GCC_AT_LEAST_5),y)That's not what I want. What I want is:
Then tell me! I'm not a mind reader! Submitting the same patch over and over again is
frustrating when it's little changes that aren't covered in the initial review but could have been.
Quoted 5 lines
ifeq ($(BR2_TOOLCHAIN_GCC_AT_LEAST_5):$(BR2_OPTIMIZE_S),:y)
GRPC_CFLAGS+= -O0GRPC_CXXFLAGS+= -O0
endif
Quoted 7 lines
i.e, override the flags only when -Os is used.
Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
Adam