[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
This commit is contained in:
parent
2c9b599e5e
commit
34be0d84a9
1
BUILD
1
BUILD
|
|
@ -706,7 +706,6 @@ grpc_cc_library(
|
|||
"//src/core:lib/gpr/windows/sync.cc",
|
||||
"//src/core:lib/gpr/windows/time.cc",
|
||||
"//src/core:lib/gpr/windows/tmpfile.cc",
|
||||
"//src/core:lib/gpr/wrap_memcpy.cc",
|
||||
"//src/core:lib/gprpp/crash.cc",
|
||||
"//src/core:lib/gprpp/fork.cc",
|
||||
"//src/core:lib/gprpp/host_port.cc",
|
||||
|
|
|
|||
|
|
@ -1641,7 +1641,6 @@ add_library(gpr
|
|||
src/core/lib/gpr/windows/sync.cc
|
||||
src/core/lib/gpr/windows/time.cc
|
||||
src/core/lib/gpr/windows/tmpfile.cc
|
||||
src/core/lib/gpr/wrap_memcpy.cc
|
||||
src/core/lib/gprpp/crash.cc
|
||||
src/core/lib/gprpp/examine_stack.cc
|
||||
src/core/lib/gprpp/fork.cc
|
||||
|
|
|
|||
|
|
@ -864,7 +864,6 @@ LIBGPR_SRC = \
|
|||
src/core/lib/gpr/windows/sync.cc \
|
||||
src/core/lib/gpr/windows/time.cc \
|
||||
src/core/lib/gpr/windows/tmpfile.cc \
|
||||
src/core/lib/gpr/wrap_memcpy.cc \
|
||||
src/core/lib/gprpp/crash.cc \
|
||||
src/core/lib/gprpp/examine_stack.cc \
|
||||
src/core/lib/gprpp/fork.cc \
|
||||
|
|
|
|||
|
|
@ -1333,7 +1333,6 @@ let package = Package(
|
|||
"src/core/lib/gpr/windows/sync.cc",
|
||||
"src/core/lib/gpr/windows/time.cc",
|
||||
"src/core/lib/gpr/windows/tmpfile.cc",
|
||||
"src/core/lib/gpr/wrap_memcpy.cc",
|
||||
"src/core/lib/gprpp/atomic_utils.h",
|
||||
"src/core/lib/gprpp/bitset.h",
|
||||
"src/core/lib/gprpp/chunked_vector.h",
|
||||
|
|
|
|||
|
|
@ -107,7 +107,6 @@ libs:
|
|||
- src/core/lib/gpr/windows/sync.cc
|
||||
- src/core/lib/gpr/windows/time.cc
|
||||
- src/core/lib/gpr/windows/tmpfile.cc
|
||||
- src/core/lib/gpr/wrap_memcpy.cc
|
||||
- src/core/lib/gprpp/crash.cc
|
||||
- src/core/lib/gprpp/examine_stack.cc
|
||||
- src/core/lib/gprpp/fork.cc
|
||||
|
|
|
|||
|
|
@ -567,7 +567,6 @@ if test "$PHP_GRPC" != "no"; then
|
|||
src/core/lib/gpr/windows/sync.cc \
|
||||
src/core/lib/gpr/windows/time.cc \
|
||||
src/core/lib/gpr/windows/tmpfile.cc \
|
||||
src/core/lib/gpr/wrap_memcpy.cc \
|
||||
src/core/lib/gprpp/crash.cc \
|
||||
src/core/lib/gprpp/examine_stack.cc \
|
||||
src/core/lib/gprpp/fork.cc \
|
||||
|
|
|
|||
|
|
@ -532,7 +532,6 @@ if (PHP_GRPC != "no") {
|
|||
"src\\core\\lib\\gpr\\windows\\sync.cc " +
|
||||
"src\\core\\lib\\gpr\\windows\\time.cc " +
|
||||
"src\\core\\lib\\gpr\\windows\\tmpfile.cc " +
|
||||
"src\\core\\lib\\gpr\\wrap_memcpy.cc " +
|
||||
"src\\core\\lib\\gprpp\\crash.cc " +
|
||||
"src\\core\\lib\\gprpp\\examine_stack.cc " +
|
||||
"src\\core\\lib\\gprpp\\fork.cc " +
|
||||
|
|
|
|||
|
|
@ -1446,7 +1446,6 @@ Pod::Spec.new do |s|
|
|||
'src/core/lib/gpr/windows/sync.cc',
|
||||
'src/core/lib/gpr/windows/time.cc',
|
||||
'src/core/lib/gpr/windows/tmpfile.cc',
|
||||
'src/core/lib/gpr/wrap_memcpy.cc',
|
||||
'src/core/lib/gprpp/atomic_utils.h',
|
||||
'src/core/lib/gprpp/bitset.h',
|
||||
'src/core/lib/gprpp/chunked_vector.h',
|
||||
|
|
|
|||
|
|
@ -1339,7 +1339,6 @@ Gem::Specification.new do |s|
|
|||
s.files += %w( src/core/lib/gpr/windows/sync.cc )
|
||||
s.files += %w( src/core/lib/gpr/windows/time.cc )
|
||||
s.files += %w( src/core/lib/gpr/windows/tmpfile.cc )
|
||||
s.files += %w( src/core/lib/gpr/wrap_memcpy.cc )
|
||||
s.files += %w( src/core/lib/gprpp/atomic_utils.h )
|
||||
s.files += %w( src/core/lib/gprpp/bitset.h )
|
||||
s.files += %w( src/core/lib/gprpp/chunked_vector.h )
|
||||
|
|
|
|||
|
|
@ -227,7 +227,6 @@
|
|||
'src/core/lib/gpr/windows/sync.cc',
|
||||
'src/core/lib/gpr/windows/time.cc',
|
||||
'src/core/lib/gpr/windows/tmpfile.cc',
|
||||
'src/core/lib/gpr/wrap_memcpy.cc',
|
||||
'src/core/lib/gprpp/crash.cc',
|
||||
'src/core/lib/gprpp/examine_stack.cc',
|
||||
'src/core/lib/gprpp/fork.cc',
|
||||
|
|
|
|||
|
|
@ -1321,7 +1321,6 @@
|
|||
<file baseinstalldir="/" name="src/core/lib/gpr/windows/sync.cc" role="src" />
|
||||
<file baseinstalldir="/" name="src/core/lib/gpr/windows/time.cc" role="src" />
|
||||
<file baseinstalldir="/" name="src/core/lib/gpr/windows/tmpfile.cc" role="src" />
|
||||
<file baseinstalldir="/" name="src/core/lib/gpr/wrap_memcpy.cc" role="src" />
|
||||
<file baseinstalldir="/" name="src/core/lib/gprpp/atomic_utils.h" role="src" />
|
||||
<file baseinstalldir="/" name="src/core/lib/gprpp/bitset.h" role="src" />
|
||||
<file baseinstalldir="/" name="src/core/lib/gprpp/chunked_vector.h" role="src" />
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
@ -541,7 +541,6 @@ CORE_SOURCE_FILES = [
|
|||
'src/core/lib/gpr/windows/sync.cc',
|
||||
'src/core/lib/gpr/windows/time.cc',
|
||||
'src/core/lib/gpr/windows/tmpfile.cc',
|
||||
'src/core/lib/gpr/wrap_memcpy.cc',
|
||||
'src/core/lib/gprpp/crash.cc',
|
||||
'src/core/lib/gprpp/examine_stack.cc',
|
||||
'src/core/lib/gprpp/fork.cc',
|
||||
|
|
|
|||
|
|
@ -46,7 +46,6 @@ CC_FILES=[
|
|||
'grpc_root/src/core/lib/gpr/windows/sync.cc',
|
||||
'grpc_root/src/core/lib/gpr/windows/time.cc',
|
||||
'grpc_root/src/core/lib/gpr/windows/tmpfile.cc',
|
||||
'grpc_root/src/core/lib/gpr/wrap_memcpy.cc',
|
||||
'grpc_root/src/core/lib/gprpp/crash.cc',
|
||||
'grpc_root/src/core/lib/gprpp/examine_stack.cc',
|
||||
'grpc_root/src/core/lib/gprpp/fork.cc',
|
||||
|
|
|
|||
|
|
@ -192,7 +192,6 @@ if grpc_config == 'dbg'
|
|||
$CFLAGS << ' -O0'
|
||||
end
|
||||
|
||||
$LDFLAGS << ' -Wl,-wrap,memcpy' if linux
|
||||
# Do not statically link standard libraries on TruffleRuby as this does not work when compiling to bitcode
|
||||
if linux && RUBY_ENGINE != 'truffleruby'
|
||||
$LDFLAGS << ' -static-libgcc -static-libstdc++'
|
||||
|
|
|
|||
|
|
@ -2338,7 +2338,6 @@ src/core/lib/gpr/windows/string_util.cc \
|
|||
src/core/lib/gpr/windows/sync.cc \
|
||||
src/core/lib/gpr/windows/time.cc \
|
||||
src/core/lib/gpr/windows/tmpfile.cc \
|
||||
src/core/lib/gpr/wrap_memcpy.cc \
|
||||
src/core/lib/gprpp/atomic_utils.h \
|
||||
src/core/lib/gprpp/bitset.h \
|
||||
src/core/lib/gprpp/chunked_vector.h \
|
||||
|
|
|
|||
|
|
@ -2111,7 +2111,6 @@ src/core/lib/gpr/windows/string_util.cc \
|
|||
src/core/lib/gpr/windows/sync.cc \
|
||||
src/core/lib/gpr/windows/time.cc \
|
||||
src/core/lib/gpr/windows/tmpfile.cc \
|
||||
src/core/lib/gpr/wrap_memcpy.cc \
|
||||
src/core/lib/gprpp/README.md \
|
||||
src/core/lib/gprpp/atomic_utils.h \
|
||||
src/core/lib/gprpp/bitset.h \
|
||||
|
|
|
|||
Loading…
Reference in New Issue