Skip to content
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

depends: make osx output deterministic #9891

Merged
merged 1 commit into from
Mar 1, 2017

Conversation

theuni
Copy link
Member

@theuni theuni commented Feb 28, 2017

ld64 is threaded, and uses a worker for each CPU to parse input files. But
there's a bug in the parser causing dependencies to be calculated differently
based on which files have already been parsed.

As a result, builders with more CPUs are more likely to see non-determinism.

This looks to have been fixed in a newer version of ld64, so just disable
threading for now. There's no noticible slowdown.

@maflcko maflcko added this to the 0.14.0 milestone Feb 28, 2017
ld64 is threaded, and uses a worker for each CPU to parse input files. But
there's a bug in the parser causing dependencies to be calculated differently
based on which files have already been parsed.

As a result, builders with more CPUs are more likely to see non-determinism.

This looks to have been fixed in a newer version of ld64, so just disable
threading for now. There's no noticible slowdown.
@paveljanik
Copy link
Contributor

@theuni Brilliant investigation! Thank you!

For more info, the unpacked code is available at https://github.com/froydnj/ld64/blob/master/src/ld/InputFiles.cpp#L716

utACK 9e4d842

@jonasschnelli
Copy link
Contributor

Great, Thanks @theuni.
utACK 9e4d842

@laanwj
Copy link
Member

laanwj commented Mar 1, 2017

Wow, this is a really sneaky bug. Thanks for catching it. utACK 9e4d842

@laanwj laanwj merged commit 9e4d842 into bitcoin:master Mar 1, 2017
laanwj added a commit that referenced this pull request Mar 1, 2017
9e4d842 depends: make osx output deterministic (Cory Fields)

Tree-SHA512: 997a671832a28e600bc3c9cd1340c6c1fa08f050d7cf676a5d51b38f08161ac418621520459a9a53dd87102c13fb69cb2e58ec3cc00f738e204eb787d6f0cad6
laanwj pushed a commit that referenced this pull request Mar 1, 2017
ld64 is threaded, and uses a worker for each CPU to parse input files. But
there's a bug in the parser causing dependencies to be calculated differently
based on which files have already been parsed.

As a result, builders with more CPUs are more likely to see non-determinism.

This looks to have been fixed in a newer version of ld64, so just disable
threading for now. There's no noticible slowdown.

Github-Pull: #9891
Rebased-From: 9e4d842
@achow101
Copy link
Member

achow101 commented Mar 1, 2017

Post merge ACK. Tested by running 50 gitian builds with this patch applied and the hashes of each build match.

codablock pushed a commit to codablock/dash that referenced this pull request Jan 26, 2018
9e4d842 depends: make osx output deterministic (Cory Fields)

Tree-SHA512: 997a671832a28e600bc3c9cd1340c6c1fa08f050d7cf676a5d51b38f08161ac418621520459a9a53dd87102c13fb69cb2e58ec3cc00f738e204eb787d6f0cad6
CryptoCentric pushed a commit to absolute-community/absolute that referenced this pull request Feb 27, 2019
9e4d842 depends: make osx output deterministic (Cory Fields)

Tree-SHA512: 997a671832a28e600bc3c9cd1340c6c1fa08f050d7cf676a5d51b38f08161ac418621520459a9a53dd87102c13fb69cb2e58ec3cc00f738e204eb787d6f0cad6
zkbot added a commit to zcash/zcash that referenced this pull request Dec 11, 2019
Enable macOS cross-compilation

Includes code cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#7809
  - The `native_cctools` fix.
- bitcoin/bitcoin#8210
  - The macOS toolchain bump.
- bitcoin/bitcoin#9891
- bitcoin/bitcoin#15581
  - The `tar` change.
- bitcoin/bitcoin#16049
  - The `native_cctools` change.

Build instructions:
- Fetch `MacOSX10.11.sdk` from e.g. https://github.com/phracker/MacOSX-SDKs/releases
- Extract it into `depends/SDKs` (creating that folder first)
- `HOST=x86_64-apple-darwin11 ./zcutil/build.sh`
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants