Skip to content

Conversation

dongcarl
Copy link
Contributor

@dongcarl dongcarl commented Feb 5, 2020

Based on #16392 Update: Base PR has been merged.

Why this is useful: Previously, we were using the libc++ headers copied from the clang package we downloaded from llvm.org. This is suboptimal as our goal is to have a toolchain that can target macOS, which (in Xcode.app) has its own set of libc++ headers that can differ from those of the clang package. It seems to me that given our goal, it is better to use what Apple intends, and not rely on upstream clang <-> Apple clang compatibility.


This requires a regeneration of the macOS SDK, I apologize that this didn't make it into #16392, please follow the updated instructions here: 8e8fadf?short_path=9de36be#diff-9de36befe13356841c2699ee0eff4a0a (I'm linking to the Markdown diff so that people who need to regenerate the macOS SDK can see the difference in procedure from before)

We modify the macdeploy instructions in the next commit to include
libc++ headers in the SDK.
Previously, we did not include the libc++ headers in our SDK creation,
now we can use tpoechtrager's script to correctly do that. The
gen_sdk_package.sh is taken from
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.
@sipa
Copy link
Member

sipa commented Feb 9, 2020

Can you explain why this is useful?

@bitcoin bitcoin deleted a comment from DrahtBot Feb 9, 2020
@dongcarl
Copy link
Contributor Author

@sipa I apologize for not including that, it is now included in the PR description!

@DrahtBot
Copy link
Contributor

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

Conflicts

Reviewers, 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.

@Sjors
Copy link
Member

Sjors commented Apr 12, 2020

Travis linter is annoyed by a few things: https://travis-ci.org/github/bitcoin/bitcoin/jobs/646483250#L370

It wasn't super clear you have to point it to Xcode.app, not the directory. Otherwise I get this error:

found Xcode: /Users/sjors/dev/sdk-apple
Xcode (or this script) is out of date

The script produces a 97M file:

8d06240bce91b55cc5d278a90f4208aa4958d86bc14c3f2b70de2fdaa6b13c03  MacOSX10.14.sdk.tar.gz

(assuming this is deterministic, maybe add that checksum to the script as a sanity check?)

@dongcarl
Copy link
Contributor Author

@Sjors You have my gratitude for the testing! After thinking on this some more, I think something like #18674 might be a cleaner, less error-prone way forward. Will close this once I have a PR up!

@DrahtBot
Copy link
Contributor

🐙 This pull request conflicts with the target branch and needs rebase.

@dongcarl
Copy link
Contributor Author

Closing in favor of: #19240

@dongcarl dongcarl closed this Jun 10, 2020
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Feb 15, 2022
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