cmake: Improve install_name_tool workaround #34591

pull hebasto wants to merge 2 commits into bitcoin:master from hebasto:260214-cmake-macos-cross changing 1 files +7 −2
  1. hebasto commented at 11:37 am on February 14, 2026: member

    We stopped using install_name_tool in 3bee51427a05075150721f0a05ead8f92e1ba019 (https://github.com/bitcoin/bitcoin/pull/29890), which required a CMake-specific hack:https://github.com/bitcoin/bitcoin/blob/b65ff0e5a1fd4ea2ae75e204729b8008c4ebb9ab/CMakeLists.txt#L72-L76

    Due to recent changes in CMake, this hack has become problematic for the following reasons:

    1. It is no longer needed when using CMake 4.2 or newer. See upstream [Issue #27069](https://gitlab.kitware.com/cmake/cmake/-/issues/27069) and [MR #10955](https://gitlab.kitware.com/cmake/cmake/-/merge_requests/10955).

    2. It causes an issue when using CMake 4.0.5 or newer. See upstream [Issue #26814](https://gitlab.kitware.com/cmake/cmake/-/issues/26814) and [MR #10721](https://gitlab.kitware.com/cmake/cmake/-/merge_requests/10721).

    This PR addresses both of these issues. Please see the individual commits for more details.

    Fixes #34513.

  2. cmake: Apply workaround for `install_name_tool` conditionally 80dc4359b8
  3. cmake: Provide `install_name_tool` stub instead of disabling it
    When running `enable_language()`, CMake checks the platform-specific
    toolchain components, which includes `install_name_tool` for macOS.
    We disable this check when cross-compiling on Linux because
    `install_name_tool` is not used and our toolchain file does not provide
    it.
    
    However, the current workaround has been breaking CMake's assumptions
    since commit eb8facd39606e9472f9ff6de40d7caf76767d0da (CMake 4.1.0,
    backported to 4.0.5), which causes an error during configuration using
    the Ninja generator.
    
    This change fixes this behaviour by providing a stub executable instead
    of `install_name_tool`, as we currently do in the depends build
    subsystem.
    096877ad10
  4. DrahtBot added the label Build system on Feb 14, 2026
  5. DrahtBot commented at 11:37 am on February 14, 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. A summary of reviews will appear here.

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #32367 (cmake: Check user-defined APPEND_*FLAGS variables early by hebasto)

    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.


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-02-17 06:13 UTC

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