Skip to content

Commit 8c5e4f4

Browse files
committed
Merge bitcoin/bitcoin#29208: build: Bump clang minimum supported version to 14
aaaace2 fuzz: Assume presence of __builtin_*_overflow, without checks (MarcoFalke) fa223ba Revert "build: Fix undefined reference to __mulodi4" (MarcoFalke) fa7c751 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: ACK aaaace2 Tree-SHA512: 81d066b14cc568d27312f1cc814b09540b038a10a0a8e9d71fc9745b024fb6c32a959af673e6819b817ea7cef98da4abfa63dff16cffb7821b40083016b0291f
2 parents 8c0d1c6 + aaaace2 commit 8c5e4f4

8 files changed

+7
-71
lines changed

build-aux/m4/bitcoin_runtime_lib.m4

Lines changed: 0 additions & 42 deletions
This file was deleted.

ci/test/00_setup_env_i686_multiprocess.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ export PACKAGES="llvm clang g++-multilib"
1313
export DEP_OPTS="DEBUG=1 MULTIPROCESS=1"
1414
export GOAL="install"
1515
export BITCOIN_CONFIG="--enable-debug CC='clang -m32' CXX='clang++ -m32' \
16-
LDFLAGS='--rtlib=compiler-rt -lgcc_s' CPPFLAGS='-DBOOST_MULTI_INDEX_ENABLE_SAFE_MODE'"
16+
CPPFLAGS='-DBOOST_MULTI_INDEX_ENABLE_SAFE_MODE'"
1717
export BITCOIND=bitcoin-node # Used in functional tests

ci/test/00_setup_env_native_nowallet_libbitcoinkernel.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
export LC_ALL=C.UTF-8
88

99
export CONTAINER_NAME=ci_native_nowallet_libbitcoinkernel
10-
export CI_IMAGE_NAME_TAG="docker.io/debian:bullseye"
11-
# Use minimum supported python3.9 and clang-13, see doc/dependencies.md
12-
export PACKAGES="python3-zmq clang-13 llvm-13 libc++abi-13-dev libc++-13-dev"
13-
export DEP_OPTS="NO_WALLET=1 CC=clang-13 CXX='clang++-13 -stdlib=libc++'"
10+
export CI_IMAGE_NAME_TAG="docker.io/ubuntu:22.04"
11+
# Use minimum supported python3.9 (or best-effort 3.10) and clang-14, see doc/dependencies.md
12+
export PACKAGES="python3-zmq clang-14 llvm-14 libc++abi-14-dev libc++-14-dev"
13+
export DEP_OPTS="NO_WALLET=1 CC=clang-14 CXX='clang++-14 -stdlib=libc++'"
1414
export GOAL="install"
1515
export BITCOIN_CONFIG="--enable-reduce-exports --enable-experimental-util-chainstate --with-experimental-kernel-lib --enable-shared"

configure.ac

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1338,8 +1338,6 @@ if test "$enable_fuzz_binary" = "yes"; then
13381338
]],[[
13391339
*/ int not_main() {
13401340
]])])
1341-
1342-
CHECK_RUNTIME_LIB
13431341
fi
13441342

13451343
if test "$enable_wallet" != "no"; then

doc/dependencies.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ You can find installation instructions in the `build-*.md` file for your platfor
88
| --- | --- |
99
| [Autoconf](https://www.gnu.org/software/autoconf/) | [2.69](https://github.com/bitcoin/bitcoin/pull/17769) |
1010
| [Automake](https://www.gnu.org/software/automake/) | [1.13](https://github.com/bitcoin/bitcoin/pull/18290) |
11-
| [Clang](https://clang.llvm.org) | [13.0](https://github.com/bitcoin/bitcoin/pull/28210) |
11+
| [Clang](https://clang.llvm.org) | [14.0](https://github.com/bitcoin/bitcoin/pull/29208) |
1212
| [GCC](https://gcc.gnu.org) | [10.1](https://github.com/bitcoin/bitcoin/pull/28348) |
1313
| [Python](https://www.python.org) (scripts, tests) | [3.9](https://github.com/bitcoin/bitcoin/pull/28211) |
1414
| [systemtap](https://sourceware.org/systemtap/) ([tracing](tracing.md))| N/A |

src/Makefile.test.include

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ if ENABLE_FUZZ_BINARY
240240
test_fuzz_fuzz_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(BOOST_CPPFLAGS)
241241
test_fuzz_fuzz_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
242242
test_fuzz_fuzz_LDADD = $(FUZZ_SUITE_LD_COMMON)
243-
test_fuzz_fuzz_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) $(PTHREAD_FLAGS) $(RUNTIME_LDFLAGS)
243+
test_fuzz_fuzz_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) $(PTHREAD_FLAGS)
244244
test_fuzz_fuzz_SOURCES = \
245245
$(FUZZ_WALLET_SRC) \
246246
test/fuzz/addition_overflow.cpp \

src/test/fuzz/addition_overflow.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,6 @@
1111
#include <string>
1212
#include <vector>
1313

14-
#if defined(__has_builtin)
15-
#if __has_builtin(__builtin_add_overflow)
16-
#define HAVE_BUILTIN_ADD_OVERFLOW
17-
#endif
18-
#elif defined(__GNUC__)
19-
#define HAVE_BUILTIN_ADD_OVERFLOW
20-
#endif
21-
2214
namespace {
2315
template <typename T>
2416
void TestAdditionOverflow(FuzzedDataProvider& fuzzed_data_provider)
@@ -32,14 +24,12 @@ void TestAdditionOverflow(FuzzedDataProvider& fuzzed_data_provider)
3224
assert(is_addition_overflow_custom == AdditionOverflow(j, i));
3325
assert(maybe_add == CheckedAdd(j, i));
3426
assert(sat_add == SaturatingAdd(j, i));
35-
#if defined(HAVE_BUILTIN_ADD_OVERFLOW)
3627
T result_builtin;
3728
const bool is_addition_overflow_builtin = __builtin_add_overflow(i, j, &result_builtin);
3829
assert(is_addition_overflow_custom == is_addition_overflow_builtin);
3930
if (!is_addition_overflow_custom) {
4031
assert(i + j == result_builtin);
4132
}
42-
#endif
4333
if (is_addition_overflow_custom) {
4434
assert(sat_add == std::numeric_limits<T>::min() || sat_add == std::numeric_limits<T>::max());
4535
} else {

src/test/fuzz/multiplication_overflow.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
// Distributed under the MIT software license, see the accompanying
33
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
44

5-
#if defined(HAVE_CONFIG_H)
6-
#include <config/bitcoin-config.h>
7-
#endif
8-
95
#include <test/fuzz/FuzzedDataProvider.h>
106
#include <test/fuzz/fuzz.h>
117
#include <test/fuzz/util.h>
@@ -21,18 +17,12 @@ void TestMultiplicationOverflow(FuzzedDataProvider& fuzzed_data_provider)
2117
const T i = fuzzed_data_provider.ConsumeIntegral<T>();
2218
const T j = fuzzed_data_provider.ConsumeIntegral<T>();
2319
const bool is_multiplication_overflow_custom = MultiplicationOverflow(i, j);
24-
#if defined(HAVE_BUILTIN_MUL_OVERFLOW)
2520
T result_builtin;
2621
const bool is_multiplication_overflow_builtin = __builtin_mul_overflow(i, j, &result_builtin);
2722
assert(is_multiplication_overflow_custom == is_multiplication_overflow_builtin);
2823
if (!is_multiplication_overflow_custom) {
2924
assert(i * j == result_builtin);
3025
}
31-
#else
32-
if (!is_multiplication_overflow_custom) {
33-
(void)(i * j);
34-
}
35-
#endif
3626
}
3727
} // namespace
3828

0 commit comments

Comments
 (0)