Skip to content

Commit 8bf1540

Browse files
committed
build: remove fdelt_chk backwards compatibility code
Now that we require glibc 2.17 or later, we no longer need to check for different return types in fdelt_chk. It was changed from unsigned long int to long int in glibc 2.16 . See this commit: https://sourceware.org/git/?p=glibc.git;a=commit;h=ceb9e56b3d1f8c1922e0526c2e841373843460e2 and related issue: https://sourceware.org/bugzilla/show_bug.cgi?id=14210.
1 parent 3b1e289 commit 8bf1540

File tree

3 files changed

+2
-32
lines changed

3 files changed

+2
-32
lines changed

build_msvc/bitcoin_config.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,6 @@
4141
/* Define to 1 to enable ZMQ functions */
4242
#define ENABLE_ZMQ 1
4343

44-
/* parameter and return value type for __fdelt_chk */
45-
/* #undef FDELT_TYPE */
46-
4744
/* define if the Boost library is available */
4845
#define HAVE_BOOST /**/
4946

configure.ac

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -717,22 +717,8 @@ AX_GCC_FUNC_ATTRIBUTE([dllexport])
717717
AX_GCC_FUNC_ATTRIBUTE([dllimport])
718718

719719
if test x$use_glibc_compat != xno; then
720-
721-
dnl __fdelt_chk's params and return type have changed from long unsigned int to long int.
722-
dnl See which one is present here.
723-
AC_MSG_CHECKING(__fdelt_chk type)
724-
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifdef _FORTIFY_SOURCE
725-
#undef _FORTIFY_SOURCE
726-
#endif
727-
#define _FORTIFY_SOURCE 2
728-
#include <sys/select.h>
729-
extern "C" long unsigned int __fdelt_warn(long unsigned int);]],[[]])],
730-
[ fdelt_type="long unsigned int"],
731-
[ fdelt_type="long int"])
732-
AC_MSG_RESULT($fdelt_type)
733-
AC_DEFINE_UNQUOTED(FDELT_TYPE, $fdelt_type,[parameter and return value type for __fdelt_chk])
734-
AX_CHECK_LINK_FLAG([[-Wl,--wrap=__divmoddi4]], [COMPAT_LDFLAGS="$COMPAT_LDFLAGS -Wl,--wrap=__divmoddi4"],, [[$LDFLAG_WERROR]])
735-
AX_CHECK_LINK_FLAG([[-Wl,--wrap=log2f]], [COMPAT_LDFLAGS="$COMPAT_LDFLAGS -Wl,--wrap=log2f"],, [[$LDFLAG_WERROR]])
720+
AX_CHECK_LINK_FLAG([[-Wl,--wrap=__divmoddi4]], [COMPAT_LDFLAGS="$COMPAT_LDFLAGS -Wl,--wrap=__divmoddi4"])
721+
AX_CHECK_LINK_FLAG([[-Wl,--wrap=log2f]], [COMPAT_LDFLAGS="$COMPAT_LDFLAGS -Wl,--wrap=log2f"])
736722
else
737723
AC_SEARCH_LIBS([clock_gettime],[rt])
738724
fi

src/compat/glibc_compat.cpp

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

12-
#if defined(HAVE_SYS_SELECT_H)
13-
#include <sys/select.h>
14-
#endif
15-
1612
// Prior to GLIBC_2.14, memcpy was aliased to memmove.
1713
extern "C" void* memmove(void* a, const void* b, size_t c);
1814
extern "C" void* memcpy(void* a, const void* b, size_t c)
1915
{
2016
return memmove(a, b, c);
2117
}
2218

23-
extern "C" void __chk_fail(void) __attribute__((__noreturn__));
24-
extern "C" FDELT_TYPE __fdelt_warn(FDELT_TYPE a)
25-
{
26-
if (a >= FD_SETSIZE)
27-
__chk_fail();
28-
return a / __NFDBITS;
29-
}
30-
extern "C" FDELT_TYPE __fdelt_chk(FDELT_TYPE) __attribute__((weak, alias("__fdelt_warn")));
31-
3219
#if defined(__i386__) || defined(__arm__)
3320

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

0 commit comments

Comments
 (0)