mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 03:52:49 +01:00
fb3d9a16bf
4446ef0a549d567a88d82b606aa8c47f115673f9 build: remove support for weak linking getauxval() (fanquake) e56100c5b4daf2285dde9807bf654599aa19bd6b build: remove arm includes from getauxval() check (fanquake) Pull request description: It was [pointed out in #23030](https://github.com/bitcoin/bitcoin/pull/23030#issuecomment-922893367) that we might be able to get rid of our weak linking of [`getauxval()`](https://man7.org/linux/man-pages/man3/getauxval.3.html) (`HAVE_WEAK_GETAUXVAL`) entirely, with only Android being a potential holdout: > I wonder if it's time to get rid of HAVE_WEAK_GETAUXVAL. I think it's confusing. Either we build against a C library that has this functionality, or not. We don't do this weak linking thing for any other symbols and recently got rid of the other glibc backwards compatibility stuff. > Unless there is still a current platform that really needs it (Android?), I'd prefer to remove it from the build system, it has caused enough issues. After looking at Android further, it would seem that given we are moving to using `std::filesystem`, which [requires NDK version 22 and later](https://github.com/android/ndk/wiki/Changelog-r22), and `getauxval` has been available in the since [API version 18](https://developer.android.com/ndk/guides/cpu-features#features_using_libcs_getauxval3), that shouldn't really be an issue. Support for API levels < 19 will be dropped with the NDK 24 release, and according to [one website](https://apilevels.com/), supporting API level 18+ will cover ~99% of devices. Note that in the CI we currently build with NDK version 22 and API level 28. The other change in this PR is removing the include of headers for ARM intrinsics, from the check for strong `getauxval()` support in configure, as they shouldn't be needed. Including these headers also meant that the check would basically only succeed when building for ARM. This would be an issue if we remove weak linking, as we wouldn't detect `getauxval()` as supported on other platforms. Note that we also use `getauxval()` in our RNG when it's available. I've checked that with these changes we detect support for strong `getauxval()` on Alpine (muslibc). On Linux, previously we'd be detecting support for weak getauxval(), now we detect strong support. Note that we already require glibc 2.17, and `getauxval()` was introduced in `2.16`. This is an alternative / supersedes #23030. ACKs for top commit: laanwj: Code review and tested ACK 4446ef0a549d567a88d82b606aa8c47f115673f9 Tree-SHA512: 5f2a9e9cc2d63bddab73f0dcb169d4d6beda74622af82bc0439722f1189f81d052e2fc1eaf27056a7a606320d5ddc4c11075f0d051dd93d77c5e1c15337f354a
75 lines
2.5 KiB
Makefile
75 lines
2.5 KiB
Makefile
# Copyright (c) 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.
|
|
|
|
LIBCRC32C_INT = crc32c/libcrc32c.a
|
|
LIBLEVELDB_SSE42_INT = leveldb/libleveldb_sse42.a
|
|
|
|
EXTRA_LIBRARIES += $(LIBCRC32C_INT)
|
|
|
|
LIBCRC32C = $(LIBCRC32C_INT)
|
|
|
|
CRC32C_CPPFLAGS_INT =
|
|
CRC32C_CPPFLAGS_INT += -I$(srcdir)/crc32c/include
|
|
CRC32C_CPPFLAGS_INT += -DHAVE_BUILTIN_PREFETCH=@HAVE_BUILTIN_PREFETCH@
|
|
CRC32C_CPPFLAGS_INT += -DHAVE_MM_PREFETCH=@HAVE_MM_PREFETCH@
|
|
CRC32C_CPPFLAGS_INT += -DHAVE_STRONG_GETAUXVAL=@HAVE_STRONG_GETAUXVAL@
|
|
CRC32C_CPPFLAGS_INT += -DCRC32C_TESTS_BUILT_WITH_GLOG=0
|
|
|
|
if ENABLE_SSE42
|
|
CRC32C_CPPFLAGS_INT += -DHAVE_SSE42=1
|
|
else
|
|
CRC32C_CPPFLAGS_INT += -DHAVE_SSE42=0
|
|
endif
|
|
|
|
if ENABLE_ARM_CRC
|
|
CRC32C_CPPFLAGS_INT += -DHAVE_ARM64_CRC32C=1
|
|
else
|
|
CRC32C_CPPFLAGS_INT += -DHAVE_ARM64_CRC32C=0
|
|
endif
|
|
|
|
if WORDS_BIGENDIAN
|
|
CRC32C_CPPFLAGS_INT += -DBYTE_ORDER_BIG_ENDIAN=1
|
|
else
|
|
CRC32C_CPPFLAGS_INT += -DBYTE_ORDER_BIG_ENDIAN=0
|
|
endif
|
|
|
|
crc32c_libcrc32c_a_CPPFLAGS = $(AM_CPPFLAGS) $(CRC32C_CPPFLAGS_INT) $(CRC32C_CPPFLAGS)
|
|
crc32c_libcrc32c_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
|
|
|
|
crc32c_libcrc32c_a_SOURCES =
|
|
crc32c_libcrc32c_a_SOURCES += crc32c/include/crc32c/crc32c.h
|
|
crc32c_libcrc32c_a_SOURCES += crc32c/src/crc32c_arm64.h
|
|
crc32c_libcrc32c_a_SOURCES += crc32c/src/crc32c_arm64_check.h
|
|
crc32c_libcrc32c_a_SOURCES += crc32c/src/crc32c_internal.h
|
|
crc32c_libcrc32c_a_SOURCES += crc32c/src/crc32c_prefetch.h
|
|
crc32c_libcrc32c_a_SOURCES += crc32c/src/crc32c_read_le.h
|
|
crc32c_libcrc32c_a_SOURCES += crc32c/src/crc32c_round_up.h
|
|
crc32c_libcrc32c_a_SOURCES += crc32c/src/crc32c_sse42_check.h
|
|
crc32c_libcrc32c_a_SOURCES += crc32c/src/crc32c_sse42.h
|
|
|
|
crc32c_libcrc32c_a_SOURCES += crc32c/src/crc32c.cc
|
|
crc32c_libcrc32c_a_SOURCES += crc32c/src/crc32c_portable.cc
|
|
|
|
if ENABLE_SSE42
|
|
LIBCRC32C_SSE42_INT = crc32c/libcrc32c_sse42.a
|
|
EXTRA_LIBRARIES += $(LIBCRC32C_SSE42_INT)
|
|
LIBCRC32C += $(LIBCRC32C_SSE42_INT)
|
|
|
|
crc32c_libcrc32c_sse42_a_CPPFLAGS = $(crc32c_libcrc32c_a_CPPFLAGS)
|
|
crc32c_libcrc32c_sse42_a_CXXFLAGS = $(crc32c_libcrc32c_a_CXXFLAGS) $(SSE42_CXXFLAGS)
|
|
|
|
crc32c_libcrc32c_sse42_a_SOURCES = crc32c/src/crc32c_sse42.cc
|
|
endif
|
|
|
|
if ENABLE_ARM_CRC
|
|
LIBCRC32C_ARM_CRC_INT = crc32c/libcrc32c_arm_crc.a
|
|
EXTRA_LIBRARIES += $(LIBCRC32C_ARM_CRC_INT)
|
|
LIBCRC32C += $(LIBCRC32C_ARM_CRC_INT)
|
|
|
|
crc32c_libcrc32c_arm_crc_a_CPPFLAGS = $(crc32c_libcrc32c_a_CPPFLAGS)
|
|
crc32c_libcrc32c_arm_crc_a_CXXFLAGS = $(crc32c_libcrc32c_a_CXXFLAGS) $(ARM_CRC_CXXFLAGS)
|
|
|
|
crc32c_libcrc32c_arm_crc_a_SOURCES = crc32c/src/crc32c_arm64.cc
|
|
endif
|