-
Notifications
You must be signed in to change notification settings - Fork 36.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build: Fix x86_64 <-> arm64 cross-compiling for macOS #23603
Conversation
Guix builds:
|
Interesting, concept ACK GUIX hashes, mine match @hebasto:
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…macOS 19f3896 build: Fix x86_64 <-> arm64 cross-compiling for macOS (Hennadii Stepanov) Pull request description: Currently, on master (111c3e0), dependencies are built for the build system architecture, not the provided host. On Intel-based macOS Big Sur 11.6.1 (20G224): ``` % make -C depends HOST=arm64-apple-darwin20 % lipo -info depends/arm64-apple-darwin20/lib/libsqlite3.a Non-fat file: depends/arm64-apple-darwin20/lib/libsqlite3.a is architecture: x86_64 ``` On M1-based macOS Monterey 12.0.1 (21A559) the `boost` package building fails with multiple errors like that: ``` % make -C depends boost HOST=x86_64-apple-darwin19 ... error: option 'cf-protection=return' cannot be specified on this target error: option 'cf-protection=branch' cannot be specified on this target 2 errors generated. ``` This PR allows to cross-compile as follows: - on Intel-based macOS Big Sur 11.6.1 (20G224): ``` % make -C depends HOST=arm64-apple-darwin20 % lipo -info depends/arm64-apple-darwin20/lib/libsqlite3.a Non-fat file: depends/arm64-apple-darwin20/lib/libsqlite3.a is architecture: arm64 % CONFIG_SITE=$PWD/depends/arm64-apple-darwin20/share/config.site ./configure % make % lipo -info src/qt/bitcoin-qt Non-fat file: src/qt/bitcoin-qt is architecture: arm64 ``` - on M1-based macOS Monterey 12.0.1 (21A559): ``` % make -C depends HOST=x86_64-apple-darwin19 % CONFIG_SITE=$PWD/depends/x86_64-apple-darwin19/share/config.site ./configure % make % lipo -info src/qt/bitcoin-qt Non-fat file: src/qt/bitcoin-qt is architecture: x86_64 ``` No behavior change for other builder-host pairs. This is an alternative to bitcoin#22506. ACKs for top commit: fanquake: ACK 19f3896 - this is definitely cleaner than the approach in bitcoin#22506. I've tested the x86_64 -> arm64 and arm64 -> x86_64 cross-compiles. Going to go-ahead and merge this given it's scoped to building for darwin targets, on darwin. Not sure if this is something we'll actually see used very often. Tree-SHA512: 67a7fed1db79bc43d41aabb5a676f90417a879e5dcffec1384c288b56ee32ba06ae3819abdc7aca85b81af6e782bcfff5c83a67a455560249fa095a807fc1187
Unfortunately, this PR introduced a regression which is fixed in #23817. |
…ing for macOS ad46528 build: Fix x86_64 <-> arm64 cross-compiling for macOS (Hennadii Stepanov) Pull request description: Currently, on master (e475dd3), dependencies are built for the build system architecture, not the provided host. On Intel-based macOS Big Sur 11.6.1 (20G224): ``` % make -C depends HOST=arm64-apple-darwin20 % lipo -info depends/arm64-apple-darwin20/lib/libsqlite3.a Non-fat file: depends/arm64-apple-darwin20/lib/libsqlite3.a is architecture: x86_64 ``` On M1-based macOS Monterey 12.0.1 (21A559) the `boost` package building fails with multiple errors like that: ``` % make -C depends boost HOST=x86_64-apple-darwin19 ... error: option 'cf-protection=return' cannot be specified on this target error: option 'cf-protection=branch' cannot be specified on this target 2 errors generated. ``` This PR allows to cross-compile as follows: - on Intel-based macOS Big Sur 11.6.1 (20G224): ``` % make -C depends HOST=arm64-apple-darwin20 % lipo -info depends/arm64-apple-darwin20/lib/libsqlite3.a Non-fat file: depends/arm64-apple-darwin20/lib/libsqlite3.a is architecture: arm64 % CONFIG_SITE=$PWD/depends/arm64-apple-darwin20/share/config.site ./configure % make % lipo -info src/qt/bitcoin-qt Non-fat file: src/qt/bitcoin-qt is architecture: arm64 ``` - on M1-based macOS Monterey 12.0.1 (21A559): ``` % make -C depends HOST=x86_64-apple-darwin19 % CONFIG_SITE=$PWD/depends/x86_64-apple-darwin19/share/config.site ./configure % make % lipo -info src/qt/bitcoin-qt Non-fat file: src/qt/bitcoin-qt is architecture: x86_64 ``` No behavior change for other builder-host pairs. This is an alternative to bitcoin/bitcoin#22506. ACKs for top commit: fanquake: ACK ad46528 - this is definitely cleaner than the approach in #22506. I've tested the x86_64 -> arm64 and arm64 -> x86_64 cross-compiles. Going to go-ahead and merge this given it's scoped to building for darwin targets, on darwin. Not sure if this is something we'll actually see used very often. Tree-SHA512: 67a7fed1db79bc43d41aabb5a676f90417a879e5dcffec1384c288b56ee32ba06ae3819abdc7aca85b81af6e782bcfff5c83a67a455560249fa095a807fc1187
d3b0f82 build: Fix regression introduced in PR23603 (Hennadii Stepanov) Pull request description: It appears 7629efc from bitcoin/bitcoin#23603 introduced a regression in build tool flag evaluation. On macOS system: - pre-PR23603 master (ae017b8): ``` % make -C depends print-darwin_CXXFLAGS darwin_CXXFLAGS=-pipe % make -C depends print-host_CXXFLAGS host_CXXFLAGS=-pipe ``` - the current master (3699786): ``` % make -C depends print-darwin_CXXFLAGS darwin_CXXFLAGS=-pipe % make -C depends print-host_CXXFLAGS host_CXXFLAGS=-arch x86_64 ``` It's obvious a flag being set in `depends/hosts/darwin.mk`, i.e., `-pipe`, is lost. With this PR: ``` % make -C depends print-darwin_CXXFLAGS darwin_CXXFLAGS=-pipe % make -C depends print-host_CXXFLAGS host_CXXFLAGS=-pipe -arch x86_64 ``` ACKs for top commit: fanquake: ACK d3b0f82 Tree-SHA512: 643099ce6858475ac9f3a4dfa72a4e493fec6fdd7042ae0f0d5fe44c5cd175e4eda63cb39fc46ac1501cadcd3466507ec88d9089235e005fe43ea7ab47ce37c1
d3b0f82 build: Fix regression introduced in PR23603 (Hennadii Stepanov) Pull request description: It appears 7629efc from bitcoin#23603 introduced a regression in build tool flag evaluation. On macOS system: - pre-PR23603 master (ae017b8): ``` % make -C depends print-darwin_CXXFLAGS darwin_CXXFLAGS=-pipe % make -C depends print-host_CXXFLAGS host_CXXFLAGS=-pipe ``` - the current master (3699786): ``` % make -C depends print-darwin_CXXFLAGS darwin_CXXFLAGS=-pipe % make -C depends print-host_CXXFLAGS host_CXXFLAGS=-arch x86_64 ``` It's obvious a flag being set in `depends/hosts/darwin.mk`, i.e., `-pipe`, is lost. With this PR: ``` % make -C depends print-darwin_CXXFLAGS darwin_CXXFLAGS=-pipe % make -C depends print-host_CXXFLAGS host_CXXFLAGS=-pipe -arch x86_64 ``` ACKs for top commit: fanquake: ACK d3b0f82 Tree-SHA512: 643099ce6858475ac9f3a4dfa72a4e493fec6fdd7042ae0f0d5fe44c5cd175e4eda63cb39fc46ac1501cadcd3466507ec88d9089235e005fe43ea7ab47ce37c1
…macOS 19f3896 build: Fix x86_64 <-> arm64 cross-compiling for macOS (Hennadii Stepanov) Pull request description: Currently, on master (111c3e0), dependencies are built for the build system architecture, not the provided host. On Intel-based macOS Big Sur 11.6.1 (20G224): ``` % make -C depends HOST=arm64-apple-darwin20 % lipo -info depends/arm64-apple-darwin20/lib/libsqlite3.a Non-fat file: depends/arm64-apple-darwin20/lib/libsqlite3.a is architecture: x86_64 ``` On M1-based macOS Monterey 12.0.1 (21A559) the `boost` package building fails with multiple errors like that: ``` % make -C depends boost HOST=x86_64-apple-darwin19 ... error: option 'cf-protection=return' cannot be specified on this target error: option 'cf-protection=branch' cannot be specified on this target 2 errors generated. ``` This PR allows to cross-compile as follows: - on Intel-based macOS Big Sur 11.6.1 (20G224): ``` % make -C depends HOST=arm64-apple-darwin20 % lipo -info depends/arm64-apple-darwin20/lib/libsqlite3.a Non-fat file: depends/arm64-apple-darwin20/lib/libsqlite3.a is architecture: arm64 % CONFIG_SITE=$PWD/depends/arm64-apple-darwin20/share/config.site ./configure % make % lipo -info src/qt/bitcoin-qt Non-fat file: src/qt/bitcoin-qt is architecture: arm64 ``` - on M1-based macOS Monterey 12.0.1 (21A559): ``` % make -C depends HOST=x86_64-apple-darwin19 % CONFIG_SITE=$PWD/depends/x86_64-apple-darwin19/share/config.site ./configure % make % lipo -info src/qt/bitcoin-qt Non-fat file: src/qt/bitcoin-qt is architecture: x86_64 ``` No behavior change for other builder-host pairs. This is an alternative to bitcoin#22506. ACKs for top commit: fanquake: ACK 19f3896 - this is definitely cleaner than the approach in bitcoin#22506. I've tested the x86_64 -> arm64 and arm64 -> x86_64 cross-compiles. Going to go-ahead and merge this given it's scoped to building for darwin targets, on darwin. Not sure if this is something we'll actually see used very often. Tree-SHA512: 67a7fed1db79bc43d41aabb5a676f90417a879e5dcffec1384c288b56ee32ba06ae3819abdc7aca85b81af6e782bcfff5c83a67a455560249fa095a807fc1187
d3b0f82 build: Fix regression introduced in PR23603 (Hennadii Stepanov) Pull request description: It appears 7629efc from bitcoin#23603 introduced a regression in build tool flag evaluation. On macOS system: - pre-PR23603 master (ae017b8): ``` % make -C depends print-darwin_CXXFLAGS darwin_CXXFLAGS=-pipe % make -C depends print-host_CXXFLAGS host_CXXFLAGS=-pipe ``` - the current master (3699786): ``` % make -C depends print-darwin_CXXFLAGS darwin_CXXFLAGS=-pipe % make -C depends print-host_CXXFLAGS host_CXXFLAGS=-arch x86_64 ``` It's obvious a flag being set in `depends/hosts/darwin.mk`, i.e., `-pipe`, is lost. With this PR: ``` % make -C depends print-darwin_CXXFLAGS darwin_CXXFLAGS=-pipe % make -C depends print-host_CXXFLAGS host_CXXFLAGS=-pipe -arch x86_64 ``` ACKs for top commit: fanquake: ACK d3b0f82 Tree-SHA512: 643099ce6858475ac9f3a4dfa72a4e493fec6fdd7042ae0f0d5fe44c5cd175e4eda63cb39fc46ac1501cadcd3466507ec88d9089235e005fe43ea7ab47ce37c1
…macOS 19f3896 build: Fix x86_64 <-> arm64 cross-compiling for macOS (Hennadii Stepanov) Pull request description: Currently, on master (111c3e0), dependencies are built for the build system architecture, not the provided host. On Intel-based macOS Big Sur 11.6.1 (20G224): ``` % make -C depends HOST=arm64-apple-darwin20 % lipo -info depends/arm64-apple-darwin20/lib/libsqlite3.a Non-fat file: depends/arm64-apple-darwin20/lib/libsqlite3.a is architecture: x86_64 ``` On M1-based macOS Monterey 12.0.1 (21A559) the `boost` package building fails with multiple errors like that: ``` % make -C depends boost HOST=x86_64-apple-darwin19 ... error: option 'cf-protection=return' cannot be specified on this target error: option 'cf-protection=branch' cannot be specified on this target 2 errors generated. ``` This PR allows to cross-compile as follows: - on Intel-based macOS Big Sur 11.6.1 (20G224): ``` % make -C depends HOST=arm64-apple-darwin20 % lipo -info depends/arm64-apple-darwin20/lib/libsqlite3.a Non-fat file: depends/arm64-apple-darwin20/lib/libsqlite3.a is architecture: arm64 % CONFIG_SITE=$PWD/depends/arm64-apple-darwin20/share/config.site ./configure % make % lipo -info src/qt/bitcoin-qt Non-fat file: src/qt/bitcoin-qt is architecture: arm64 ``` - on M1-based macOS Monterey 12.0.1 (21A559): ``` % make -C depends HOST=x86_64-apple-darwin19 % CONFIG_SITE=$PWD/depends/x86_64-apple-darwin19/share/config.site ./configure % make % lipo -info src/qt/bitcoin-qt Non-fat file: src/qt/bitcoin-qt is architecture: x86_64 ``` No behavior change for other builder-host pairs. This is an alternative to bitcoin#22506. ACKs for top commit: fanquake: ACK 19f3896 - this is definitely cleaner than the approach in bitcoin#22506. I've tested the x86_64 -> arm64 and arm64 -> x86_64 cross-compiles. Going to go-ahead and merge this given it's scoped to building for darwin targets, on darwin. Not sure if this is something we'll actually see used very often. Tree-SHA512: 67a7fed1db79bc43d41aabb5a676f90417a879e5dcffec1384c288b56ee32ba06ae3819abdc7aca85b81af6e782bcfff5c83a67a455560249fa095a807fc1187
d3b0f82 build: Fix regression introduced in PR23603 (Hennadii Stepanov) Pull request description: It appears 7629efc from bitcoin#23603 introduced a regression in build tool flag evaluation. On macOS system: - pre-PR23603 master (ae017b8): ``` % make -C depends print-darwin_CXXFLAGS darwin_CXXFLAGS=-pipe % make -C depends print-host_CXXFLAGS host_CXXFLAGS=-pipe ``` - the current master (3699786): ``` % make -C depends print-darwin_CXXFLAGS darwin_CXXFLAGS=-pipe % make -C depends print-host_CXXFLAGS host_CXXFLAGS=-arch x86_64 ``` It's obvious a flag being set in `depends/hosts/darwin.mk`, i.e., `-pipe`, is lost. With this PR: ``` % make -C depends print-darwin_CXXFLAGS darwin_CXXFLAGS=-pipe % make -C depends print-host_CXXFLAGS host_CXXFLAGS=-pipe -arch x86_64 ``` ACKs for top commit: fanquake: ACK d3b0f82 Tree-SHA512: 643099ce6858475ac9f3a4dfa72a4e493fec6fdd7042ae0f0d5fe44c5cd175e4eda63cb39fc46ac1501cadcd3466507ec88d9089235e005fe43ea7ab47ce37c1
…macOS 19f3896 build: Fix x86_64 <-> arm64 cross-compiling for macOS (Hennadii Stepanov) Pull request description: Currently, on master (111c3e0), dependencies are built for the build system architecture, not the provided host. On Intel-based macOS Big Sur 11.6.1 (20G224): ``` % make -C depends HOST=arm64-apple-darwin20 % lipo -info depends/arm64-apple-darwin20/lib/libsqlite3.a Non-fat file: depends/arm64-apple-darwin20/lib/libsqlite3.a is architecture: x86_64 ``` On M1-based macOS Monterey 12.0.1 (21A559) the `boost` package building fails with multiple errors like that: ``` % make -C depends boost HOST=x86_64-apple-darwin19 ... error: option 'cf-protection=return' cannot be specified on this target error: option 'cf-protection=branch' cannot be specified on this target 2 errors generated. ``` This PR allows to cross-compile as follows: - on Intel-based macOS Big Sur 11.6.1 (20G224): ``` % make -C depends HOST=arm64-apple-darwin20 % lipo -info depends/arm64-apple-darwin20/lib/libsqlite3.a Non-fat file: depends/arm64-apple-darwin20/lib/libsqlite3.a is architecture: arm64 % CONFIG_SITE=$PWD/depends/arm64-apple-darwin20/share/config.site ./configure % make % lipo -info src/qt/bitcoin-qt Non-fat file: src/qt/bitcoin-qt is architecture: arm64 ``` - on M1-based macOS Monterey 12.0.1 (21A559): ``` % make -C depends HOST=x86_64-apple-darwin19 % CONFIG_SITE=$PWD/depends/x86_64-apple-darwin19/share/config.site ./configure % make % lipo -info src/qt/bitcoin-qt Non-fat file: src/qt/bitcoin-qt is architecture: x86_64 ``` No behavior change for other builder-host pairs. This is an alternative to bitcoin#22506. ACKs for top commit: fanquake: ACK 19f3896 - this is definitely cleaner than the approach in bitcoin#22506. I've tested the x86_64 -> arm64 and arm64 -> x86_64 cross-compiles. Going to go-ahead and merge this given it's scoped to building for darwin targets, on darwin. Not sure if this is something we'll actually see used very often. Tree-SHA512: 67a7fed1db79bc43d41aabb5a676f90417a879e5dcffec1384c288b56ee32ba06ae3819abdc7aca85b81af6e782bcfff5c83a67a455560249fa095a807fc1187
d3b0f82 build: Fix regression introduced in PR23603 (Hennadii Stepanov) Pull request description: It appears 7629efc from bitcoin#23603 introduced a regression in build tool flag evaluation. On macOS system: - pre-PR23603 master (ae017b8): ``` % make -C depends print-darwin_CXXFLAGS darwin_CXXFLAGS=-pipe % make -C depends print-host_CXXFLAGS host_CXXFLAGS=-pipe ``` - the current master (3699786): ``` % make -C depends print-darwin_CXXFLAGS darwin_CXXFLAGS=-pipe % make -C depends print-host_CXXFLAGS host_CXXFLAGS=-arch x86_64 ``` It's obvious a flag being set in `depends/hosts/darwin.mk`, i.e., `-pipe`, is lost. With this PR: ``` % make -C depends print-darwin_CXXFLAGS darwin_CXXFLAGS=-pipe % make -C depends print-host_CXXFLAGS host_CXXFLAGS=-pipe -arch x86_64 ``` ACKs for top commit: fanquake: ACK d3b0f82 Tree-SHA512: 643099ce6858475ac9f3a4dfa72a4e493fec6fdd7042ae0f0d5fe44c5cd175e4eda63cb39fc46ac1501cadcd3466507ec88d9089235e005fe43ea7ab47ce37c1
Currently, on master (111c3e0), dependencies are built for the build system architecture, not the provided host.
On Intel-based macOS Big Sur 11.6.1 (20G224):
On M1-based macOS Monterey 12.0.1 (21A559) the
boost
package building fails with multiple errors like that:This PR allows to cross-compile as follows:
No behavior change for other builder-host pairs.
This is an alternative to #22506.