Skip to content

Remove libclang_rt.osx.a link workaround - #621

Merged
alexcrichton merged 1 commit into
sagebind:mainfrom
madsmtm:remove-libclang_rt.osx.a-workaround
Sep 9, 2025
Merged

alexcrichton merged 1 commit into
sagebind:mainfrom
madsmtm:remove-libclang_rt.osx.a-workaround

Conversation

@madsmtm

@madsmtm madsmtm commented Sep 9, 2025 •

Copy link
Copy Markdown
Contributor

We previously linked the Clang runtime libclang_rt.osx.a to fix #279.

All current usage of __builtin_available(...) in curl detects for APIs older than macOS 10.12, which is Rust's currently minimum supported version. This means that they are no-ops, and thus no longer emit a symbol that we need to link.

Additionally, Rust's std has recently introduced these symbols in its standard library, see rust-lang/rust#138944. This means that even if curl were to start using __builtin_available with a check for a newer macOS version, it would still successfully link (at least when using Rust 1.91.0 or newer).

Finally, curl has supported the cfg option HAVE_BUILTIN_AVAILABLE for a while now, so if there ever does come a point where this starts having problems again, we can just disable that define.

Motivation: This makes cross-compiling from some other host to macOS slightly easier (since you no longer need to have the clang runtime built and available).

This was fixing sagebind#279.

All current usage of __builtin_available(...) in curl detects for APIs
older than macOS 10.12, which is Rust's currently minimum supported
version. This means that they are no-ops, and thus no longer emit a
symbol that we need to link.

Additionally, Rust's `std` has recently introduced these symbols in its
standard library, see rust-lang/rust#138944.
This means that even if curl _were_ to start using __builtin_available
with a check for a newer macOS version, it would still successfully link
(at least when using Rust 1.91.0 or newer).

Finally, curl has supported the cfg option HAVE_BUILTIN_AVAILABLE for a
while now, so if there ever does come a point where this starts having
problems again, we can just disable that define.

@alexcrichton alexcrichton left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this!

@alexcrichton
alexcrichton merged commit 4591a9a into sagebind:main Sep 9, 2025
@madsmtm
madsmtm deleted the remove-libclang_rt.osx.a-workaround branch September 9, 2025 20:42
madsmtm added a commit to nobodywho-ooo/llama-cpp-rs that referenced this pull request Aug 27, 2026
Since rust-lang/rust#138944, this is no longer
necessary. curl-rust also no longer has this workaround, see
sagebind/curl-rust#621.
AsbjornOlling pushed a commit to nobodywho-ooo/llama-cpp-rs that referenced this pull request Sep 18, 2026
Since rust-lang/rust#138944, this is no longer
necessary. curl-rust also no longer has this workaround, see
sagebind/curl-rust#621.
AsbjornOlling pushed a commit to nobodywho-ooo/llama-cpp-rs that referenced this pull request Sep 21, 2026
Since rust-lang/rust#138944, this is no longer
necessary. curl-rust also no longer has this workaround, see
sagebind/curl-rust#621.
AsbjornOlling pushed a commit to utilityai/llama-cpp-rs that referenced this pull request Sep 21, 2026
Since rust-lang/rust#138944, this is no longer
necessary. curl-rust also no longer has this workaround, see
sagebind/curl-rust#621.
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

2 participants