Skip to content

Commit 52f0be3

Browse files
committed
compat: remove memcpy -> memmove backwards compatibility alias
In glib 2.13 memcpy was changed such that the way it copied bytes was reversed. This caused all sorts of issues for existing software, which depended on the existing behavior (when they should have been using memmove). See: https://sourceware.org/bugzilla/show_bug.cgi?id=12518 https://bugzilla.redhat.com/show_bug.cgi?id=638477 Now that we require glibc 2.17+ (#17538), we should be well clear of having to maintain our memcpy -> memmove aliasing, which was introduced in #4339.
1 parent bca5ee6 commit 52f0be3

File tree

6 files changed

+1
-56
lines changed

6 files changed

+1
-56
lines changed

src/Makefile.am

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,6 @@ libbitcoin_util_a_SOURCES = \
553553
support/lockedpool.cpp \
554554
chainparamsbase.cpp \
555555
clientversion.cpp \
556-
compat/glibc_sanity.cpp \
557556
compat/glibcxx_sanity.cpp \
558557
compat/strnlen.cpp \
559558
fs.cpp \

src/compat/glibc_compat.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,6 @@
99
#include <cstddef>
1010
#include <cstdint>
1111

12-
// Prior to GLIBC_2.14, memcpy was aliased to memmove.
13-
extern "C" void* memmove(void* a, const void* b, size_t c);
14-
extern "C" void* memcpy(void* a, const void* b, size_t c)
15-
{
16-
return memmove(a, b, c);
17-
}
18-
1912
#if defined(__i386__) || defined(__arm__)
2013

2114
extern "C" int64_t __udivmoddi4(uint64_t u, uint64_t v, uint64_t* rp);

src/compat/glibc_sanity.cpp

Lines changed: 0 additions & 45 deletions
This file was deleted.

src/compat/sanity.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
#ifndef BITCOIN_COMPAT_SANITY_H
66
#define BITCOIN_COMPAT_SANITY_H
77

8-
bool glibc_sanity_test();
98
bool glibcxx_sanity_test();
109

1110
#endif // BITCOIN_COMPAT_SANITY_H

src/init.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,7 @@ static bool InitSanityCheck()
771771
return InitError(Untranslated("Elliptic curve cryptography sanity check failure. Aborting."));
772772
}
773773

774-
if (!glibc_sanity_test() || !glibcxx_sanity_test())
774+
if (!glibcxx_sanity_test())
775775
return false;
776776

777777
if (!Random_SanityCheck()) {

src/test/sanity_tests.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ BOOST_FIXTURE_TEST_SUITE(sanity_tests, BasicTestingSetup)
1313

1414
BOOST_AUTO_TEST_CASE(basic_sanity)
1515
{
16-
BOOST_CHECK_MESSAGE(glibc_sanity_test() == true, "libc sanity test");
1716
BOOST_CHECK_MESSAGE(glibcxx_sanity_test() == true, "stdlib sanity test");
1817
BOOST_CHECK_MESSAGE(ECC_InitSanityCheck() == true, "secp256k1 sanity test");
1918
BOOST_CHECK_MESSAGE(ChronoSanityCheck() == true, "chrono epoch test");

0 commit comments

Comments
 (0)