build: make macOS build Clang only #30206

issue fanquake opened this issue on May 30, 2024
  1. fanquake commented at 3:58 PM on May 30, 2024: member

    It should be possible to have a macOS (release) build environment that only uses Clang, and has no GCC toolchain installed.

    Currently that's not possible, because Qt still reaches out to g++. This can be demo'd by Guix building this branch: https://github.com/fanquake/bitcoin/tree/guix_macos_no_gcc, which removes the gcc-toolchain package, and associated build infra from the macOS env. It will fail with:

    Configuring qt...
    Creating qmake...
    make[1]: Entering directory '/bitcoin/depends/work/build/arm64-apple-darwin/qt/5.15.13-35fa99bb44b/qtbase/qmake'
    make[1]: g++: No such file or directory
    make[1]: *** [Makefile:250: main.o] Error 127
    

    TODO:

    • Make Qt work properly with just Clang.
  2. fanquake added the label Build system on May 30, 2024
  3. fanquake referenced this in commit 0f0c89e3e4 on Jul 23, 2024
  4. fanquake referenced this in commit e24d2bbe40 on Jul 23, 2024
  5. fanquake referenced this in commit 8b41ede55e on Jul 23, 2024
  6. fanquake referenced this in commit 115e241ec6 on Jul 24, 2024
  7. fanquake referenced this in commit 98f077bf6d on Jul 25, 2024
  8. davidgumberg referenced this in commit 27db7e8725 on Jul 29, 2024
  9. hebasto commented at 9:57 PM on March 21, 2025: member

    Here is a working proof of concept based on the branch from #30997. The last commit makes the macOS builds on Guix Clang only.

  10. fanquake commented at 2:54 AM on March 22, 2025: member

    The last commit makes the macOS builds on Guix Clang only.

    Seems like that commit is missing the diff to actually remove the GCC toolchain from the macOS build? Applying that causes the build to fail:

    diff --git a/contrib/guix/manifest.scm b/contrib/guix/manifest.scm
    index 4e7e955218..f1e3db81c8 100644
    --- a/contrib/guix/manifest.scm
    +++ b/contrib/guix/manifest.scm
    @@ -544,7 +544,6 @@ inspecting signatures in Mach-O binaries.")
             gzip
             xz
             ;; Build tools
    -        gcc-toolchain-13
             cmake-minimal
             gnu-make
             ;; Scripting
    @@ -556,12 +555,14 @@ inspecting signatures in Mach-O binaries.")
       (let ((target (getenv "HOST")))
         (cond ((string-suffix? "-mingw32" target)
                (list zip
    +                 gcc-toolchain-13
                      (make-mingw-pthreads-cross-toolchain "x86_64-w64-mingw32")
                      nsis-x86_64
                      nss-certs
                      osslsigncode))
               ((string-contains target "-linux-")
                (list bison
    +                 gcc-toolchain-13
                      pkg-config
                      (list gcc-toolchain-13 "static")
                      (make-bitcoin-cross-toolchain target)))
    
  11. hebasto commented at 6:28 PM on March 27, 2025: member

    The last commit makes the macOS builds on Guix Clang only.

    Seems like that commit is missing the diff to actually remove the GCC toolchain from the macOS build? Applying that causes the build to fail:

    diff --git a/contrib/guix/manifest.scm b/contrib/guix/manifest.scm
    index 4e7e955218..f1e3db81c8 100644
    --- a/contrib/guix/manifest.scm
    +++ b/contrib/guix/manifest.scm
    @@ -544,7 +544,6 @@ inspecting signatures in Mach-O binaries.")
             gzip
             xz
             ;; Build tools
    -       gcc-toolchain-13
             cmake-minimal
             gnu-make
             ;; Scripting
    @@ -556,12 +555,14 @@ inspecting signatures in Mach-O binaries.")
       (let ((target (getenv "HOST")))
         (cond ((string-suffix? "-mingw32" target)
                (list zip
    +                 gcc-toolchain-13
                      (make-mingw-pthreads-cross-toolchain "x86_64-w64-mingw32")
                      nsis-x86_64
                      nss-certs
                      osslsigncode))
               ((string-contains target "-linux-")
                (list bison
    +                 gcc-toolchain-13
                      pkg-config
                      (list gcc-toolchain-13 "static")
                      (make-bitcoin-cross-toolchain target)))
    

    This branch addresses your comment. However, it is still just a proof of concept.


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-05-02 21:13 UTC

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