depends: move FreeBSD SDK handling to CI #35649

pull fanquake wants to merge 3 commits into bitcoin:master from fanquake:freebsd_partial_revert changing 4 files +38 −27
  1. fanquake commented at 2:00 PM on July 3, 2026: member

    Followup to #35397 (review), which partially reverts changes from #34491.

    Also, make sure we install the correct version of lld in OpenBSD job.

  2. fanquake requested review from hebasto on Jul 3, 2026
  3. DrahtBot added the label Build system on Jul 3, 2026
  4. DrahtBot commented at 2:00 PM on July 3, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/35649.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK willcl-ark

    If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #35412 (ci: add NetBSD Clang cross job by fanquake)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  5. fanquake force-pushed on Jul 3, 2026
  6. hebasto commented at 6:54 PM on July 4, 2026: member

    Commit 8347d351570b8e93f54824498d3de162100f17fb can be dropped in favour of the generalised approach suggested in 56701ff6d5c695d80075075953e20eac5cabff4d.

  7. depends: move FreeBSD SDK handling to CI
    As pointed out by Hebasto, the approach used in #35397 and #35412 is
    better, rather than hardcoding flags and putting the SDK handling into
    depends.
    244739db9d
  8. ci: FreeBSD 15.1 495f43f7b3
  9. ci: ensure we use correct lld version in OpenBSD job
    If we don't suffix with -${APT_LLVM_V}, then lld-21 will be installed.
    22ac4ad949
  10. fanquake force-pushed on Jul 6, 2026
  11. fanquake requested review from willcl-ark on Jul 7, 2026
  12. willcl-ark approved
  13. willcl-ark commented at 4:07 PM on July 7, 2026: member

    ACK 22ac4ad9496697f5881cb9a990fd0b50849e437e

    Keeping the CI-managed SDK, LLVM version and linker setup in CI files (rather than depends) make better sense to me. If depends users need a sysroot they can provide one manually.

  14. fanquake merged this on Jul 8, 2026
  15. fanquake closed this on Jul 8, 2026

  16. fanquake deleted the branch on Jul 8, 2026
  17. oleonardolima referenced this in commit 685fdce9a1 on Jul 9, 2026
  18. in ci/test/00_setup_env_freebsd_cross.sh:20 in 22ac4ad949
      18 | +export PACKAGES="clang-${APT_LLVM_V} llvm-${APT_LLVM_V} lld-${APT_LLVM_V}"
      19 | +export SYSROOT="--sysroot=${DEPENDS_DIR}/SDKs/${FREEBSD_SDK_BASENAME}"
      20 | +export DEP_OPTS="build_CC=clang build_CXX=clang++ \
      21 | + CC='clang --target=${HOST} ${SYSROOT}' \
      22 | + CXX='clang++ --target=${HOST} ${SYSROOT} -stdlib=libc++' \
      23 | + LDFLAGS='-Wc,-fuse-ld=lld -fuse-ld=lld' \
    


    hebasto commented at 9:50 AM on July 10, 2026:

    What's the purpose of the -Wc,-fuse-ld=lld Libtool's option here? All the depends packages that use Libtool seem to build fine without it.


    fanquake commented at 10:02 AM on July 10, 2026:

    Fontconfig doesn't build without it, because it's bundled libtool filters -fuse-ld=lld, and the build uses ld:

    2 warnings generated.
      CCLD     fcarch
    1 warning generated.
      CCLD     libfontconfig.la
    /usr/bin/aarch64-linux-gnu-ld.bfd: /ci_container_base/depends/SDKs/freebsd-x86_64-unknown-freebsd-15.1/usr/lib/crti.o: Relocations in generic ELF (EM: 62)
    /usr/bin/aarch64-linux-gnu-ld.bfd: /ci_container_base/depends/SDKs/freebsd-x86_64-unknown-freebsd-15.1/usr/lib/crti.o: Relocations in generic ELF (EM: 62)
    /usr/bin/aarch64-linux-gnu-ld.bfd: /ci_container_base/depends/SDKs/freebsd-x86_64-unknown-freebsd-15.1/usr/lib/crti.o: Relocations in generic ELF (EM: 62)
    /usr/bin/aarch64-linux-gnu-ld.bfd: /ci_container_base/depends/SDKs/freebsd-x86_64-unknown-freebsd-15.1/usr/lib/crti.o: Relocations in generic ELF (EM: 62)
    /usr/bin/aarch64-linux-gnu-ld.bfd: /ci_container_base/depends/SDKs/freebsd-x86_64-unknown-freebsd-15.1/usr/lib/crti.o: error adding symbols: file in wrong format
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    

    All the depends packages that use Libtool seem to build fine without it.

    How are you testing the build?


    hebasto commented at 10:10 AM on July 10, 2026:

    Fontconfig doesn't build without it, because it's bundled libtool filters -fuse-ld=lld, and the build uses ld:

    2 warnings generated.
      CCLD     fcarch
    1 warning generated.
      CCLD     libfontconfig.la
    /usr/bin/aarch64-linux-gnu-ld.bfd: /ci_container_base/depends/SDKs/freebsd-x86_64-unknown-freebsd-15.1/usr/lib/crti.o: Relocations in generic ELF (EM: 62)
    /usr/bin/aarch64-linux-gnu-ld.bfd: /ci_container_base/depends/SDKs/freebsd-x86_64-unknown-freebsd-15.1/usr/lib/crti.o: Relocations in generic ELF (EM: 62)
    /usr/bin/aarch64-linux-gnu-ld.bfd: /ci_container_base/depends/SDKs/freebsd-x86_64-unknown-freebsd-15.1/usr/lib/crti.o: Relocations in generic ELF (EM: 62)
    /usr/bin/aarch64-linux-gnu-ld.bfd: /ci_container_base/depends/SDKs/freebsd-x86_64-unknown-freebsd-15.1/usr/lib/crti.o: Relocations in generic ELF (EM: 62)
    /usr/bin/aarch64-linux-gnu-ld.bfd: /ci_container_base/depends/SDKs/freebsd-x86_64-unknown-freebsd-15.1/usr/lib/crti.o: error adding symbols: file in wrong format
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    

    Is this something that has been fixed in the modern Libtool versions?

    All the depends packages that use Libtool seem to build fine without it.

    How are you testing the build?

    https://github.com/hebasto/bitcoin/actions/runs/29028591723/job/86154951601


    fanquake commented at 10:14 AM on July 10, 2026:

    Is this something that has been fixed in the modern Libtool versions?

    I haven't looked.


    hebasto commented at 11:03 AM on July 10, 2026:

    I just checked the verbose build logs for for fontconfig. Notice how adding -Wc,-fuse-ld=lld to LDFLAGS silently drops -pthread:

    -libtool: link: clang --target=x86_64-unknown-freebsd --sysroot=/home/hebasto/SDKs/freebsd-x86_64-unknown-freebsd-15.0 -shared  -fPIC -DPIC  .libs/fcatomic.o .libs/fcblanks.o .libs/fccache.o .libs/fccfg.o .libs/fccharset.o .libs/fccompat.o .libs/fcdbg.o .libs/fcdefault.o .libs/fcdir.o .libs/fcformat.o .libs/fcfreetype.o .libs/fcfs.o .libs/fcinit.o .libs/fclang.o .libs/fclist.o .libs/fcmatch.o .libs/fcmatrix.o .libs/fcname.o .libs/fcobjs.o .libs/fcpat.o .libs/fcrange.o .libs/fcserialize.o .libs/fcstat.o .libs/fcstr.o .libs/fcweight.o .libs/fcxml.o .libs/ftglue.o   -L/home/hebasto/dev/bitcoin/depends/x86_64-unknown-freebsd/lib -lfreetype -lexpat  --sysroot=/home/hebasto/SDKs/freebsd-x86_64-unknown-freebsd-15.0 -O2 -pthread   -pthread -Wl,-soname -Wl,libfontconfig.so.1 -o .libs/libfontconfig.so.1.10.1
    +libtool: link: clang --target=x86_64-unknown-freebsd --sysroot=/home/hebasto/SDKs/freebsd-x86_64-unknown-freebsd-15.0 -shared  -fPIC -DPIC  .libs/fcatomic.o .libs/fcblanks.o .libs/fccache.o .libs/fccfg.o .libs/fccharset.o .libs/fccompat.o .libs/fcdbg.o .libs/fcdefault.o .libs/fcdir.o .libs/fcformat.o .libs/fcfreetype.o .libs/fcfs.o .libs/fcinit.o .libs/fclang.o .libs/fclist.o .libs/fcmatch.o .libs/fcmatrix.o .libs/fcname.o .libs/fcobjs.o .libs/fcpat.o .libs/fcrange.o .libs/fcserialize.o .libs/fcstat.o .libs/fcstr.o .libs/fcweight.o .libs/fcxml.o .libs/ftglue.o   -L/home/hebasto/dev/bitcoin/depends/x86_64-unknown-freebsd/lib -lfreetype -lexpat  --sysroot=/home/hebasto/SDKs/freebsd-x86_64-unknown-freebsd-15.0 -O2 -fuse-ld=lld   -Wl,-soname -Wl,libfontconfig.so.1 -o .libs/libfontconfig.so.1.10.1
    

    Given this, shouldn't we adjust LDFLAGS as follows:

     LDFLAGS='-Wc,-pthread -Wc,-fuse-ld=lld -fuse-ld=lld' \
    

    and document this Libtool hack in a comment?


    hebasto commented at 11:09 AM on July 10, 2026:

    Fontconfig doesn't build without it, because it's bundled libtool filters -fuse-ld=lld, and the build uses ld:

    2 warnings generated.
      CCLD     fcarch
    1 warning generated.
      CCLD     libfontconfig.la
    /usr/bin/aarch64-linux-gnu-ld.bfd: /ci_container_base/depends/SDKs/freebsd-x86_64-unknown-freebsd-15.1/usr/lib/crti.o: Relocations in generic ELF (EM: 62)
    /usr/bin/aarch64-linux-gnu-ld.bfd: /ci_container_base/depends/SDKs/freebsd-x86_64-unknown-freebsd-15.1/usr/lib/crti.o: Relocations in generic ELF (EM: 62)
    /usr/bin/aarch64-linux-gnu-ld.bfd: /ci_container_base/depends/SDKs/freebsd-x86_64-unknown-freebsd-15.1/usr/lib/crti.o: Relocations in generic ELF (EM: 62)
    /usr/bin/aarch64-linux-gnu-ld.bfd: /ci_container_base/depends/SDKs/freebsd-x86_64-unknown-freebsd-15.1/usr/lib/crti.o: Relocations in generic ELF (EM: 62)
    /usr/bin/aarch64-linux-gnu-ld.bfd: /ci_container_base/depends/SDKs/freebsd-x86_64-unknown-freebsd-15.1/usr/lib/crti.o: error adding symbols: file in wrong format
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    

    We should switch the OS image to the arm64 architecture to catch similar issues in the future: https://github.com/hebasto/bitcoin/actions/runs/29087392625/job/86344255907.


    fanquake commented at 11:16 AM on July 10, 2026:

    Given this, shouldn't we adjust LDFLAGS as follows: and document this Libtool hack in a comment?

    I don't mind. The point of adding this CI was to have a sanity check that bitcoin code actually compiles, when targeting FreeBSD. This seems to be getting well into the weeds, trying to document and workaround a problem in a sub dependency (where the issue is likely fixed in newer versions), of an optional dependency, which doesn't seem to have any effect on compilation, and only manifests on 1 architecture.

  19. in ci/test/00_setup_env_freebsd_cross.sh:30 in 22ac4ad949
      28 | + RANLIB=llvm-ranlib-${APT_LLVM_V} \
      29 | + STRIP=llvm-strip-${APT_LLVM_V}"
      30 |  export GOAL="install"
      31 |  export BITCOIN_CONFIG="\
      32 |   --preset=dev-mode \
      33 | + -DCMAKE_LINKER_TYPE=LLD \
    


    hebasto commented at 9:52 AM on July 10, 2026:

    This CMake option seems redundant, as -fuse-ld=lld is already passed via the toolchain file, no?

  20. hebasto commented at 11:27 AM on July 10, 2026: member

    Post-merge ACK 22ac4ad9496697f5881cb9a990fd0b50849e437e.


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-07-11 18:51 UTC

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