mirror of https://github.com/bitcoin/bitcoin
Merge bitcoin/bitcoin#29208: build: Bump clang minimum supported version to 14
pull/29239/headaaaace2fd1
fuzz: Assume presence of __builtin_*_overflow, without checks (MarcoFalke)fa223ba5eb
Revert "build: Fix undefined reference to __mulodi4" (MarcoFalke)fa7c751bd9
build: Bump clang minimum supported version to 14 (MarcoFalke) Pull request description: Most supported operating systems ship with clang-14 (or later), so bump the minimum to that and allow new code to drop workarounds for previous clang bugs. For reference: * https://packages.debian.org/bookworm/clang (`clang-14`) * https://packages.ubuntu.com/jammy/clang (`clang-14`) * CentOS-like 8/9 Stream: All Clang versions from 15 to 17 * FreeBSD 12/13: All Clang versions from 15 to 16 * OpenSuse Tumbleweed ships with https://software.opensuse.org/package/clang (`clang17`); No idea about OpenSuse Leap On operating systems where the clang version is not shipped by default, the user would have to use GCC, or install clang in a different way. For example: * https://packages.debian.org/bullseye/g++ (g++-10) * https://packages.ubuntu.com/focal/g++-10 * https://apt.llvm.org/, or nix, or guix, or compile clang from source, ... ACKs for top commit: fanquake: ACKaaaace2fd1
Tree-SHA512: 81d066b14cc568d27312f1cc814b09540b038a10a0a8e9d71fc9745b024fb6c32a959af673e6819b817ea7cef98da4abfa63dff16cffb7821b40083016b0291f
commit
8c5e4f42d5
@ -1,42 +0,0 @@
|
||||
# On some platforms clang builtin implementations
|
||||
# require compiler-rt as a runtime library to use.
|
||||
#
|
||||
# See:
|
||||
# - https://bugs.llvm.org/show_bug.cgi?id=28629
|
||||
|
||||
m4_define([_CHECK_RUNTIME_testbody], [[
|
||||
bool f(long long x, long long y, long long* p)
|
||||
{
|
||||
return __builtin_mul_overflow(x, y, p);
|
||||
}
|
||||
int main() { return 0; }
|
||||
]])
|
||||
|
||||
AC_DEFUN([CHECK_RUNTIME_LIB], [
|
||||
|
||||
AC_LANG_PUSH([C++])
|
||||
|
||||
AC_MSG_CHECKING([for __builtin_mul_overflow])
|
||||
AC_LINK_IFELSE(
|
||||
[AC_LANG_SOURCE([_CHECK_RUNTIME_testbody])],
|
||||
[
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_DEFINE([HAVE_BUILTIN_MUL_OVERFLOW], [1], [Define if you have a working __builtin_mul_overflow])
|
||||
],
|
||||
[
|
||||
ax_check_save_flags="$LDFLAGS"
|
||||
LDFLAGS="$LDFLAGS --rtlib=compiler-rt -lgcc_s"
|
||||
AC_LINK_IFELSE(
|
||||
[AC_LANG_SOURCE([_CHECK_RUNTIME_testbody])],
|
||||
[
|
||||
AC_MSG_RESULT([yes, with additional linker flags])
|
||||
RUNTIME_LDFLAGS="--rtlib=compiler-rt -lgcc_s"
|
||||
AC_DEFINE([HAVE_BUILTIN_MUL_OVERFLOW], [1], [Define if you have a working __builtin_mul_overflow])
|
||||
],
|
||||
[AC_MSG_RESULT([no])])
|
||||
LDFLAGS="$ax_check_save_flags"
|
||||
])
|
||||
|
||||
AC_LANG_POP
|
||||
AC_SUBST([RUNTIME_LDFLAGS])
|
||||
])
|
Loading…
Reference in new issue