diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -304,7 +304,6 @@ add_library(util chainparamsbase.cpp clientversion.cpp - compat/glibc_sanity.cpp compat/glibcxx_sanity.cpp compat/strnlen.cpp fs.cpp diff --git a/src/Makefile.am b/src/Makefile.am --- a/src/Makefile.am +++ b/src/Makefile.am @@ -532,7 +532,6 @@ support/lockedpool.cpp \ chainparamsbase.cpp \ clientversion.cpp \ - compat/glibc_sanity.cpp \ compat/glibcxx_sanity.cpp \ compat/strnlen.cpp \ fs.cpp \ diff --git a/src/compat/glibc_compat.cpp b/src/compat/glibc_compat.cpp --- a/src/compat/glibc_compat.cpp +++ b/src/compat/glibc_compat.cpp @@ -7,15 +7,8 @@ #endif #include -#include #include -// Prior to GLIBC_2.14, memcpy was aliased to memmove. -extern "C" void *memmove(void *a, const void *b, size_t c); -extern "C" void *memcpy(void *a, const void *b, size_t c) { - return memmove(a, b, c); -} - #if defined(__i386__) || defined(__arm__) extern "C" int64_t __udivmoddi4(uint64_t u, uint64_t v, uint64_t *rp); diff --git a/src/compat/glibc_sanity.cpp b/src/compat/glibc_sanity.cpp deleted file mode 100644 --- a/src/compat/glibc_sanity.cpp +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) 2009-2019 The Bitcoin Core developers -// Distributed under the MIT software license, see the accompanying -// file COPYING or http://www.opensource.org/licenses/mit-license.php. - -#if defined(HAVE_CONFIG_H) -#include -#endif - -#include - -extern "C" void *memcpy(void *a, const void *b, size_t c); -void *memcpy_int(void *a, const void *b, size_t c) { - return memcpy(a, b, c); -} - -namespace { -// trigger: Use the memcpy_int wrapper which calls our internal memcpy. -// A direct call to memcpy may be optimized away by the compiler. -// test: Fill an array with a sequence of integers. memcpy to a new empty array. -// Verify that the arrays are equal. Use an odd size to decrease the odds of -// the call being optimized away. -template bool sanity_test_memcpy() { - unsigned int memcpy_test[T]; - unsigned int memcpy_verify[T] = {}; - for (unsigned int i = 0; i != T; ++i) { - memcpy_test[i] = i; - } - - memcpy_int(memcpy_verify, memcpy_test, sizeof(memcpy_test)); - - for (unsigned int i = 0; i != T; ++i) { - if (memcpy_verify[i] != i) { - return false; - } - } - return true; -} -} // namespace - -bool glibc_sanity_test() { - return sanity_test_memcpy<1025>(); -} diff --git a/src/init.cpp b/src/init.cpp --- a/src/init.cpp +++ b/src/init.cpp @@ -1364,7 +1364,7 @@ return false; } - if (!glibc_sanity_test() || !glibcxx_sanity_test()) { + if (!glibcxx_sanity_test()) { return false; } diff --git a/src/test/sanity_tests.cpp b/src/test/sanity_tests.cpp --- a/src/test/sanity_tests.cpp +++ b/src/test/sanity_tests.cpp @@ -13,7 +13,6 @@ BOOST_FIXTURE_TEST_SUITE(sanity_tests, BasicTestingSetup) BOOST_AUTO_TEST_CASE(basic_sanity) { - BOOST_CHECK_MESSAGE(glibc_sanity_test() == true, "libc sanity test"); BOOST_CHECK_MESSAGE(glibcxx_sanity_test() == true, "stdlib sanity test"); BOOST_CHECK_MESSAGE(ECC_InitSanityCheck() == true, "openssl ECC test"); }