8000 [Upstream] [Depends] Update macOS cross-compiling toolchain by lyricidal · Pull Request #136 · PRCYCoin/PRCYCoin · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[Upstream] [Depends] Update macOS cross-compiling toolchain #136

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

Merged
merged 30 commits into from
Oct 31, 2021

Conversation

lyricidal
Copy link
@lyricidal lyricidal commented Oct 31, 2021

This backports the following upstream PRs to update the macOS cross-compiling tools:

bitcoin#17550
bitcoin#16392
bitcoin#18589
bitcoin#19240
bitcoin#19407
bitcoin#17919
bitcoin#19530
bitcoin#17057
bitcoin#20333
bitcoin#18051
bitcoin#19124
bitcoin#20298
bitcoin#20447

The tools being updated are

Clang

Upgraded from 3.7.1 to 8.0.0

cctools

  • cctools 877.8 -> 949.0.1
  • LD64 253.9 -> 530
  • TAPI 1000.10.8

DSStore

Upgraded from 1.1.2 to 1.3.0 (this removes the biplist dependency)

This also effectively bumps our minimum supported macOS version to 10.12 (Sierra).

from https://github.com/PIVX-Project/PIVX/pull/2272/commits

Part of a series of updates to the macOC toolchain/deployment

lyricidal and others added 30 commits October 29, 2021 11:42
Co-Authored-By: Carl Dong <accounts@carldong.me>
This also removes some now-unnecessary cctools hacks.

Co-Authored-By: Cory Fields <cory-nospam-@coryfields.com>
This also removes the obsolete mlinker-version option

Co-Authored-By: Cory Fields <cory-nospam-@coryfields.com>
Co-Authored-By: Carl Dong <accounts@carldong.me>
Previously, we did not include the macOS SDK libc++ headers in our SDK creation process and instead used whichever libc++ headers shipped with the clang package we downloaded in depends.

This change adds a script (which works on both GNU/Linux and macOS) to correctly generate the macOS SDK including the libc++ headers. This can be thought of as a simplified rewrite of tpoechtrager's script:

https://github.com/tpoechtrager/osxcross/blob/d3392f4eae78f3fa3f1fd065fa423f2712825102/tools/gen_sdk_package.sh

The location within the SDK where we place the libc++ headers is chosen such that clang's search path detection logic for sysroots would pick up the headers properly.

We also document this change.
Now that we include the macOS SDK libc++ headers in our macOS SDK tarball, we no longer need this hack to use the libc++ from our pinned clang.
clang   6.0.1  -> 8.0.0
cctools 921    -> 949.0.1
ld64    409.12 -> 530
This gets us a newer SDK with c++17 support and retains 10.12 back-compat.

Co-Authored-By: Carl Dong <contact@carldong.me>
Without this clang fails to add any newly-added linker features.

Removing this in PIVX-Project/PIVX@ca5055a was likely a regression.

See bitcoin/bitcoin#19240 (comment) for more discussion.
For now they remain the same, but in the next commit, we will assign them differently according to wether or not we're using system clang.
8000
This should be caught by the differing clang --version outputs, but because we haven't yet extracted our pinned clang, the system one is actually used for the version check. That's not a problem because bumping our pinned clang will cause a rebuild of everything anyway.
For depends builds this was fixed by Fuzzbawls/PIVX@fbcfcf6, which deleted the conflicting headers. When we no longer control the clang installation, we need to ensure that the SDK's libc++ headers are used rather than the ones shipped with clang. We can do that by turning off the default include path and hard-coding our own. This hard-coded path is ok because we control (via SDK packaging) where these headers end-up.

Side-note: Now that this path is hard-coded in depends, we can potentially package the SDK differently, as the c++ folder can live wherever is most convenient for us.
Note that this does not _enable_ lto by default in any way, only hooks up the machinery for -flto to work correctly.

enable-lto-support is explicitly used for pinned-clang because we know it works. It is neither enabled nor disabled in the external clang case so that it can be auto-detected.
tpoechtrager/cctools-port#85 was merged upstream, which
fixes lto detection for external clang with some Linux Distro's including Ubuntu.
native_ds_store now takes advantage of Pythons ability to decode binary plists (since 3.4), so we can drop its biplist dependency.

The call to biplist.Data() in custom_dsstore doesn't seem to do anything, and from what I can tell can just be removed.
See https://docs.python.org/3/library/plistlib.html.
The new API was added in 3.4 and old removed in 3.9.
Aplies a patch to Qt that fixes the non-determinism by modifying Qt. The source of the non-determinism is how LLVM 8 optimizes qt_intersect_spans when compiling. The particular optimization that seems to be causing the problems is that a temp variable is being added for spans->y. For some reason, when it does this, it chooses different instructions to use when making that variable. We bypass this problem by patching qt_intersect_spans to always make and use this local variable.
@lyricidal lyricidal added the Upstream Upstream backports/fixes label Oct 31, 2021
@lyricidal lyricidal requested review from lopeed and anprdev October 31, 2021 15:40
@lopeed lopeed merged commit 43e0ab2 into develop Oct 31, 2021
@lopeed lopeed deleted the upstream-mac-depends branch October 31, 2021 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Upstream Upstream backports/fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0