ci: add FreeBSD Clang cross job #34491

pull fanquake wants to merge 4 commits into bitcoin:master from fanquake:freebsd_clang_cross changing 7 files +77 −21
  1. fanquake commented at 12:28 pm on February 3, 2026: member

    Alternative to #33562, which was adding a native FreeBSD job; however that had issues with permissions/caching, as well as potential determinism issues. This adds a FreeBSD cross job using Linux and Clang.

    Would close #33438. The same changes here could also be used to produce FreeBSD binaries out of Guix.

  2. DrahtBot commented at 12:28 pm on February 3, 2026: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK hebasto
    Concept ACK l0rinc, maflcko

    If your review is incorrectly listed, please copy-paste <!–meta-tag:bot-skip–> into the comment that the bot should ignore.

    Conflicts

    No conflicts as of last run.

  3. fanquake force-pushed on Feb 3, 2026
  4. DrahtBot added the label CI failed on Feb 3, 2026
  5. DrahtBot commented at 12:41 pm on February 3, 2026: contributor

    🚧 At least one of the CI tasks failed. Task lint: https://github.com/bitcoin/bitcoin/actions/runs/21630222694/job/62340895630 LLM reason (✨ experimental): Lint failure: a script lacks executable permission (ci/test/00_setup_env_freebsd_cross.sh) causing lint-files.py to fail.

    Try to run the tests locally, according to the documentation. However, a CI failure may still happen due to a number of reasons, for example:

    • Possibly due to a silent merge conflict (the changes in this pull request being incompatible with the current code in the target branch). If so, make sure to rebase on the latest commit of the target branch.

    • A sanitizer issue, which can only be found by compiling with the sanitizer and running the affected test.

    • An intermittent issue.

    Leave a comment here, if you need help tracking down a confusing failure.

  6. in ci/test/01_base_install.sh:112 in 28b62160db
    103@@ -104,4 +104,17 @@ if [ -n "$XCODE_VERSION" ] && [ ! -d "${DEPENDS_DIR}/SDKs/${OSX_SDK_BASENAME}" ]
    104   tar -C "${DEPENDS_DIR}/SDKs" -xf "$OSX_SDK_PATH"
    105 fi
    106 
    107+mkdir -p "${DEPENDS_DIR}/SDKs/freebsd-cross-${FREEBSD_VERSION}"
    108+
    109+FREEBSD_SDK_BASENAME="freebsd-cross-${XCODE_VERSION}"
    110+
    111+if [ -n "$FREEBSD_VERSION" ] && [ ! -d "${DEPENDS_DIR}/SDKs/${FREEBSD_SDK_BASENAME}" ]; then
    112+  FREEBSD_SDK_FILENAME="base-15.0.txz"
    


    maflcko commented at 12:49 pm on February 3, 2026:
    0  FREEBSD_SDK_FILENAME="base-${FREEBSD_VERSION}.txz"
    

    fanquake commented at 2:02 pm on February 3, 2026:
    Added
  7. in depends/hosts/freebsd.mk:1 in 28b62160db
    0@@ -1,31 +1,39 @@
    1+FREEBSD_VERSION=15.0
    


    maflcko commented at 12:49 pm on February 3, 2026:
    will this hard-code the version for everyone?

    maflcko commented at 7:46 am on March 20, 2026:
    Still wondering about this :thinking:

    fanquake commented at 7:54 am on March 20, 2026:
    Sorry, no, it shouldn’t do. It’s also possible for anyone to override this if needed i.e make -C depends/ HOST=x86_64-unknown-freebsd FREEBSD_VERSION=14.4.

    hebasto commented at 4:08 pm on March 23, 2026:

    The current assignment only allows overrides via command-line arguments, ignoring environment variables. This can be counter-intuitive. Suggesting the following change:

    0FREEBSD_VERSION ?= 15.0
    
  8. in ci/test/00_setup_env_freebsd_cross.sh:12 in 28b62160db
     7+export LC_ALL=C.UTF-8
     8+
     9+export CONTAINER_NAME=ci_freebsd_cross
    10+export CI_IMAGE_NAME_TAG="mirror.gcr.io/ubuntu:24.04"
    11+export APT_LLVM_V="21"
    12+export FREEBSD_VERSION=15.0
    


    maflcko commented at 12:49 pm on February 3, 2026:
    maybe use 14.3 for now, to avoid the failure?

    hebasto commented at 1:40 pm on February 3, 2026:
    Perhaps it won’t help.

    fanquake commented at 1:59 pm on February 3, 2026:

    maybe use 14.3 for now, to avoid the failure?

    Yea, that works, so I’ve pushed it up for now.

  9. maflcko commented at 12:51 pm on February 3, 2026: member
    nice, this should catch the compile issues. Can’t comment much on the build system changes, though
  10. fanquake force-pushed on Feb 3, 2026
  11. DrahtBot removed the label CI failed on Feb 3, 2026
  12. fanquake renamed this:
    [RFC] FreeBSD Clang cross CI
    ci: add FreeBSD Clang cross job
    on Feb 3, 2026
  13. DrahtBot added the label Tests on Feb 3, 2026
  14. vasild commented at 5:55 am on February 4, 2026: contributor

    potential determinism issues

    You can drop this from the OP, given #34093 (comment)

  15. maflcko commented at 6:56 am on February 4, 2026: member

    potential determinism issues

    You can drop this from the OP, given #34093 (comment)

    This refers to the alternative approach, which was using unpinned third-party deps, so I think the pull request description is correct.

  16. fanquake force-pushed on Feb 6, 2026
  17. fanquake force-pushed on Feb 11, 2026
  18. fanquake force-pushed on Feb 25, 2026
  19. fanquake force-pushed on Feb 27, 2026
  20. fanquake commented at 12:20 pm on February 27, 2026: member
    Switched to FreeBSD 15.0, now that #34093 is merged.
  21. fanquake force-pushed on Mar 6, 2026
  22. fanquake force-pushed on Mar 17, 2026
  23. fanquake marked this as ready for review on Mar 17, 2026
  24. in ci/test/01_base_install.sh:109 in b72174b918
    103@@ -104,4 +104,17 @@ if [ -n "$XCODE_VERSION" ] && [ ! -d "${DEPENDS_DIR}/SDKs/${OSX_SDK_BASENAME}" ]
    104   tar -C "${DEPENDS_DIR}/SDKs" -xf "$OSX_SDK_PATH"
    105 fi
    106 
    107+mkdir -p "${DEPENDS_DIR}/SDKs/freebsd-cross-${FREEBSD_VERSION}"
    108+
    109+FREEBSD_SDK_BASENAME="freebsd-cross-${XCODE_VERSION}"
    


    hebasto commented at 12:09 pm on March 17, 2026:
    0FREEBSD_SDK_BASENAME="freebsd-cross-${FREEBSD_VERSION}"
    

    fanquake commented at 2:51 pm on March 17, 2026:
    Fixed
  25. in depends/hosts/freebsd.mk:2 in b72174b918
    0@@ -1,31 +1,39 @@
    1+FREEBSD_VERSION=15.0
    2+FREEBSD_SDK=$(SDK_PATH)/freebsd-cross-$(FREEBSD_VERSION)/
    


    hebasto commented at 12:20 pm on March 17, 2026:
    Would it be possible to support side-by-side installations of SDKs for different architectures (e.g., amd64 and arm64)

    fanquake commented at 3:03 pm on March 17, 2026:
    I’ve put the target into the SDK path, which should be enough to achieve that.
  26. fanquake force-pushed on Mar 17, 2026
  27. fanquake force-pushed on Mar 17, 2026
  28. in ci/test/01_base_install.sh:114 in 079660de53
    109+FREEBSD_SDK_BASENAME="freebsd-${HOST}-${FREEBSD_VERSION}"
    110+
    111+if [ -n "$FREEBSD_VERSION" ] && [ ! -d "${DEPENDS_DIR}/SDKs/${FREEBSD_SDK_BASENAME}" ]; then
    112+  FREEBSD_SDK_FILENAME="base-${FREEBSD_VERSION}.txz"
    113+  FREEBSD_SDK_PATH="${DEPENDS_DIR}/sdk-sources/${FREEBSD_SDK_FILENAME}"
    114+  if [ ! -f "$OSX_SDK_PATH" ]; then
    


    l0rinc commented at 3:10 pm on March 17, 2026:
    0  if [ ! -f "$FREEBSD_SDK_PATH" ]; then
    

    fanquake commented at 3:46 pm on March 17, 2026:
    Fixed.
  29. in ci/test/01_base_install.sh:117 in 079660de53
    112+  FREEBSD_SDK_FILENAME="base-${FREEBSD_VERSION}.txz"
    113+  FREEBSD_SDK_PATH="${DEPENDS_DIR}/sdk-sources/${FREEBSD_SDK_FILENAME}"
    114+  if [ ! -f "$OSX_SDK_PATH" ]; then
    115+    ${CI_RETRY_EXE} curl --location --fail "https://download.freebsd.org/releases/amd64/${FREEBSD_VERSION}-RELEASE/base.txz" -o "$FREEBSD_SDK_PATH"
    116+  fi
    117+  tar -C "${DEPENDS_DIR}/SDKs/freebsd-cross-${FREEBSD_VERSION}" -xf "$FREEBSD_SDK_PATH"
    


    l0rinc commented at 3:10 pm on March 17, 2026:
    0  tar -C "${DEPENDS_DIR}/SDKs/${FREEBSD_SDK_BASENAME}" -xf "$FREEBSD_SDK_PATH"
    

    fanquake commented at 3:16 pm on March 17, 2026:
    This seems to be from a previous diff.
  30. DrahtBot added the label CI failed on Mar 17, 2026
  31. in ci/test/01_base_install.sh:111 in 072833379e outdated
    103@@ -104,4 +104,17 @@ if [ -n "$XCODE_VERSION" ] && [ ! -d "${DEPENDS_DIR}/SDKs/${OSX_SDK_BASENAME}" ]
    104   tar -C "${DEPENDS_DIR}/SDKs" -xf "$OSX_SDK_PATH"
    105 fi
    106 
    107+mkdir -p "${DEPENDS_DIR}/SDKs/freebsd-${HOST}-${FREEBSD_VERSION}"
    108+
    109+FREEBSD_SDK_BASENAME="freebsd-${HOST}-${FREEBSD_VERSION}"
    110+
    111+if [ -n "$FREEBSD_VERSION" ] && [ ! -d "${DEPENDS_DIR}/SDKs/${FREEBSD_SDK_BASENAME}" ]; then
    


    l0rinc commented at 3:14 pm on March 17, 2026:

    To avoid duplication we could use this in making the dir above - which should likely be after we’re checking for it, i.e.

    0FREEBSD_SDK_BASENAME="freebsd-${HOST}-${FREEBSD_VERSION}"
    1
    2if [ -n "$FREEBSD_VERSION" ] && [ ! -d "${DEPENDS_DIR}/SDKs/${FREEBSD_SDK_BASENAME}" ]; then
    3  mkdir -p "${DEPENDS_DIR}/SDKs/${FREEBSD_SDK_BASENAME}"
    
  32. fanquake force-pushed on Mar 17, 2026
  33. fanquake force-pushed on Mar 17, 2026
  34. fanquake force-pushed on Mar 17, 2026
  35. DrahtBot removed the label CI failed on Mar 17, 2026
  36. in depends/hosts/freebsd.mk:11 in e8df2be3b9 outdated
     6+# prior to 1af314465e5dfe3e8baa839a32a72e83c04f26ef, first released in v4.2.90.
     7+# At the time of writing, GNU Make v4.2.1 is still being used in supported
     8+# distro releases.
     9+#
    10+# Source: https://lists.gnu.org/archive/html/bug-make/2017-11/msg00017.html
    11+clang_prog=$(shell $(SHELL) $(.SHELLFLAGS) "command -v clang")
    


    l0rinc commented at 8:46 pm on March 17, 2026:
    nit: other names start with freebsd_ prefix

    fanquake commented at 0:05 am on March 18, 2026:
    This is on purpose.
  37. in ci/test/01_base_install.sh:110 in e8df2be3b9 outdated
    103@@ -104,4 +104,16 @@ if [ -n "$XCODE_VERSION" ] && [ ! -d "${DEPENDS_DIR}/SDKs/${OSX_SDK_BASENAME}" ]
    104   tar -C "${DEPENDS_DIR}/SDKs" -xf "$OSX_SDK_PATH"
    105 fi
    106 
    107+FREEBSD_SDK_BASENAME="freebsd-${HOST}-${FREEBSD_VERSION}"
    108+
    109+if [ -n "$FREEBSD_VERSION" ] && [ ! -d "${DEPENDS_DIR}/SDKs/${FREEBSD_SDK_BASENAME}" ]; then
    110+  FREEBSD_SDK_FILENAME="base-${FREEBSD_VERSION}.txz"
    


    l0rinc commented at 8:48 pm on March 17, 2026:

    we already have a basename above, could we use it here?

    0  FREEBSD_SDK_FILENAME="${FREEBSD_SDK_BASENAME}-base.txz"
    
  38. in ci/test/01_base_install.sh:116 in e8df2be3b9
    111+  FREEBSD_SDK_PATH="${DEPENDS_DIR}/sdk-sources/${FREEBSD_SDK_FILENAME}"
    112+  if [ ! -f "$FREEBSD_SDK_PATH" ]; then
    113+    ${CI_RETRY_EXE} curl --location --fail "https://download.freebsd.org/releases/amd64/${FREEBSD_VERSION}-RELEASE/base.txz" -o "$FREEBSD_SDK_PATH"
    114+  fi
    115+  mkdir -p "${DEPENDS_DIR}/SDKs/${FREEBSD_SDK_BASENAME}"
    116+  tar -C "${DEPENDS_DIR}/SDKs/freebsd-${HOST}-${FREEBSD_VERSION}" -xf "$FREEBSD_SDK_PATH"
    


    l0rinc commented at 8:48 pm on March 17, 2026:

    we could use the FREEBSD_SDK_BASENAME here as well:

    0  tar -C "${DEPENDS_DIR}/SDKs/${FREEBSD_SDK_BASENAME}" -xf "$FREEBSD_SDK_PATH"
    
  39. in .github/workflows/ci.yml:544 in e8df2be3b9
    539@@ -540,6 +540,13 @@ jobs:
    540             timeout-minutes: 120
    541             file-env: './ci/test/00_setup_env_native_msan.sh'
    542 
    543+
    544+          - name: 'FreeBSD Cross'
    


    l0rinc commented at 8:54 pm on March 17, 2026:

    fanquake commented at 2:23 pm on March 18, 2026:
    Sure.
  40. in .github/workflows/ci.yml:545 in e8df2be3b9
    539@@ -540,6 +540,13 @@ jobs:
    540             timeout-minutes: 120
    541             file-env: './ci/test/00_setup_env_native_msan.sh'
    542 
    543+
    544+          - name: 'FreeBSD Cross'
    545+            cirrus-runner: 'ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-md'
    


    l0rinc commented at 8:54 pm on March 17, 2026:

    if we’re just compiling (not even running tests), would a small instance suffice?

    0            cirrus-runner: 'ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-sm'
    
  41. in ci/test/00_setup_env_freebsd_cross.sh:24 in e8df2be3b9
    19+ -DREDUCE_EXPORTS=ON \
    20+ -DBUILD_GUI=OFF \
    21+ -DWITH_USDT=OFF \
    22+"
    23+export RUN_UNIT_TESTS="false"
    24+export RUN_FUNCTIONAL_TESTS="false"
    


    l0rinc commented at 8:59 pm on March 17, 2026:

    Are we planning on enabling the tests later? Having BSD tests would have helped with #34256

    nit: based on other usages the values don’t have to be strings: https://github.com/bitcoin/bitcoin/blob/e4c04f7759b0b390189410f5ef3ad5faa5354698/ci/test/00_setup_env_mac_native_fuzz.sh#L15-L17


    fanquake commented at 0:10 am on March 18, 2026:

    Are we planning on enabling the tests later?

    Not sure. This is just adding cross compilation.

  42. in depends/hosts/freebsd.mk:27 in e8df2be3b9 outdated
    22+
    23+freebsd_CC=$(clang_prog) --target=$(host) \
    24+              --sysroot=$(FREEBSD_SDK)
    25+
    26+freebsd_CXX=$(clangxx_prog) --target=$(host) \
    27+              --sysroot=$(FREEBSD_SDK) -stdlib=libc++
    


    l0rinc commented at 9:03 pm on March 17, 2026:

    isn’t libc++ the default here?

    0              --sysroot=$(FREEBSD_SDK)
    
  43. in depends/hosts/freebsd.mk:15 in e8df2be3b9
    10+# Source: https://lists.gnu.org/archive/html/bug-make/2017-11/msg00017.html
    11+clang_prog=$(shell $(SHELL) $(.SHELLFLAGS) "command -v clang")
    12+clangxx_prog=$(shell $(SHELL) $(.SHELLFLAGS) "command -v clang++")
    13+
    14+freebsd_AR=$(shell $(SHELL) $(.SHELLFLAGS) "command -v llvm-ar")
    15+freebsd_DSYMUTIL=$(shell $(SHELL) $(.SHELLFLAGS) "command -v dsymutil")
    


    l0rinc commented at 9:11 pm on March 17, 2026:
    Based on https://llvm.org/docs/CommandGuide/dsymutil.html this seems to be a macOS bundle format, probably not needed here

    hebasto commented at 12:25 pm on March 18, 2026:
    Right. On FreeBSD, command -v dsymutil returns nothing,

    fanquake commented at 2:19 pm on March 18, 2026:
    Dropped.
  44. in ci/test/00_setup_env_freebsd_cross.sh:13 in e8df2be3b9
     8+
     9+export CONTAINER_NAME=ci_freebsd_cross
    10+export CI_IMAGE_NAME_TAG="mirror.gcr.io/ubuntu:24.04"
    11+export APT_LLVM_V="21"
    12+export FREEBSD_VERSION=15.0
    13+export PACKAGES="clang-${APT_LLVM_V} llvm-${APT_LLVM_V} lld"
    


    l0rinc commented at 9:13 pm on March 17, 2026:

    doesn’t lld need the same version?

    0export PACKAGES="clang-${APT_LLVM_V} llvm-${APT_LLVM_V} lld-${APT_LLVM_V}"
    

    this will probably also need:

    0diff --git a/ci/test/01_base_install.sh b/ci/test/01_base_install.sh
    1--- a/ci/test/01_base_install.sh	(revision e8df2be3b9fbd8cfdf10e3a5f0e7c344d10a2673)
    2+++ b/ci/test/01_base_install.sh	(date 1773780463181)
    3@@ -53,6 +53,7 @@
    4 if [ -n "${APT_LLVM_V}" ]; then
    5   update-alternatives --install /usr/bin/clang++ clang++ "/usr/bin/clang++-${APT_LLVM_V}" 100
    6   update-alternatives --install /usr/bin/clang clang "/usr/bin/clang-${APT_LLVM_V}" 100
    7+  update-alternatives --install /usr/bin/ld.lld ld.lld "/usr/bin/ld.lld-${APT_LLVM_V}" 100
    8   update-alternatives --install /usr/bin/llvm-symbolizer llvm-symbolizer "/usr/bin/llvm-symbolizer-${APT_LLVM_V}" 100
    9 fi
    

    fanquake commented at 2:19 pm on March 18, 2026:
    In this compilation, I’d expect all these versions to work, but I’ve added this for consistency.
  45. in ci/test/00_setup_env_freebsd_cross.sh:15 in e8df2be3b9 outdated
    10+export CI_IMAGE_NAME_TAG="mirror.gcr.io/ubuntu:24.04"
    11+export APT_LLVM_V="21"
    12+export FREEBSD_VERSION=15.0
    13+export PACKAGES="clang-${APT_LLVM_V} llvm-${APT_LLVM_V} lld"
    14+export HOST=x86_64-unknown-freebsd
    15+export DEP_OPTS="build_CC=clang build_CXX=clang++ AR=llvm-ar-${APT_LLVM_V} STRIP=llvm-strip-${APT_LLVM_V} NM=llvm-nm-${APT_LLVM_V} RANLIB=llvm-ranlib-${APT_LLVM_V} NO_QT=1"
    


    l0rinc commented at 9:22 pm on March 17, 2026:
    Do we need to define CC and CXX here, too, isn’t the freebsd_CC/freebsd_CXX enough?

    fanquake commented at 0:13 am on March 18, 2026:
    build_CC and build_CXX are for native tools.
  46. in ci/test/00_setup_env_freebsd_cross.sh:16 in e8df2be3b9 outdated
    11+export APT_LLVM_V="21"
    12+export FREEBSD_VERSION=15.0
    13+export PACKAGES="clang-${APT_LLVM_V} llvm-${APT_LLVM_V} lld"
    14+export HOST=x86_64-unknown-freebsd
    15+export DEP_OPTS="build_CC=clang build_CXX=clang++ AR=llvm-ar-${APT_LLVM_V} STRIP=llvm-strip-${APT_LLVM_V} NM=llvm-nm-${APT_LLVM_V} RANLIB=llvm-ranlib-${APT_LLVM_V} NO_QT=1"
    16+export GOAL="install"
    



    fanquake commented at 0:13 am on March 18, 2026:
    Yep, and we are explicit in any case, in all CI configs.
  47. in ci/test/01_base_install.sh:111 in e8df2be3b9 outdated
    103@@ -104,4 +104,16 @@ if [ -n "$XCODE_VERSION" ] && [ ! -d "${DEPENDS_DIR}/SDKs/${OSX_SDK_BASENAME}" ]
    104   tar -C "${DEPENDS_DIR}/SDKs" -xf "$OSX_SDK_PATH"
    105 fi
    106 
    107+FREEBSD_SDK_BASENAME="freebsd-${HOST}-${FREEBSD_VERSION}"
    108+
    109+if [ -n "$FREEBSD_VERSION" ] && [ ! -d "${DEPENDS_DIR}/SDKs/${FREEBSD_SDK_BASENAME}" ]; then
    110+  FREEBSD_SDK_FILENAME="base-${FREEBSD_VERSION}.txz"
    111+  FREEBSD_SDK_PATH="${DEPENDS_DIR}/sdk-sources/${FREEBSD_SDK_FILENAME}"
    


    l0rinc commented at 9:50 pm on March 17, 2026:
    Should sdk-sources also be included in the explicit CI caches?
  48. l0rinc changes_requested
  49. l0rinc commented at 9:52 pm on March 17, 2026: contributor
    Left a few more comments. Concept ACK on adding FreeBSD cross-compilation coverage to CI.
  50. hebasto commented at 1:08 pm on March 18, 2026: member

    It looks like the first commit introduces a regression for FreeBSD users cross-compiling to other architectures:

    0$ gmake -j 8 -C depends NO_QT=1 HOST=i686-unknown-freebsd
    1$ cmake -B build --toolchain depends/i686-unknown-freebsd/toolchain.cmake
    2$ cmake --build build -t bitcoind
    3[323/323] Linking CXX executable bin/bitcoind
    4FAILED: [code=1] bin/bitcoind 
    5: && /usr/bin/clang++ --target=i686-unknown-freebsd -O2 -O2 -g -fuse-ld=lld    -fstack-protector-all -fcf-protection=full -fstack-clash-protection -Wl,-z,relro -Wl,-z,now -Wl,-z,separate-code -fPIE -pie -Xlinker --dependency-file=src/CMakeFiles/bitcoind.dir/link.d src/CMakeFiles/bitcoind.dir/bitcoind.cpp.o src/CMakeFiles/bitcoind.dir/init/bitcoind.cpp.o -o bin/bitcoind  lib/libbitcoin_node.a  lib/libbitcoin_wallet.a  lib/libbitcoin_zmq.a  /home/hebasto/dev/bitcoin/depends/i686-unknown-freebsd/lib/libzmq.a  src/libleveldb.a  src/libcrc32c.a  src/libminisketch.a  /home/hebasto/dev/bitcoin/depends/i686-unknown-freebsd/lib/libevent_extra.a  /home/hebasto/dev/bitcoin/depends/i686-unknown-freebsd/lib/libevent_pthreads.a  /home/hebasto/dev/bitcoin/depends/i686-unknown-freebsd/lib/libevent_core.a  -lpthread  lib/libbitcoin_common.a  lib/libbitcoin_util.a  lib/libbitcoin_clientversion.a  lib/libbitcoin_consensus.a  lib/libbitcoin_crypto.a  src/secp256k1/lib/libsecp256k1.a  src/univalue/libunivalue.a  -pthread  /home/hebasto/dev/bitcoin/depends/i686-unknown-freebsd/lib/libsqlite3.a && :
    6ld.lld: error: /home/hebasto/dev/bitcoin/depends/i686-unknown-freebsd/lib/libsqlite3.a(sqlite3.o) is incompatible with elf_i386_fbsd
    7clang++: error: linker command failed with exit code 1 (use -v to see invocation)
    8ninja: build stopped: subcommand failed.
    
  51. hebasto commented at 1:08 pm on March 18, 2026: member
    Concept ACK.
  52. fanquake commented at 2:17 pm on March 18, 2026: member

    It looks like the first commit introduces a regression for FreeBSD users cross-compiling to other architectures: HOST=i686-unknown-freebsd

    What SDK are you using for i386; I don’t see a 15.0 release under https://download.freebsd.org/releases/i386/?

    If I use the 14.4 version, and your commands, it builds fine (compiling on x86_64):

    0clang --version
    1Ubuntu clang version 18.1.3 (1ubuntu1)
    2Target: x86_64-pc-linux-gnu
    3...
    4file build/bin/bitcoind
    5build/bin/bitcoind: ELF 32-bit LSB pie executable, Intel 80386, version 1 (FreeBSD), dynamically linked, interpreter /libexec/ld-elf.so.1, for FreeBSD 14.4, FreeBSD-style, with debug_info, not stripped
    
  53. hebasto commented at 2:30 pm on March 18, 2026: member

    It looks like the first commit introduces a regression for FreeBSD users cross-compiling to other architectures: HOST=i686-unknown-freebsd

    What SDK are you using for i386; I don’t see a 15.0 release under https://download.freebsd.org/releases/i386/?

    Currently, on the master branch, there is no need to specify an SDK to cross-compile on FreeBSD x86_64 to i686.

  54. fanquake force-pushed on Mar 18, 2026
  55. DrahtBot added the label CI failed on Mar 18, 2026
  56. fanquake force-pushed on Mar 20, 2026
  57. maflcko commented at 7:45 am on March 20, 2026: member
    the ci failure is unrelated and fixed in #34857
  58. in ci/test/00_setup_env_freebsd_cross.sh:11 in 64fb4e6045
     6+
     7+export LC_ALL=C.UTF-8
     8+
     9+export CONTAINER_NAME=ci_freebsd_cross
    10+export CI_IMAGE_NAME_TAG="mirror.gcr.io/ubuntu:24.04"
    11+export APT_LLVM_V="21"
    


    maflcko commented at 7:57 am on March 20, 2026:
    nit: Could add a trailing comment that this aims to use the clang version that freebsd is using?

    fanquake commented at 8:28 am on March 20, 2026:
    This is currently 21 because I forgot to change it to 22. The LLVM version used by FreeBSD 15 is 19.x. We can try pin to 19, or just use 22, I don’t think I mind either way. One downside of pinning to older, could be poorer support in the apt repo (for current, or newer images).

    maflcko commented at 8:49 am on March 20, 2026:
    Ok, interesting. I guess you are right that the clang version doesn’t really matter here. Maybe one could use the default vanilla system clang (whatever version that is) of the IMAGE_NAME_TAG. This would allow dropping the APT_LLVM_V, having one less place to bump. But again, this doesn’t really matter, so anything is fine here.

    fanquake commented at 0:33 am on March 21, 2026:
    Ok, I’ll leave this for now, see if there are any other opinons.
  59. in ci/test/00_setup_env_freebsd_cross.sh:20 in 64fb4e6045 outdated
    15+export DEP_OPTS="build_CC=clang build_CXX=clang++ AR=llvm-ar-${APT_LLVM_V} STRIP=llvm-strip-${APT_LLVM_V} NM=llvm-nm-${APT_LLVM_V} RANLIB=llvm-ranlib-${APT_LLVM_V} NO_QT=1"
    16+export GOAL="install"
    17+export BITCOIN_CONFIG="\
    18+ --preset=dev-mode \
    19+ -DREDUCE_EXPORTS=ON \
    20+ -DBUILD_GUI=OFF \
    


    maflcko commented at 7:58 am on March 20, 2026:
    nit: Could add a comment why the gui is disabled. Just saying there is a compile failure (or so) is fine.

    fanquake commented at 8:29 am on March 20, 2026:

    I’ll add a comment, for reference at least one Qt compile failure is:

    0ld.lld: error: undefined symbol: QKqueueFileSystemWatcherEngine::create(QObject*)
    1>>> referenced by qfilesystemwatcher.cpp
    2>>>               qfilesystemwatcher.cpp.o:(QFileSystemWatcher::QFileSystemWatcher(QObject*)) in archive /root/ci_scratch/depends/aarch64-unknown-freebsd/lib/libQt6Core.a
    3clang++: error: linker command failed with exit code 1 (use -v to see invocation)
    

    hebasto commented at 4:14 pm on March 23, 2026:

    Could be fixed with the following patch:

     0--- a/depends/packages/qt.mk
     1+++ b/depends/packages/qt.mk
     2@@ -167,6 +167,8 @@ $(package)_config_env += CXX="$$($(package)_cxx)"
     3 $(package)_config_env_darwin := OBJC="$$($(package)_cc)"
     4 $(package)_config_env_darwin += OBJCXX="$$($(package)_cxx)"
     5 
     6+$(package)_config_opts_freebsd += -no-feature-inotify
     7+
     8 $(package)_cmake_opts := -DCMAKE_PREFIX_PATH=$(host_prefix)
     9 $(package)_cmake_opts += -DQT_FEATURE_cxx20=ON
    10 $(package)_cmake_opts += -DQT_GENERATE_SBOM=OFF
    

    fanquake commented at 2:56 am on March 24, 2026:
    Added.

    fanquake commented at 3:21 am on March 24, 2026:

    Could be fixed with the following patch:

    Did this work for you? The build is still broken here, after applying the above.


    fanquake commented at 3:27 am on March 24, 2026:
    I can’t find why qrencode support wasn’t added for FreeBSD in #32731, so added a commit here, to see if it builds.

    hebasto commented at 9:32 am on March 24, 2026:

    Could be fixed with the following patch:

    Did this work for you? The build is still broken here, after applying the above.

    I successfully built on Ubuntu 25.10. -no-feature-inotify is required to enabling compiling of the required source file:

    0qt_internal_extend_target(Core CONDITION QT_FEATURE_filesystemwatcher AND UNIX AND NOT MACOS AND NOT QT_FEATURE_inotify AND (APPLE OR FREEBSD OR NETBSD OR OPENBSD)
    1    SOURCES
    2        io/qfilesystemwatcher_kqueue.cpp io/qfilesystemwatcher_kqueue_p.h
    3)
    
  60. maflcko approved
  61. maflcko commented at 8:00 am on March 20, 2026: member

    Concept ACK

    Though, I am not familiar with freebsd, nor the build system, so I can’t really review this

  62. maflcko requested review from maflcko on Mar 20, 2026
  63. fanquake force-pushed on Mar 20, 2026
  64. DrahtBot removed the label CI failed on Mar 20, 2026
  65. fanquake force-pushed on Mar 23, 2026
  66. depends: disable inotify in Freebsd Qt build 6464f14081
  67. fanquake force-pushed on Mar 24, 2026
  68. fanquake force-pushed on Mar 24, 2026
  69. DrahtBot added the label CI failed on Mar 24, 2026
  70. depends: FreeBSD cross with Clang 7f7018738e
  71. fanquake force-pushed on Mar 24, 2026
  72. depends: build qrencode for Freebsd f44191f163
  73. ci: add FreeBSD cross CI job 65379bb8d0
  74. fanquake force-pushed on Mar 24, 2026
  75. DrahtBot removed the label CI failed on Mar 24, 2026
  76. hebasto commented at 11:45 am on March 24, 2026: member
    Approach ACK 65379bb8d0ebcbf5251f0bc0727019d2ba95be3c. I need to run a few more tests before the final ACK.
  77. hebasto commented at 2:24 pm on March 24, 2026: member

    The same changes here could also be used to produce FreeBSD binaries out of Guix.

    https://download.freebsd.org/releases/amd64/15.0-RELEASE/base.txz doesn’t seem to include static libraries like libc.a, libc++.a and libcxxrt.a. How should we handle this for the release binaries?

  78. fanquake commented at 0:39 am on March 25, 2026: member

    How should we handle this for the release binaries?

    I’ll look at that when we look at adding FreeBSD bins to releases, not as part of this PR.

  79. hebasto approved
  80. hebasto commented at 3:52 pm on March 25, 2026: member
    ACK 65379bb8d0ebcbf5251f0bc0727019d2ba95be3c. I’ve cross-compiled on Ubuntu 25.10 for FreeBSD 14.4 and 15.0. The former binaries (bitcoind, test_bitcoin and bitcoin-qt) were tested on FreeBSD 14.4 locally.
  81. DrahtBot requested review from l0rinc on Mar 25, 2026
  82. hebasto commented at 3:52 pm on March 25, 2026: member
    cc @vasild
  83. in depends/hosts/freebsd.mk:8 in 65379bb8d0
    0@@ -1,31 +1,38 @@
    1+FREEBSD_VERSION ?= 15.0
    2+FREEBSD_SDK=$(SDK_PATH)/freebsd-$(host)-$(FREEBSD_VERSION)/
    3+
    4+# We can't just use $(shell command -v clang) because GNU Make handles builtins
    5+# in a special way and doesn't know that `command` is a POSIX-standard builtin
    6+# prior to 1af314465e5dfe3e8baa839a32a72e83c04f26ef, first released in v4.2.90.
    7+# At the time of writing, GNU Make v4.2.1 is still being used in supported
    8+# distro releases.
    


    hebasto commented at 3:57 pm on March 25, 2026:
    I’m curious: which specific distributions used for cross-compiling are you referring to?

    fanquake commented at 1:47 am on March 26, 2026:
    The comment isn’t being introduced here, it’s from darwin.mk. I’d imagine it was in regards to Debian, or Ubuntu 20.04 (at the time) Maybe we can drop this at this point, as I don’t think it’s likely that Ubuntu 20.04 is being used to cross-compile for macOS. See #34923.
  84. hebasto merged this on Mar 29, 2026
  85. hebasto closed this on Mar 29, 2026

  86. fanquake deleted the branch on Mar 29, 2026

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-03-30 21:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me