Skip to content

Support "zippered" macOS binaries #131216

Open
@madsmtm

Description

@madsmtm

Dynamic libraries on macOS can be built in a way that allows loading them when running under Mac Catalyst as well. This is similar in spirit to universal binaries, but technologically different in that only a single binary and architecture is actually built, which allows for a lot of code sharing.

This can be used in Xcode when creating XCFramework bundles, and is underpinned by the the -darwin-target-variant flag in Clang - but that's the only official docs I could find on it. I did find this note though that explains the details really well.

If we wanted to support this in rustc, there's two questions that need answering:

  • How does the user activate it? A separate triple? An extra commandline flag?
  • How does the user detect this mode of compilation in their code? cfg(all(target_os = "macos", target_abi = "macabi"))? target_abi = "zippered"?

Opening this issue to have a place to refer back to, I'm undecided whether it's worth the effort to try to support, would like to see a concrete use-case first (if you know of one, please comment below!)

@rustbot label O-ios O-macos C-feature-request A-targets

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-targetsArea: Concerning the implications of different compiler targetsC-feature-requestCategory: A feature request, i.e: not implemented / a PR.O-iosOperating system: iOSO-macosOperating system: macOST-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions