[Core] Remove wrap_memcpy (#35826)
gRPC has been having the `wrap_memcpy` workaround to handle the breaking change of `memcpy` on glibc 2.14 ([ref1](https://www.win.tue.nl/~aeb/linux/misc/gcc-semibug.html), [ref2](https://stackoverflow.com/questions/35656696/explanation-of-memcpy-memmove-glibc-2-14-2-2-5)). This was necessary to build more portable artifacts which are expected to run on most linux distributions and we manged to have https://github.com/grpc/grpc/pull/5007 years ago for this.
Since we started to use manylinux2010-based docker images for artifacts, however, this became unnecessary since CentOS 6 has glibc 2.12 which is older than 2.14 so it doesn't have memcpy issue, which is another benefit of using manylinux2010.
Superseding https://github.com/grpc/grpc/pull/23385
Changes after the original PR was made; Ruby is using manylinux images (manylinux2014) enabling this change, no more old docker images in our test env.
Closes #35826
COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/35826 from veblush:del-wrap-memcpy-2 71e6718356
PiperOrigin-RevId: 607499060
pull/35923/head
parent
2c9b599e5e
commit
34be0d84a9
17 changed files with 0 additions and 59 deletions
@ -1,43 +0,0 @@ |
||||
//
|
||||
//
|
||||
// Copyright 2016 gRPC authors.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
//
|
||||
|
||||
#include <grpc/support/port_platform.h> |
||||
|
||||
#include <string.h> |
||||
|
||||
// Provide a wrapped memcpy for targets that need to be backwards
|
||||
// compatible with older libc's.
|
||||
//
|
||||
// Enable by setting LDFLAGS=-Wl,-wrap,memcpy when linking.
|
||||
//
|
||||
|
||||
extern "C" { |
||||
#ifdef __linux__ |
||||
#if defined(__x86_64__) && !defined(GPR_MUSL_LIBC_COMPAT) && \ |
||||
!defined(__ANDROID__) |
||||
__asm__(".symver memcpy,memcpy@GLIBC_2.2.5"); |
||||
void* __wrap_memcpy(void* destination, const void* source, size_t num) { |
||||
return memcpy(destination, source, num); |
||||
} |
||||
#else // !__x86_64__
|
||||
void* __wrap_memcpy(void* destination, const void* source, size_t num) { |
||||
return memmove(destination, source, num); |
||||
} |
||||
#endif |
||||
#endif |
||||
} |
Loading…
Reference in new issue