Skip to content

Link against clang runtime on static builds on macOS - #283

Merged
alexcrichton merged 2 commits into
sagebind:masterfrom
badboy:fix-static-link-on-macos
Jan 9, 2020
Merged

alexcrichton merged 2 commits into
sagebind:masterfrom
badboy:fix-static-link-on-macos

Conversation

@badboy

@badboy badboy commented Aug 21, 2019

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Collaborator

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

dmitmel commented Jan 9, 2020

Copy link
Copy Markdown

@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 sagebind#279.
@badboy
badboy force-pushed the fix-static-link-on-macos branch from 62116be to 31a058f Compare January 9, 2020 13:35
@badboy

badboy commented Jan 9, 2020

Copy link
Copy Markdown
Contributor Author

Rebased and force-pushed /cc @dmitmel

@dmitmel

dmitmel commented Jan 9, 2020

Copy link
Copy Markdown

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
Copy Markdown
Collaborator

Seems reasonable!

@alexcrichton
alexcrichton merged commit a6969c0 into sagebind: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 sagebind/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
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 sagebind/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