# Set macOS/iPhoneOS/tvOS/watchOS ABI to none \(unspecified\) by default · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/5b813f1a2acdc1668e39008b02a234f3da724552)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 5b813f1a2acdc1668e39008b02a234f3da724552

Requested commit: 5b813f1a2acdc1668e39008b02a234f3da724552

Commit: 5b813f1a2acdc1668e39008b02a234f3da724552

Tree: eabcb979be04296d5bec8c6f4947dc2dd8621731

Author: Jakub Konka

Committer: Jakub Konka

## Message

````
Set macOS/iPhoneOS/tvOS/watchOS ABI to none (unspecified) by default

Prior to this change we would assume the ABI for Apple targets to
be GNU which could result in subtle errors in LLVM emitting calls
to non-existent system libc provided functions such as `_sincosf`
which is a GNU extension and as such is not provided by macOS for example.
This would result in linker errors where the linker would not be
able to find the said symbol in `libSystem.tbd`.

With this change, we now correctly identify macOS (and other Apple
platforms) as having ABI `unknown` which translates to unspecified
in LLVM under-the-hood:

```
// main.ll
target triple = "aarch64-unknown-macos-unknown"
```

Note however that we never suffix the target OS with target version
such as `macos11` or `macos12` which means we fail to instruct LLVM
of potential optimisations provided by the OS such as the availability
of function `___sincosf_stret`. I suggest we investigate that in a
follow-up commit.

````

## Parents

- [9747303d16dfca61316a292d1e05ac901191e3a3](https://git.cafe/gitcafe/zig/commit/9747303d16dfca61316a292d1e05ac901191e3a3?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/5b813f1a2acdc1668e39008b02a234f3da724552?format=markdown)
