<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/86376>86376</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Inconsistency in macos/macosx version CLI flag vs. availability attributes/macros
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          h-vetinari
      </td>
    </tr>
</table>

<pre>
    The clang attribute [reference](https://clang.llvm.org/docs/AttributeReference.html#availability) 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:
* search for [`-mmacosx-version-min`](https://github.com/search?q=repo%3Allvm%2Fllvm-project%20%2F-mmacosx-version-min%2F&type=code)
* search for [`-mmacos-version-min`](https://github.com/search?q=repo%3Allvm%2Fllvm-project%20%2F-mmacos-version-min%2F&type=code)

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.
 
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy8VU-Po7gT_TTOpZQITCDkwIHJHylS97R-3b8dzQ0ZuxK8a2zWNknn269sMp3tVffsnDZCKBj7Vb16VQ_mnDxpxIrkX0i-nbHRd8ZW3fyMXmpm5aw14lr9v0PgiukTMO-tbEePQPIvFo9oUXMk-ZbQsvN-cCSrCd0Tuo_7F0qd-4WxJ0L3wnB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