cmake: Always disable install_name_tool search in macOS cross-builds #37008

Manually merged
hebasto merged 1 commit from 261129-install-name-tool into master 2026-12-02 14:27:57 +00:00 AGit
hebasto commented 2026-11-29 16:12:05 +00:00 (Migrated from github.com)

It was expected that CMake >= 4.2 would handle LLVM's install_name_tool binary properly. However, CMake MR 10955 fixed the search only for the unversioned binary, which is not always available. For example, the llvm package on Debian Trixie installs only /usr/bin/llvm-install-name-tool-19, but not the unversioned /usr/bin/llvm-install-name-tool, which results in a failure when configuring a cross-build for macOS.

This PR applies the workaround regardless of the CMake version.

It was expected that CMake >= 4.2 would handle LLVM's `install_name_tool` binary properly. However, CMake [MR 10955](https://gitlab.kitware.com/cmake/cmake/-/merge_requests/10955) fixed the search only for the [unversioned](https://gitlab.kitware.com/cmake/cmake/-/work_items/28341) binary, which is not always available. For example, the `llvm` package on Debian Trixie installs only `/usr/bin/llvm-install-name-tool-19`, but not the unversioned `/usr/bin/llvm-install-name-tool`, which results in a failure when configuring a cross-build for macOS. This PR applies the workaround regardless of the CMake version.
DrahtBot commented 2026-11-29 16:12:14 +00:00 (Migrated from github.com)

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

External sites

Reviews

See the guideline and AI policy for information on the review process.

Type Reviewers
ACK fanquake

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

<!--e57a25ab6845829454e8d69fc972939a--> The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. <!--006a51241073e994b41acfe9ec718e94--> ### External sites * Code coverage & benchmarks: https://corecheck.dev/bitcoin/bitcoin/pulls/37008 * Ralph review <img src=https://review.fish.foo/assets/bitcoin/bitcoin/37008.png alt="Ralph review status"> https://git.fish.foo/bitcoin/bitcoin/pulls/37008#author-ralph <!--021abf342d371248e50ceaed478a90ca--> ### Reviews See [the guideline](https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#code-review) and [AI policy](https://github.com/bitcoin/bitcoin/blob/master/doc/AI_POLICY.md) for information on the review process. | Type | Reviewers | | ---- | --------- | | ACK | [fanquake](https://github.com/bitcoin/bitcoin/pull/37008#issuecomment-7346823755) | 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. <!--5faf32d7da4f0f540f40219e4f7537a3-->
First-time contributor

I found no actionable issues in this static review.


Reviewed: 0fb48fe30ed6 · Review report · Previous reports

permalink

<!-- forgejo-review-bot:bitcoin/bitcoin --> <!-- ralph-engine:current:e1a29e5e677c47d383756f0fcf8f3760725c91d1104dd3ccb2f333b6217eba26:47880f5569fd2047d249266f337c4f2a509adf7d96c3ccb1c7644c2c2a650bff --> <!-- ralph-base:966e9800e84ee96bf4f23a4732ed30c275ef1db9 --> <!-- ralph-head:0fb48fe30ed6aaac20fd86e021938e7bc6c77f4e --> <!-- ralph-case:9077834b7791f62ae03656ff690b7441ce28259268b5c33c3477eae708fd93a4 --> I found no actionable issues in this static review. <!-- Review tier: standard --> --- Reviewed: [`0fb48fe30ed6`](<https://git.fish.foo/bitcoin/bitcoin/commit/0fb48fe30ed6aaac20fd86e021938e7bc6c77f4e>) · [Review report](<https://review.fish.foo/report/37008-0fb48fe30ed6aaac20fd86e021938e7bc6c77f4e-3426-2.html>) · [Previous reports](<https://review.fish.foo/traces/37008/>) [permalink](<https://review.fish.foo/report/37008-0fb48fe30ed6aaac20fd86e021938e7bc6c77f4e-3426-2.html>)
fanquake (Migrated from github.com) reviewed 2026-12-01 10:43:02 +00:00
fanquake (Migrated from github.com) commented 2026-12-01 10:43:02 +00:00

I don't think we need to add even more explanation and more links. Could just be something like:

We do not use the install_name_tool when cross-compiling for macOS.
However, CMake still searches for it, which causes an error during configuration.
So disable this tool check in further enable_language() commands.
See: https://gitlab.kitware.com/cmake/cmake/-/work_items/28341

? and we can clean all this up once CMake fixes it properly, looks like that might be after 4.6.0?

I don't think we need to add even more explanation and more links. Could just be something like: > We do not use the install_name_tool when cross-compiling for macOS. > However, CMake still searches for it, which causes an error during configuration. > So disable this tool check in further enable_language() commands. > See: https://gitlab.kitware.com/cmake/cmake/-/work_items/28341 ? and we can clean all this up once CMake fixes it properly, looks like that might be after `4.6.0`?
fanquake commented 2026-12-01 10:43:11 +00:00 (Migrated from github.com)

Concept ACK

Concept ACK
hebasto (Migrated from github.com) reviewed 2026-12-02 09:00:59 +00:00
hebasto (Migrated from github.com) commented 2026-12-02 09:00:59 +00:00

Thanks! The explanatory comment has been reworded.

Thanks! The explanatory comment has been reworded.
fanquake commented 2026-12-02 13:23:59 +00:00 (Migrated from github.com)

Guix Build:

aarch64
d542f202c3d868cc0aacf32dff4625a4da04d4e8737540b780f4176c76a461c6  guix-build-0fb48fe30ed6/output/aarch64-linux-gnu/SHA256SUMS.part
8173102080053d140bf6fbac1eb8d28a9fb4bd272a22c8c426ef26e7702579ff  guix-build-0fb48fe30ed6/output/aarch64-linux-gnu/bitcoin-0fb48fe30ed6-aarch64-linux-gnu-debug.tar.gz
4d50110e3f99353e1d125dc2b022f074f7b5ed3c631c45ef2759557af4c5373f  guix-build-0fb48fe30ed6/output/aarch64-linux-gnu/bitcoin-0fb48fe30ed6-aarch64-linux-gnu.tar.gz
da8d3708376ed21c2f5f79f85109a85501bddb1dea46e4a764f65e3e6a086f81  guix-build-0fb48fe30ed6/output/arm-linux-gnueabihf/SHA256SUMS.part
13ef903d5264b7bd85f3186ddda8482ad155bc4708b7e5acb8d0ed88a74136a3  guix-build-0fb48fe30ed6/output/arm-linux-gnueabihf/bitcoin-0fb48fe30ed6-arm-linux-gnueabihf-debug.tar.gz
77a217c256a50d9ee088863a476f3853cb29bf666e52188cf55dcfec7e64bdda  guix-build-0fb48fe30ed6/output/arm-linux-gnueabihf/bitcoin-0fb48fe30ed6-arm-linux-gnueabihf.tar.gz
57870ea002aece76f3691fe82ff72458b0d7c7eb0c60617dc2cf44c3e3e13d0e  guix-build-0fb48fe30ed6/output/arm64-apple-darwin/SHA256SUMS.part
e39474e12ad225db18c389d626852c01a5baf235eeabf96e6e2a2c5b9a3eacc0  guix-build-0fb48fe30ed6/output/arm64-apple-darwin/bitcoin-0fb48fe30ed6-arm64-apple-darwin-codesigning.tar.gz
5e904d89483354bfdf32cfe90ab9b7ac4fde6eebc2377faf9c979c6809212bfa  guix-build-0fb48fe30ed6/output/arm64-apple-darwin/bitcoin-0fb48fe30ed6-arm64-apple-darwin-unsigned.tar.gz
74044fba38b573b980d5da05e73ccf89358d5121d03f9d3109f601c1ced89372  guix-build-0fb48fe30ed6/output/arm64-apple-darwin/bitcoin-0fb48fe30ed6-arm64-apple-darwin-unsigned.zip
3578c551a000607703745673eee236fa3d6e0357e4f5e6ed11d127e8880aed43  guix-build-0fb48fe30ed6/output/dist-archive/bitcoin-0fb48fe30ed6.tar.gz
b5479ad5299b8ea7b905b5956640ba7a40efdd881f6ab3155e3a13b9ceb4b4f6  guix-build-0fb48fe30ed6/output/powerpc64-linux-gnu/SHA256SUMS.part
572cdc3b36a11d652fba019f315e97d01514615068ba45fb637d22cfb4bd09aa  guix-build-0fb48fe30ed6/output/powerpc64-linux-gnu/bitcoin-0fb48fe30ed6-powerpc64-linux-gnu-debug.tar.gz
bd096f8f8eeff82d1e6382bdcbc6ef5e238d90594957ee727c9e45e2267a57e9  guix-build-0fb48fe30ed6/output/powerpc64-linux-gnu/bitcoin-0fb48fe30ed6-powerpc64-linux-gnu.tar.gz
b3626d53ae0d23e4deb27f664a14001ac3ac546621ddd0300c96fe5499f0f0d4  guix-build-0fb48fe30ed6/output/riscv64-linux-gnu/SHA256SUMS.part
81ef075e0c11d3733f10228249ce93a8edc57eda6449f9aaeb307c071fe0d692  guix-build-0fb48fe30ed6/output/riscv64-linux-gnu/bitcoin-0fb48fe30ed6-riscv64-linux-gnu-debug.tar.gz
36a1cbd2e1415c1e86398687f80669817fb4d194bd59ae619ab56dfa285c90c4  guix-build-0fb48fe30ed6/output/riscv64-linux-gnu/bitcoin-0fb48fe30ed6-riscv64-linux-gnu.tar.gz
155f879872987144ccef0d608920f3637307b5cb1f4e50445522b7f06ea6198a  guix-build-0fb48fe30ed6/output/x86_64-apple-darwin/SHA256SUMS.part
2f4780e7bd291c9ca4f227a2c8470d371c1d8a148ef54f5d54382a5a743e5ecc  guix-build-0fb48fe30ed6/output/x86_64-apple-darwin/bitcoin-0fb48fe30ed6-x86_64-apple-darwin-codesigning.tar.gz
a2732f81005b7bcc0473840745942fee7ffd7188687c2c08c5165206c85b7e9e  guix-build-0fb48fe30ed6/output/x86_64-apple-darwin/bitcoin-0fb48fe30ed6-x86_64-apple-darwin-unsigned.tar.gz
9320324c4f19c0c7675ee549899e221704e2d57ea0387caf53bafce1a4fff535  guix-build-0fb48fe30ed6/output/x86_64-apple-darwin/bitcoin-0fb48fe30ed6-x86_64-apple-darwin-unsigned.zip
fd3c28ef2595567808555be4388b298f6532ec5e6d469e896131347740b046d9  guix-build-0fb48fe30ed6/output/x86_64-linux-gnu/SHA256SUMS.part
1727f609841408aa5586f395422ec4234404b69efd0ed0acff17c4a6106ef8e0  guix-build-0fb48fe30ed6/output/x86_64-linux-gnu/bitcoin-0fb48fe30ed6-x86_64-linux-gnu-debug.tar.gz
f0c7ebfd78afa7658f32313645d8832f5c79a71744e5b9a26e24a7dd20499b0c  guix-build-0fb48fe30ed6/output/x86_64-linux-gnu/bitcoin-0fb48fe30ed6-x86_64-linux-gnu.tar.gz
00b138a25910f1ac254d347477b1be54574bd78fe854e1c60ff97164445610ef  guix-build-0fb48fe30ed6/output/x86_64-w64-mingw32/SHA256SUMS.part
75d27d4fce09c54c5976fc68bfe6f067eafe5a70b87785dc63767f5953fed4ae  guix-build-0fb48fe30ed6/output/x86_64-w64-mingw32/bitcoin-0fb48fe30ed6-win64-codesigning.tar.gz
acb54023853e839cb5eff01561d62d5df0e66777d25ef1ae0998fdda3fe0a3a8  guix-build-0fb48fe30ed6/output/x86_64-w64-mingw32/bitcoin-0fb48fe30ed6-win64-debug.zip
b6d55345dbe5352cad9c4dca78a78d68815c03a2185bc9a14eec419017575a52  guix-build-0fb48fe30ed6/output/x86_64-w64-mingw32/bitcoin-0fb48fe30ed6-win64-setup-unsigned.exe
20a4103a4e1d19c381c28f5b958b1accd90ade476cf5136b6cc803c019a65b27  guix-build-0fb48fe30ed6/output/x86_64-w64-mingw32/bitcoin-0fb48fe30ed6-win64-unsigned.zip
Guix Build: ```bash aarch64 d542f202c3d868cc0aacf32dff4625a4da04d4e8737540b780f4176c76a461c6 guix-build-0fb48fe30ed6/output/aarch64-linux-gnu/SHA256SUMS.part 8173102080053d140bf6fbac1eb8d28a9fb4bd272a22c8c426ef26e7702579ff guix-build-0fb48fe30ed6/output/aarch64-linux-gnu/bitcoin-0fb48fe30ed6-aarch64-linux-gnu-debug.tar.gz 4d50110e3f99353e1d125dc2b022f074f7b5ed3c631c45ef2759557af4c5373f guix-build-0fb48fe30ed6/output/aarch64-linux-gnu/bitcoin-0fb48fe30ed6-aarch64-linux-gnu.tar.gz da8d3708376ed21c2f5f79f85109a85501bddb1dea46e4a764f65e3e6a086f81 guix-build-0fb48fe30ed6/output/arm-linux-gnueabihf/SHA256SUMS.part 13ef903d5264b7bd85f3186ddda8482ad155bc4708b7e5acb8d0ed88a74136a3 guix-build-0fb48fe30ed6/output/arm-linux-gnueabihf/bitcoin-0fb48fe30ed6-arm-linux-gnueabihf-debug.tar.gz 77a217c256a50d9ee088863a476f3853cb29bf666e52188cf55dcfec7e64bdda guix-build-0fb48fe30ed6/output/arm-linux-gnueabihf/bitcoin-0fb48fe30ed6-arm-linux-gnueabihf.tar.gz 57870ea002aece76f3691fe82ff72458b0d7c7eb0c60617dc2cf44c3e3e13d0e guix-build-0fb48fe30ed6/output/arm64-apple-darwin/SHA256SUMS.part e39474e12ad225db18c389d626852c01a5baf235eeabf96e6e2a2c5b9a3eacc0 guix-build-0fb48fe30ed6/output/arm64-apple-darwin/bitcoin-0fb48fe30ed6-arm64-apple-darwin-codesigning.tar.gz 5e904d89483354bfdf32cfe90ab9b7ac4fde6eebc2377faf9c979c6809212bfa guix-build-0fb48fe30ed6/output/arm64-apple-darwin/bitcoin-0fb48fe30ed6-arm64-apple-darwin-unsigned.tar.gz 74044fba38b573b980d5da05e73ccf89358d5121d03f9d3109f601c1ced89372 guix-build-0fb48fe30ed6/output/arm64-apple-darwin/bitcoin-0fb48fe30ed6-arm64-apple-darwin-unsigned.zip 3578c551a000607703745673eee236fa3d6e0357e4f5e6ed11d127e8880aed43 guix-build-0fb48fe30ed6/output/dist-archive/bitcoin-0fb48fe30ed6.tar.gz b5479ad5299b8ea7b905b5956640ba7a40efdd881f6ab3155e3a13b9ceb4b4f6 guix-build-0fb48fe30ed6/output/powerpc64-linux-gnu/SHA256SUMS.part 572cdc3b36a11d652fba019f315e97d01514615068ba45fb637d22cfb4bd09aa guix-build-0fb48fe30ed6/output/powerpc64-linux-gnu/bitcoin-0fb48fe30ed6-powerpc64-linux-gnu-debug.tar.gz bd096f8f8eeff82d1e6382bdcbc6ef5e238d90594957ee727c9e45e2267a57e9 guix-build-0fb48fe30ed6/output/powerpc64-linux-gnu/bitcoin-0fb48fe30ed6-powerpc64-linux-gnu.tar.gz b3626d53ae0d23e4deb27f664a14001ac3ac546621ddd0300c96fe5499f0f0d4 guix-build-0fb48fe30ed6/output/riscv64-linux-gnu/SHA256SUMS.part 81ef075e0c11d3733f10228249ce93a8edc57eda6449f9aaeb307c071fe0d692 guix-build-0fb48fe30ed6/output/riscv64-linux-gnu/bitcoin-0fb48fe30ed6-riscv64-linux-gnu-debug.tar.gz 36a1cbd2e1415c1e86398687f80669817fb4d194bd59ae619ab56dfa285c90c4 guix-build-0fb48fe30ed6/output/riscv64-linux-gnu/bitcoin-0fb48fe30ed6-riscv64-linux-gnu.tar.gz 155f879872987144ccef0d608920f3637307b5cb1f4e50445522b7f06ea6198a guix-build-0fb48fe30ed6/output/x86_64-apple-darwin/SHA256SUMS.part 2f4780e7bd291c9ca4f227a2c8470d371c1d8a148ef54f5d54382a5a743e5ecc guix-build-0fb48fe30ed6/output/x86_64-apple-darwin/bitcoin-0fb48fe30ed6-x86_64-apple-darwin-codesigning.tar.gz a2732f81005b7bcc0473840745942fee7ffd7188687c2c08c5165206c85b7e9e guix-build-0fb48fe30ed6/output/x86_64-apple-darwin/bitcoin-0fb48fe30ed6-x86_64-apple-darwin-unsigned.tar.gz 9320324c4f19c0c7675ee549899e221704e2d57ea0387caf53bafce1a4fff535 guix-build-0fb48fe30ed6/output/x86_64-apple-darwin/bitcoin-0fb48fe30ed6-x86_64-apple-darwin-unsigned.zip fd3c28ef2595567808555be4388b298f6532ec5e6d469e896131347740b046d9 guix-build-0fb48fe30ed6/output/x86_64-linux-gnu/SHA256SUMS.part 1727f609841408aa5586f395422ec4234404b69efd0ed0acff17c4a6106ef8e0 guix-build-0fb48fe30ed6/output/x86_64-linux-gnu/bitcoin-0fb48fe30ed6-x86_64-linux-gnu-debug.tar.gz f0c7ebfd78afa7658f32313645d8832f5c79a71744e5b9a26e24a7dd20499b0c guix-build-0fb48fe30ed6/output/x86_64-linux-gnu/bitcoin-0fb48fe30ed6-x86_64-linux-gnu.tar.gz 00b138a25910f1ac254d347477b1be54574bd78fe854e1c60ff97164445610ef guix-build-0fb48fe30ed6/output/x86_64-w64-mingw32/SHA256SUMS.part 75d27d4fce09c54c5976fc68bfe6f067eafe5a70b87785dc63767f5953fed4ae guix-build-0fb48fe30ed6/output/x86_64-w64-mingw32/bitcoin-0fb48fe30ed6-win64-codesigning.tar.gz acb54023853e839cb5eff01561d62d5df0e66777d25ef1ae0998fdda3fe0a3a8 guix-build-0fb48fe30ed6/output/x86_64-w64-mingw32/bitcoin-0fb48fe30ed6-win64-debug.zip b6d55345dbe5352cad9c4dca78a78d68815c03a2185bc9a14eec419017575a52 guix-build-0fb48fe30ed6/output/x86_64-w64-mingw32/bitcoin-0fb48fe30ed6-win64-setup-unsigned.exe 20a4103a4e1d19c381c28f5b958b1accd90ade476cf5136b6cc803c019a65b27 guix-build-0fb48fe30ed6/output/x86_64-w64-mingw32/bitcoin-0fb48fe30ed6-win64-unsigned.zip ```
fanquake commented 2026-12-02 13:24:21 +00:00 (Migrated from github.com)
ACK 0fb48fe30ed6aaac20fd86e021938e7bc6c77f4e
fanquake commented 2026-12-02 16:22:45 +00:00 (Migrated from github.com)

Backported this to 32.x in #37052.

Backported this to `32.x` in #37052.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
bitcoin/bitcoin!37008
No description provided.