KEMBAR78
Improve superenv mixing newer LLVM headers with Apple libc++ by cho-m · Pull Request #20653 · Homebrew/brew · GitHub
Skip to content

Conversation

cho-m
Copy link
Member

@cho-m cho-m commented Sep 8, 2025

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew style with your changes locally?
  • Have you successfully run brew typecheck with your changes locally?
  • Have you successfully run brew tests with your changes locally?

To avoid missing symbols when mixing newer LLVM headers with older Apple libc++, inject a __config_site that sets vendor availability annotations to match system library.


A hacky proof-of-concept to increase usability of ENV.llvm_clang without LLVM runtime dependency when bottling older macOS.

Also can use this PR to discuss other ideas for improving ENV.llvm_clang to avoid having to force linkage even when unnecessary.


Though we may want to figure out a solution for LLVM formula that works outside of brew since we always get user issues when new LLVM introduces annotation (some that I recall include LLVM 15 verbose abort, LLVM 18 std::print and LLVM 21 std::__hash_memory)

@cho-m cho-m changed the title Fix using Apple libc++ with newer LLVM headers Improve superenv mixing newer LLVM headers with Apple libc++ Sep 8, 2025
Copy link
Member

@Bo98 Bo98 left a comment

Choose a reason for hiding this comment

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

I agree with how this looks.

But yeah, should also look into improving the LLVM formula too to handle these cases. Seems tricky to do though. I guess ideally we'd be able to add something like -stdlib=llvm_libc++ (MacPorts does something like that).

Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

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

Thanks for PR! A few questions.

@Xerxes-2

This comment has been minimized.

To avoid missing symbols when mixing newer LLVM headers with older Apple
libc++, inject a __config_site that sets vendor availability annotations
to match system library.
@cho-m cho-m marked this pull request as ready for review September 15, 2025 02:14
Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!

@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue Sep 15, 2025
Merged via the queue into main with commit c160aca Sep 15, 2025
41 checks passed
@MikeMcQuaid MikeMcQuaid deleted the llvm_libcxx branch September 15, 2025 11:53
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.

4 participants