package/grpc: fix build with uclibc on x86_64
PATCH v4 1/1 package/grpc: fix build with uclibc on x86_64
On x86_64 if GPR_MUSL_LIBC_COMPAT is not set, grpc tries to link with memcpy at GLIBC_2.2.5, see:
https://github.com/grpc/grpc/blob/618a3f561d4a93f263cca23abad086ed8f4d5e86/src/core/lib/gpr/wrap_memcpy.cc
Add a new GPR_DISABLE_WRAPPED_MEMCPY to disable wrapped memory without changing CPU behavior
Fixes:
- http://autobuild.buildroot.org/results/20d6f2489a4e291a53bd514da66105eb607e1014
---
Changes v3 -> v4:
- Add upstream URL for patch
- Fix typo in GPR_DISABLE_WRAPPED_MEMCPY
Changes v2 -> v3 (after review of Thomas Petazzoni and Arnout Vandecappelle):
- Add GPR_DISABLE_WRAPPED_MEMCPY variable instead of using GPR_MUSL_LIBC_COMPAT to avoid changing CPU behavior
Changes v1 -> v2:
- Pass TARGET_CXXFLAGS to CMAKE_CXX_FLAGS
...py.cc-add-GPR_DISABLE_WRAPPED_MEMCPY.patch | 34 +++++++++++++++++++ package/grpc/grpc.mk | 8 +++++ 2 files changed, 42 insertions(+) create mode 100644 package/grpc/0003-wrap_memcpy.cc-add-GPR_DISABLE_WRAPPED_MEMCPY.patch
package/grpc/0003-wrap_memcpy.cc-add-GPR_DISABLE_WRAPPED_MEMCPY.patch new file +34 -0
@@ -0,0 +1,34 @@ +From be030314805137cd63b46ea6eaa702b608669910 Mon Sep 17 00:00:00 2001 +From: Fabrice Fontaine <[email protected]> +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 <[email protected]> +[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 +@@ -28,7 +28,7 @@ + + extern "C" { + #ifdef __linux__ +-#if defined(__x86_64__) && !defined(GPR_MUSL_LIBC_COMPAT) ++#if defined(__x86_64__) && !defined(GPR_MUSL_LIBC_COMPAT) && !defined(GPR_DISABLE_WRAPPED_MEMCPY) + __asm__(".symver memcpy,memcpy at GLIBC_2.2.5"); + void* __wrap_memcpy(void* destination, const void* source, size_t num) { + return memcpy(destination, source, num); +-- +2.20.1 +
package/grpc/grpc.mk +8 -0
@@ -33,6 +33,14 @@ ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y) GRPC_CONF_OPTS += -DCMAKE_EXE_LINKER_FLAGS=-latomic endif +# Set GPR_DISABLE_WRAPPED_MEMCPY otherwise build will fail on x86_64 with uclibc +# because grpc tries to link with memcpy at GLIBC_2.2.5 +ifeq ($(BR2_x86_64):$(BR2_TOOLCHAIN_USES_GLIBC),y:) +GRPC_CONF_OPTS += \ + -DCMAKE_C_FLAGS="$(TARGET_CFLAGS) -DGPR_DISABLE_WRAPPED_MEMCPY" \ + -DCMAKE_CXX_FLAGS="$(TARGET_CXXFLAGS) -DGPR_DISABLE_WRAPPED_MEMCPY" +endif + HOST_GRPC_CONF_OPTS = \ -D_gRPC_CARES_LIBRARIES=cares \ -DgRPC_CARES_PROVIDER=none \
Signature · 1 line
2.20.1
Arnout Vandecappelle
AppliedPATCH v4 1/1 package/grpc: fix build with uclibc on x86_64
Quoted 11 lines · Fabrice Fontaine
On
x86_64ifGPR_MUSL_LIBC_COMPATis not set, grpc tries to link with memcpy at GLIBC_2.2.5, see:
https://github.com/grpc/grpc/blob/618a3f561d4a93f263cca23abad086ed8f4d5e86/src/core/lib/gpr/wrap_memcpy.ccAdd a new
GPR_DISABLE_WRAPPED_MEMCPYto disable wrapped memory without changing CPU behaviorFixes:
- http://autobuild.buildroot.org/results/20d6f2489a4e291a53bd514da66105eb607e1014Signed-off-by Fabrice Fontaine <[email protected]>
Applied to master, thanks.
Regards,
Arnout
Quoted 78 lines
---
Changes v3 -> v4:
- Add upstream URL for patch
- Fix typo inGPR_DISABLE_WRAPPED_MEMCPYChanges v2 -> v3 (after review of Thomas Petazzoni and Arnout Vandecappelle):
- AddGPR_DISABLE_WRAPPED_MEMCPYvariable instead of usingGPR_MUSL_LIBC_COMPATto avoid changing CPU behaviorChanges v1 -> v2:
- PassTARGET_CXXFLAGStoCMAKE_CXX_FLAGS...py.cc-add-GPR_DISABLE_WRAPPED_MEMCPY.patch | 34 +++++++++++++++++++ package/grpc/grpc.mk | 8 +++++ 2 files changed, 42 insertions(+) create mode 100644 package/grpc/0003-wrap_memcpy.cc-add-GPR_DISABLE_WRAPPED_MEMCPY.patchpackage/grpc/0003-wrap_memcpy.cc-add-GPR_DISABLE_WRAPPED_MEMCPY.patch new file +34
-0@@ -0,0 +1,34 @@ +From be030314805137cd63b46ea6eaa702b608669910 Mon Sep 17 00:00:00 2001 +From: Fabrice Fontaine <[email protected]> +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 <[email protected]> +[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 +@@ -28,7 +28,7 @@ + + extern "C" { + #ifdef __linux__ +-#if defined(__x86_64__) && !defined(GPR_MUSL_LIBC_COMPAT) ++#if defined(__x86_64__) && !defined(GPR_MUSL_LIBC_COMPAT) && !defined(GPR_DISABLE_WRAPPED_MEMCPY) + __asm__(".symver memcpy,memcpy at GLIBC_2.2.5"); + void* __wrap_memcpy(void* destination, const void* source, size_t num) { + return memcpy(destination, source, num); +-- +2.20.1 +package/grpc/grpc.mk +8
-0@@ -33,6 +33,14 @@ ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y) GRPC_CONF_OPTS += -DCMAKE_EXE_LINKER_FLAGS=-latomic endif +# Set GPR_DISABLE_WRAPPED_MEMCPY otherwise build will fail on x86_64 with uclibc +# because grpc tries to link with memcpy at GLIBC_2.2.5 +ifeq ($(BR2_x86_64):$(BR2_TOOLCHAIN_USES_GLIBC),y:) +GRPC_CONF_OPTS += \ + -DCMAKE_C_FLAGS="$(TARGET_CFLAGS) -DGPR_DISABLE_WRAPPED_MEMCPY" \ + -DCMAKE_CXX_FLAGS="$(TARGET_CXXFLAGS) -DGPR_DISABLE_WRAPPED_MEMCPY" +endif + HOST_GRPC_CONF_OPTS = \ -D_gRPC_CARES_LIBRARIES=cares \ -DgRPC_CARES_PROVIDER=none \
PATCH v4 1/1 package/grpc: fix build with uclibc on x86_64
In reply to Fabrice FontaineQuoted 9 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Fabrice" == Fabrice Fontaine <[email protected]> writes:
On
x86_64ifGPR_MUSL_LIBC_COMPATis not set, grpc tries to link with memcpy at GLIBC_2.2.5, see:
https://github.com/grpc/grpc/blob/618a3f561d4a93f263cca23abad086ed8f4d5e86/src/core/lib/gpr/wrap_memcpy.ccAdd a new
GPR_DISABLE_WRAPPED_MEMCPYto disable wrapped memory without changing CPU behavior
Quoted 8 lines
Fixes:
- http://autobuild.buildroot.org/results/20d6f2489a4e291a53bd514da66105eb607e1014Signed-off-by Fabrice Fontaine <[email protected]>---
Changes v3 -> v4:
- Add upstream URL for patch
- Fix typo inGPR_DISABLE_WRAPPED_MEMCPY
Committed to 2019.05.x, thanks.
Signature · 1 line
Bye, Peter Korsgaard