dogecoin/src/compat/glibc_compat.cpp
Cory Fields 975cb511ee build: add glibc/libstdc++ back-compat stubs
glibc/libstdc++ have added new symbols in later releases. When running a new
binary against an older glibc, the run-time linker is unable to resolve the
new symbols and the binary refuses to run.

This can be fixed by adding our own versions of those functions, so that the
build-time linker does not emit undefined symbols for them.

This enables our binary releases to work on older Linux distros, while not
incurring the downsides of a fully static binary.
2014-05-26 20:55:05 +02:00

20 lines
553 B
C++

#include "bitcoin-config.h"
#include <cstddef>
#include <sys/select.h>
// 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);
}
extern "C" void __chk_fail (void) __attribute__((__noreturn__));
extern "C" FDELT_TYPE __fdelt_warn(FDELT_TYPE a)
{
if (a >= FD_SETSIZE)
__chk_fail ();
return a / __NFDBITS;
}
extern "C" FDELT_TYPE __fdelt_chk(FDELT_TYPE) __attribute__((weak, alias("__fdelt_warn")));