mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-16 13:01:19 +02:00
Merge 5d18c0ae18 into merged_master (Bitcoin PR #18862)
This commit is contained in:
commit
a9e2796675
6 changed files with 2 additions and 100 deletions
|
|
@ -41,9 +41,6 @@
|
|||
/* Define to 1 to enable ZMQ functions */
|
||||
#define ENABLE_ZMQ 1
|
||||
|
||||
/* parameter and return value type for __fdelt_chk */
|
||||
/* #undef FDELT_TYPE */
|
||||
|
||||
/* define if the Boost library is available */
|
||||
#define HAVE_BOOST /**/
|
||||
|
||||
|
|
|
|||
51
configure.ac
51
configure.ac
|
|
@ -748,22 +748,8 @@ AX_GCC_FUNC_ATTRIBUTE([dllexport])
|
|||
AX_GCC_FUNC_ATTRIBUTE([dllimport])
|
||||
|
||||
if test x$use_glibc_compat != xno; then
|
||||
|
||||
dnl __fdelt_chk's params and return type have changed from long unsigned int to long int.
|
||||
dnl See which one is present here.
|
||||
AC_MSG_CHECKING(__fdelt_chk type)
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifdef _FORTIFY_SOURCE
|
||||
#undef _FORTIFY_SOURCE
|
||||
#endif
|
||||
#define _FORTIFY_SOURCE 2
|
||||
#include <sys/select.h>
|
||||
extern "C" long unsigned int __fdelt_warn(long unsigned int);]],[[]])],
|
||||
[ fdelt_type="long unsigned int"],
|
||||
[ fdelt_type="long int"])
|
||||
AC_MSG_RESULT($fdelt_type)
|
||||
AC_DEFINE_UNQUOTED(FDELT_TYPE, $fdelt_type,[parameter and return value type for __fdelt_chk])
|
||||
AX_CHECK_LINK_FLAG([[-Wl,--wrap=__divmoddi4]], [COMPAT_LDFLAGS="$COMPAT_LDFLAGS -Wl,--wrap=__divmoddi4"],, [[$LDFLAG_WERROR]])
|
||||
AX_CHECK_LINK_FLAG([[-Wl,--wrap=log2f]], [COMPAT_LDFLAGS="$COMPAT_LDFLAGS -Wl,--wrap=log2f"],, [[$LDFLAG_WERROR]])
|
||||
AX_CHECK_LINK_FLAG([[-Wl,--wrap=__divmoddi4]], [COMPAT_LDFLAGS="$COMPAT_LDFLAGS -Wl,--wrap=__divmoddi4"])
|
||||
AX_CHECK_LINK_FLAG([[-Wl,--wrap=log2f]], [COMPAT_LDFLAGS="$COMPAT_LDFLAGS -Wl,--wrap=log2f"])
|
||||
else
|
||||
AC_SEARCH_LIBS([clock_gettime],[rt])
|
||||
fi
|
||||
|
|
@ -842,39 +828,6 @@ fi
|
|||
|
||||
AC_CHECK_HEADERS([endian.h sys/endian.h byteswap.h stdio.h stdlib.h unistd.h strings.h sys/types.h sys/stat.h sys/select.h sys/prctl.h sys/sysctl.h vm/vm_param.h sys/vmmeter.h sys/resources.h])
|
||||
|
||||
dnl FD_ZERO may be dependent on a declaration of memcpy, e.g. in SmartOS
|
||||
dnl check that it fails to build without memcpy, then that it builds with
|
||||
AC_MSG_CHECKING(FD_ZERO memcpy dependence)
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
||||
#include <cstddef>
|
||||
#if HAVE_SYS_SELECT_H
|
||||
#include <sys/select.h>
|
||||
#endif
|
||||
]],[[
|
||||
#if HAVE_SYS_SELECT_H
|
||||
fd_set fds;
|
||||
FD_ZERO(&fds);
|
||||
#endif
|
||||
]])],
|
||||
[ AC_MSG_RESULT(no) ],
|
||||
[
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
||||
#include <cstring>
|
||||
#if HAVE_SYS_SELECT_H
|
||||
#include <sys/select.h>
|
||||
#endif
|
||||
]], [[
|
||||
#if HAVE_SYS_SELECT_H
|
||||
fd_set fds;
|
||||
FD_ZERO(&fds);
|
||||
#endif
|
||||
]])],
|
||||
[ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_CSTRING_DEPENDENT_FD_ZERO, 1, [Define this symbol if FD_ZERO is dependent of a memcpy declaration being available]) ],
|
||||
[ AC_MSG_ERROR(failed with cstring include) ]
|
||||
)
|
||||
]
|
||||
)
|
||||
|
||||
AC_CHECK_DECLS([getifaddrs, freeifaddrs],,,
|
||||
[#include <sys/types.h>
|
||||
#include <ifaddrs.h>]
|
||||
|
|
|
|||
|
|
@ -539,7 +539,6 @@ libbitcoin_util_a_SOURCES = \
|
|||
support/lockedpool.cpp \
|
||||
chainparamsbase.cpp \
|
||||
clientversion.cpp \
|
||||
compat/glibc_sanity_fdelt.cpp \
|
||||
compat/glibc_sanity.cpp \
|
||||
compat/glibcxx_sanity.cpp \
|
||||
compat/strnlen.cpp \
|
||||
|
|
|
|||
|
|
@ -9,10 +9,6 @@
|
|||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
|
||||
#if defined(HAVE_SYS_SELECT_H)
|
||||
#include <sys/select.h>
|
||||
#endif
|
||||
|
||||
// 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)
|
||||
|
|
@ -20,15 +16,6 @@ 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")));
|
||||
|
||||
#if defined(__i386__) || defined(__arm__)
|
||||
|
||||
extern "C" int64_t __udivmoddi4(uint64_t u, uint64_t v, uint64_t* rp);
|
||||
|
|
|
|||
|
|
@ -8,10 +8,6 @@
|
|||
|
||||
#include <cstddef>
|
||||
|
||||
#if defined(HAVE_SYS_SELECT_H)
|
||||
bool sanity_test_fdelt();
|
||||
#endif
|
||||
|
||||
extern "C" void* memcpy(void* a, const void* b, size_t c);
|
||||
void* memcpy_int(void* a, const void* b, size_t c)
|
||||
{
|
||||
|
|
@ -45,9 +41,5 @@ bool sanity_test_memcpy()
|
|||
|
||||
bool glibc_sanity_test()
|
||||
{
|
||||
#if defined(HAVE_SYS_SELECT_H)
|
||||
if (!sanity_test_fdelt())
|
||||
return false;
|
||||
#endif
|
||||
return sanity_test_memcpy<1025>();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,26 +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 <config/bitcoin-config.h>
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_SYS_SELECT_H)
|
||||
#ifdef HAVE_CSTRING_DEPENDENT_FD_ZERO
|
||||
#include <cstring>
|
||||
#endif
|
||||
#include <sys/select.h>
|
||||
|
||||
// trigger: Call FD_SET to trigger __fdelt_chk. FORTIFY_SOURCE must be defined
|
||||
// as >0 and optimizations must be set to at least -O2.
|
||||
// test: Add a file descriptor to an empty fd_set. Verify that it has been
|
||||
// correctly added.
|
||||
bool sanity_test_fdelt()
|
||||
{
|
||||
fd_set fds;
|
||||
FD_ZERO(&fds);
|
||||
FD_SET(0, &fds);
|
||||
return FD_ISSET(0, &fds);
|
||||
}
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue