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

Link against clang runtime on static builds on macOS #283

Merged
merged 2 commits into from
Jan 9, 2020

Conversation

badboy
Copy link
Contributor

@badboy badboy commented Aug 21, 2019

On OSX we need to link against the clang runtime, which is hidden in some non-default path.
We can get the path from clang --print-search-dirs.
Kudos to @ehuss for finding that workaround.

Fixes #279.

@alexcrichton
Copy link
Owner

Nice! This is a bit simpler than I thought it would be.

Two requests for an update:

  • Could this be updated to basically ignore errors? I'm not sure how all OSX systems would respond to this, and I'm not sure if it's necessarily required on all systems (on older ones I think the symbol wasn't linked). In that sense it seems like it may be a bit more conservative to ignore errors and try to catch more linker errors later as they come up.

  • Could the comment be expanded a bit to include some information that macOS link error with static curl — missing ___isOSVersionAtLeast #279 contains or link to that issue directly?

@dmitmel
Copy link

dmitmel commented Jan 9, 2020

@alexcrichton Could you please share the logs of failed checks or trigger a rebuild on github actions by amending the commit (with no changes) and force pushing that? I'd like to take a look, but unfortunately, it looks like I don't have access to them.

@badboy badboy force-pushed the fix-static-link-on-macos branch from eb35c01 to 62116be Compare January 9, 2020 13:34
On OSX we need to link against the clang runtime, which is hidden in some non-default path.
We can get the path from `clang --print-search-dirs`.
Kudos to @ehuss for finding that workaround.

Fixes alexcrichton#279.
@badboy badboy force-pushed the fix-static-link-on-macos branch from 62116be to 31a058f Compare January 9, 2020 13:35
@badboy
Copy link
Contributor Author

badboy commented Jan 9, 2020

Rebased and force-pushed /cc @dmitmel

@dmitmel
Copy link

dmitmel commented Jan 9, 2020

Well, it looks like there are no errors now. I can confirm that this PR indeed fixes #279 on my machine with macOS 10.13.

@alexcrichton
Copy link
Owner

Seems reasonable!

@alexcrichton alexcrichton merged commit a6969c0 into alexcrichton:master Jan 9, 2020
@badboy badboy deleted the fix-static-link-on-macos branch January 9, 2020 18:22
@sagebind sagebind mentioned this pull request Feb 18, 2020
alexcrichton pushed a commit that referenced this pull request Feb 18, 2020
I'd like to pull in #283 downstream so that I can close sagebind/isahc#68. Master has everything needed now, I just need a new version...
bors added a commit to rust-lang/cargo that referenced this pull request Jul 23, 2020
Update features set in CI.

This removes the `curl/force-system-lib-on-osx` feature, which I don't think has been needed for a while (I believe it was fixed with alexcrichton/curl-rust#283).

This also uses the same features for `test -p cargo-test-support` so that cargo doesn't get recompiled (saving about a minute).
lucasfernog added a commit to tauri-apps/tauri that referenced this pull request Mar 17, 2023
* fix(ios): link clang_rt.ios to include isPlatformVersionAtLeast

See alexcrichton/curl-rust#283

* lint [skip ci]

* update swift-rs to 1.0.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

macOS link error with static curl — missing ___isOSVersionAtLeast
3 participants