Skip to content

Inconsistency in macos/macosx version CLI flag vs. availability attributes/macros #86376

Closed
@h-vetinari

Description

@h-vetinari

The clang attribute reference says:

  • macos:
    Apple’s macOS operating system. The minimum deployment target is specified by the -mmacosx-version-min=*version* command-line argument. macosx is supported for backward-compatibility reasons, but it is deprecated.

So we learn that the attribute should be spelled with macos, not macosx:

__attribute__((availability(macos,introduced=10.14)))

however, the CLI-flag as documented still uses the "x":

-mmacosx-version-min=*version*
       ^
       X

At the very least, this leads to confusion, as both forms are found in the current LLVM repo:

I also believe it may lead to bugs, in the sense that -mmacosx-version-min=10.9 in newer clang ends up not setting MAC_OS_X_VERSION_MIN_REQUIRED or __MAC_OS_X_VERSION_MIN_REQUIRED?

I don't have a mac to test this hypothesis, but this is consistent with the failures I'm seeing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:driver'clang' and 'clang++' user-facing binaries. Not 'clang-cl'

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions