-
Notifications
You must be signed in to change notification settings - Fork 37.7k
depends: Switch from multilib to platform-specific toolchains #32162
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
base: master
Are you sure you want to change the base?
Conversation
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. Code Coverage & BenchmarksFor details see: https://corecheck.dev/bitcoin/bitcoin/pulls/32162. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. 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. |
4bf8e8f
to
1925dc1
Compare
@@ -6,11 +6,12 @@ | |||
|
|||
export LC_ALL=C.UTF-8 | |||
|
|||
export HOST=i686-pc-linux-gnu | |||
export HOST=i686-linux-gnu |
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.
i've always been confused about the -pc-
in the architecture tuple-is it directly related to use (or non-use) of multilib?
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.
It's hard to say.
Referring to x86_64-pc-linux-gnu
is still necessary when building depends natively on x86_64
, because:
$ uname -m
x86_64
$ ./depends/config.sub $(./depends/config.guess)
x86_64-pc-linux-gnu
However, dropping the -pc-
infix helped to with Clang's paths in the OSS-Fuzz environment.
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.
Hrm, yea, config.sub
adds it for x86 archs (but unknown
for others) so it's likely canonical somehow.
$ ./config.sub i386-linux-gnu
i386-pc-linux-gnu
$ ./config.sub x86_64-linux-gnu
x86_64-pc-linux-gnu
$ ./config.sub arm-linux-gnueabihf
arm-unknown-linux-gnueabihf
$ ./config.sub riscv64-linux-gnu
riscv64-unknown-linux-gnu
But seems fine to leave it out in the README.md
because it doesn't include the -unknown-
infixes either.
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.
Also, please note that depends/README.md
lists triplets after specifically mentioning "for cross compilation". In such cases:
bitcoin/depends/hosts/default.mk
Lines 1 to 3 in 4c1906a
ifneq ($(host),$(build)) | |
host_toolchain:=$(host)- | |
endif |
-pc-
infix.
Concept ACK, multilib is more or less specific to x86, it's better if multi-platform is handled in a more architecture-agnostic and consistent way. |
Rebased due to a conflict with the merged #30997. |
Guix builds (on x86_64) [untrusted test-only build, possibly unsafe, not for production use] |
Rebased due to a conflict with the merged #32086. |
Guix builds (on x86_64) [untrusted test-only build, possibly unsafe, not for production use] |
My Guix build:
|
🐙 This pull request conflicts with the target branch and needs rebase. |
Using the multilib GCC toolchain, as currently documented in
depends/README.md
, has several issues, such as:The
g++-multilib
package conflicts with platform-specific cross-compiler packages. This means it is not possible to cross compile fori686
and other platforms using the same set of installed packages.The
g++-multilib
package is not available forarm64
:This PR addresses all the issues mentioned above by switching from multilib to platform-specific toolchains.
Also see #22456.
Here are examples of building for different scenarions:
x86_64
orarm64
, building with depends natively:x86_64
orarm64
, cross compiling fori686-pc-linux-gnu
:x86_64
, cross compiling forarm64
:arm64
, cross compiling forx86_64
: