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

llvmPackages.stdenv: make Darwin a “system” libc++ platform #347388

Draft
wants to merge 5 commits into
base: staging
Choose a base branch
from

Commits on Dec 2, 2024

  1. llvmPackages.stdenv: treat Darwin as a “system” libc++ platform

    Applying `overrideLibcxx` by default allows various LLVM versions to use
    the same underlying libc++ on Darwin. This works because libc++ is built
    by default with the stable ABI. Using the same libc++ regardless of LLVM
    version avoids potential ODR violations from linking multiple libc++
    versions in the same process.
    
    This is similar to the default on Linux, which uses libstdc++ instead of
    libc++. On both platforms, to force a stdenv to link against that LLVM
    version’s libc++, use `libcxxStdenv`.
    reckenrode committed Dec 2, 2024
    Configuration menu
    Copy the full SHA
    4814868 View commit details
    Browse the repository at this point in the history
  2. overrideLibcxx: avoid overriding a stdenv that already has an override

    Take advantage of the fact that an overriden libc++ has the “system”
    version prepended to the new version, so it doesn’t get overriden again.
    reckenrode committed Dec 2, 2024
    Configuration menu
    Copy the full SHA
    16f57bc View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    7eb55e3 View commit details
    Browse the repository at this point in the history
  4. overrideLibcxx: limit symbols in the override to the original version

    Darwin’s linkers support text-based stubs, which allows the override to
    use the “system” libc++ while limiting the symbols to those in the
    original version.
    reckenrode committed Dec 2, 2024
    Configuration menu
    Copy the full SHA
    a9f4b60 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    3351740 View commit details
    Browse the repository at this point in the history