Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ci/test/00_setup_env_native_fuzz.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ export RUN_UNIT_TESTS=false
export RUN_FUNCTIONAL_TESTS=false
export RUN_FUZZ_TESTS=true
export GOAL="install"
export BITCOIN_CONFIG="--enable-zmq --disable-ccache --enable-fuzz --with-sanitizers=fuzzer,address,undefined,integer CC='clang-18 -ftrivial-auto-var-init=pattern' CXX='clang++-18 -ftrivial-auto-var-init=pattern' --with-boost-process"
export BITCOIN_CONFIG="--enable-zmq --disable-ccache --enable-fuzz --with-sanitizers=fuzzer,address,undefined,integer CC='clang-19 -ftrivial-auto-var-init=pattern' CXX='clang++-19 -ftrivial-auto-var-init=pattern' --with-boost-process"
2 changes: 1 addition & 1 deletion ci/test/00_setup_env_native_fuzz_with_valgrind.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ export RUN_FUZZ_TESTS=true
export FUZZ_TESTS_CONFIG="--valgrind"
export GOAL="install"
# Temporarily pin dwarf 4, until valgrind can understand clang's dwarf 5
export BITCOIN_CONFIG="--enable-fuzz --with-sanitizers=fuzzer CC=clang-18 CXX=clang++-18 CFLAGS='-gdwarf-4' CXXFLAGS='-gdwarf-4'"
export BITCOIN_CONFIG="--enable-fuzz --with-sanitizers=fuzzer CC=clang-19 CXX=clang++-19 CFLAGS='-gdwarf-4' CXXFLAGS='-gdwarf-4'"
export CCACHE_MAXSIZE=200M
4 changes: 2 additions & 2 deletions ci/test/00_setup_env_native_multiprocess.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ export LC_ALL=C.UTF-8
export CONTAINER_NAME=ci_native_multiprocess
export HOST=x86_64-pc-linux-gnu
export PACKAGES="cmake python3 llvm clang"
export DEP_OPTS="MULTIPROCESS=1 CC=clang-18 CXX=clang++-18"
export DEP_OPTS="MULTIPROCESS=1 CC=clang-19 CXX=clang++-19"
export RUN_TIDY=true
export GOAL="install"
export TEST_RUNNER_EXTRA="--v2transport"
export BITCOIN_CONFIG="--with-boost-process --enable-debug CC=clang-18 CXX=clang++-18" # Use clang to avoid OOM
export BITCOIN_CONFIG="--with-boost-process --enable-debug CC=clang-19 CXX=clang++-19" # Use clang to avoid OOM
# Additional flags for RUN_TIDY
export BITCOIN_CONFIG="${BITCOIN_CONFIG} --disable-hardening CFLAGS='-O0 -g0' CXXFLAGS='-O0 -g0 -Wno-error=documentation'"
export BITCOIND=dash-node # Used in functional tests
6 changes: 3 additions & 3 deletions ci/test/00_setup_env_native_tsan.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
export LC_ALL=C.UTF-8

export CONTAINER_NAME=ci_native_tsan
export PACKAGES="clang-18 llvm-18 libclang-rt-18-dev libc++abi-18-dev libc++-18-dev python3-zmq"
export DEP_OPTS="CC=clang-18 CXX='clang++-18 -stdlib=libc++'"
export PACKAGES="clang-19 llvm-19 libclang-rt-19-dev libc++abi-19-dev libc++-19-dev python3-zmq"
export DEP_OPTS="CC=clang-19 CXX='clang++-19 -stdlib=libc++'"
export TEST_RUNNER_EXTRA="--extended --exclude feature_pruning,feature_dbcrash,wallet_multiwallet.py" # Temporarily suppress ASan heap-use-after-free (see issue #14163)
export TEST_RUNNER_EXTRA="${TEST_RUNNER_EXTRA} --timeout-factor=4" # Increase timeout because sanitizers slow down
export GOAL="install"
export BITCOIN_CONFIG="--enable-zmq --with-sanitizers=thread CC=clang-18 CXX=clang++-18 CXXFLAGS='-g' --with-boost-process"
export BITCOIN_CONFIG="--enable-zmq --with-sanitizers=thread CC=clang-19 CXX=clang++-19 CXXFLAGS='-g' --with-boost-process"
export CPPFLAGS="-DARENA_DEBUG -DDEBUG_LOCKORDER -DDEBUG_LOCKCONTENTION"
export PYZMQ=true
4 changes: 2 additions & 2 deletions ci/test/00_setup_env_native_ubsan.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
export LC_ALL=C.UTF-8

export CONTAINER_NAME=ci_native_ubsan
export PACKAGES="clang-18 llvm-18 python3-zmq qtbase5-dev qttools5-dev-tools libevent-dev bsdmainutils libboost-dev libdb5.3++-dev libminiupnpc-dev libzmq3-dev libqrencode-dev"
export PACKAGES="clang-19 llvm-19 python3-zmq qtbase5-dev qttools5-dev-tools libevent-dev bsdmainutils libboost-dev libdb5.3++-dev libminiupnpc-dev libzmq3-dev libqrencode-dev"
export DEP_OPTS="NO_UPNP=1 DEBUG=1"
export GOAL="install"
export BITCOIN_CONFIG="--enable-zmq --enable-reduce-exports --enable-crash-hooks --with-sanitizers=undefined CC=clang-18 CXX=clang++-18"
export BITCOIN_CONFIG="--enable-zmq --enable-reduce-exports --enable-crash-hooks --with-sanitizers=undefined CC=clang-19 CXX=clang++-19"
export PYZMQ=true
2 changes: 1 addition & 1 deletion ci/test/00_setup_env_native_valgrind.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ export NO_DEPENDS=1
export TEST_RUNNER_EXTRA="--exclude rpc_bind,feature_bind_extra --timeout-factor=4" # Excluded for now, see https://github.com/bitcoin/bitcoin/issues/17765#issuecomment-602068547
export GOAL="install"
# Temporarily pin dwarf 4, until valgrind can understand clang's dwarf 5
export BITCOIN_CONFIG="--enable-zmq --with-incompatible-bdb --with-gui=no CC=clang-18 CXX=clang++-18 CFLAGS='-gdwarf-4' CXXFLAGS='-gdwarf-4'" # TODO enable GUI
export BITCOIN_CONFIG="--enable-zmq --with-incompatible-bdb --with-gui=no CC=clang-19 CXX=clang++-19 CFLAGS='-gdwarf-4' CXXFLAGS='-gdwarf-4'" # TODO enable GUI
2 changes: 1 addition & 1 deletion contrib/containers/ci/ci-slim.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ RUN set -ex; \
ENV PATH="/opt/shellcheck:${PATH}"

# Packages needed to be able to run sanitizer builds
ARG LLVM_VERSION=18
ARG LLVM_VERSION=19
RUN set -ex; \
. /etc/os-release; \
curl -fsSL https://apt.llvm.org/llvm-snapshot.gpg.key > /etc/apt/trusted.gpg.d/apt.llvm.org.asc; \
Expand Down
2 changes: 1 addition & 1 deletion contrib/devtools/symbol-check.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ def check_MACHO_sdk(binary) -> bool:
return False

def check_MACHO_lld(binary) -> bool:
if binary.build_version.tools[0].version == [18, 1, 8]:
if binary.build_version.tools[0].version == [19, 1, 4]:
return True
return False
Comment on lines 255 to 258
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Verify LLD version 19.1.4 matches Clang 19 distribution.

The expected LLD version has been updated to [19, 1, 4] to align with the Clang 19 upgrade. Please verify this is the correct LLD version that ships with Clang 19 for macOS builds.


🌐 Web query:

What version of LLD ships with LLVM/Clang 19?

💡 Result:

LLVM/Clang 19 ships with LLD 19 (initially LLD 19.1.0 in the LLVM 19.1.0 release). [1][2]

Sources:
[1] LLD 19.1.0 documentation.
[2] LLVM 19.1.0 release announcement (includes lld).


Update version check to match actual LLD 19.1.0 shipped with Clang 19.

LLVM/Clang 19 ships with LLD 19.1.0, not 19.1.4. The version check at line 256 should be updated from [19, 1, 4] to [19, 1, 0] to correctly match the shipped LLD version.

🤖 Prompt for AI Agents
In contrib/devtools/symbol-check.py around lines 255 to 258, the LLD version
check incorrectly expects [19, 1, 4]; update the comparison to expect [19, 1, 0]
so the function returns True for the actual LLD 19.1.0 that ships with Clang 19;
ensure you modify the literal array in the equality check accordingly and keep
the rest of the function logic unchanged.


Expand Down
2 changes: 1 addition & 1 deletion contrib/guix/libexec/prelude.bash
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ fi
time-machine() {
# shellcheck disable=SC2086
guix time-machine --url=https://codeberg.org/guix/guix.git \
--commit=7bf1d7aeaffba15c4f680f93ae88fbef25427252 \
--commit=5cb84f2013c5b1e48a7d0e617032266f1e6059e2 \
--cores="$JOBS" \
--keep-failed \
--fallback \
Expand Down
29 changes: 11 additions & 18 deletions contrib/guix/manifest.scm
Original file line number Diff line number Diff line change
Expand Up @@ -92,17 +92,7 @@ chain for " target " development."))
(home-page (package-home-page xgcc))
(license (package-license xgcc)))))

(define base-gcc
(package
(inherit gcc-12) ;; 12.3.0
(version "12.4.0")
(source (origin
(method url-fetch)
(uri (string-append "mirror://gnu/gcc/gcc-"
version "/gcc-" version ".tar.xz"))
(sha256
(base32
"0xcida8l2wykvvzvpcrcn649gj0ijn64gwxbplacpg6c0hk6akvh"))))))
(define base-gcc gcc-12) ;; 12.4.0

(define base-linux-kernel-headers linux-libre-headers-6.1)

Expand Down Expand Up @@ -461,9 +451,9 @@ inspecting signatures in Mach-O binaries.")
#t))))))))

(define-public glibc-2.31
(let ((commit "8e30f03744837a85e33d84ccd34ed3abe30d37c3"))
(let ((commit "7b27c450c34563a28e634cccb399cd415e71ebfe"))
(package
(inherit glibc) ;; 2.35
(inherit glibc) ;; 2.39
(version "2.31")
(source (origin
(method git-fetch)
Expand All @@ -473,8 +463,9 @@ inspecting signatures in Mach-O binaries.")
(file-name (git-file-name "glibc" commit))
(sha256
(base32
"1zi0s9yy5zkisw823vivn7zlj8w6g9p3mm7lmlqiixcxdkz4dbn6"))
(patches (search-our-patches "glibc-guix-prefix.patch"))))
"017qdpr5id7ddb4lpkzj2li1abvw916m3fc6n7nw28z4h5qbv2n0"))
(patches (search-our-patches "glibc-guix-prefix.patch"
"glibc-riscv-jumptarget.patch"))))
(arguments
(substitute-keyword-arguments (package-arguments glibc)
((#:configure-flags flags)
Expand All @@ -483,6 +474,8 @@ inspecting signatures in Mach-O binaries.")
(list "--enable-stack-protector=all",
"--enable-bind-now",
"--disable-werror",
"--disable-timezone-tools",
"--disable-profile",
building-on)))
((#:phases phases)
`(modify-phases ,phases
Expand Down Expand Up @@ -545,9 +538,9 @@ inspecting signatures in Mach-O binaries.")
(list gcc-toolchain-12 "static")
(make-bitcoin-cross-toolchain target)))
((string-contains target "darwin")
(list clang-toolchain-18
lld-18
(make-lld-wrapper lld-18 #:lld-as-ld? #t)
(list clang-toolchain-19
lld-19
(make-lld-wrapper lld-19 #:lld-as-ld? #t)
python-signapple
zip))
(else '())))))
57 changes: 57 additions & 0 deletions contrib/guix/patches/glibc-riscv-jumptarget.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
commit 68389203832ab39dd0dbaabbc4059e7fff51c29b
Author: Fangrui Song <[email protected]>
Date: Thu Oct 28 11:39:49 2021 -0700

riscv: Fix incorrect jal with HIDDEN_JUMPTARGET

A non-local STV_DEFAULT defined symbol is by default preemptible in a
shared object. j/jal cannot target a preemptible symbol. On other
architectures, such a jump instruction either causes PLT [BZ #18822], or
if short-ranged, sometimes rejected by the linker (but not by GNU ld's
riscv port [ld PR/28509]).

Use HIDDEN_JUMPTARGET to target a non-preemptible symbol instead.

With this patch, ld.so and libc.so can be linked with LLD if source
files are compiled/assembled with -mno-relax/-Wa,-mno-relax.

Acked-by: Palmer Dabbelt <[email protected]>
Reviewed-by: Adhemerval Zanella <[email protected]>

Can be dropped when we are using glibc 2.35 or later.

diff --git a/sysdeps/riscv/setjmp.S b/sysdeps/riscv/setjmp.S
index 0b92016b31..bec7ff80f4 100644
--- a/sysdeps/riscv/setjmp.S
+++ b/sysdeps/riscv/setjmp.S
@@ -21,7 +21,7 @@

ENTRY (_setjmp)
li a1, 0
- j __sigsetjmp
+ j HIDDEN_JUMPTARGET (__sigsetjmp)
END (_setjmp)
ENTRY (setjmp)
li a1, 1
diff --git a/sysdeps/unix/sysv/linux/riscv/setcontext.S b/sysdeps/unix/sysv/linux/riscv/setcontext.S
index 9510518750..e44a68aad4 100644
--- a/sysdeps/unix/sysv/linux/riscv/setcontext.S
+++ b/sysdeps/unix/sysv/linux/riscv/setcontext.S
@@ -95,6 +95,7 @@ LEAF (__setcontext)
99: j __syscall_error

END (__setcontext)
+libc_hidden_def (__setcontext)
weak_alias (__setcontext, setcontext)

LEAF (__start_context)
@@ -108,7 +109,7 @@ LEAF (__start_context)
/* Invoke subsequent context if present, else exit(0). */
mv a0, s2
beqz s2, 1f
- jal __setcontext
-1: j exit
+ jal HIDDEN_JUMPTARGET (__setcontext)
+1: j HIDDEN_JUMPTARGET (exit)

END (__start_context)
Loading