Files
bitcoin/ci/test/00_setup_env_native_fuzz_with_valgrind.sh
MarcoFalke fa70b9ebaa ci: Temporarily use clang in valgrind tasks
valgrind currently does not work on GCC -O2 compiled executables, which
contain std::optional use, due to an upstream bug. See
https://bugs.kde.org/show_bug.cgi?id=472329

One workaround could be to use -O1. However, that seems brittle, as
variantions of the bug were seen with -O1 as well.

So temporarily use clang in the valgrind CI tasks, because this also
allows to drop a false-positive suppression for:
-DCMAKE_CXX_FLAGS='-Wno-error=array-bounds'

Also, update the comment in contrib/valgrind.supp to mention the
background:

* GCC -O2 wasn't tested with the suppressions file, due to the mentioned
  bug.
* Clang-17 (or later) on aarch64 wasn't tested due to bug
  https://github.com/bitcoin/bitcoin/issues/29635 and the minimum
  supported clang version is clang-17 right now.
* GUI isn't tested, because it requires a debug build, see the prior
  commit.

This means the only tested config right now is the one mentioned in the
suppression file.
2026-03-18 10:27:44 +01:00

23 lines
737 B
Bash
Executable File

#!/usr/bin/env bash
#
# Copyright (c) 2019-present The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
export LC_ALL=C.UTF-8
export CI_IMAGE_NAME_TAG="mirror.gcr.io/debian:trixie"
export CONTAINER_NAME=ci_native_fuzz_valgrind
export PACKAGES="clang llvm libclang-rt-dev libevent-dev libboost-dev libsqlite3-dev valgrind libcapnp-dev capnproto"
export NO_DEPENDS=1
export RUN_UNIT_TESTS=false
export RUN_FUNCTIONAL_TESTS=false
export RUN_FUZZ_TESTS=true
export FUZZ_TESTS_CONFIG="--valgrind"
export GOAL="all"
export BITCOIN_CONFIG="\
-DBUILD_FOR_FUZZING=ON \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
"