# macho: use start.zig for macOS entrypoint · gitcafe/zig

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

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

Visibility: public

Requested revision: 91c3206b45074821749f52043937bf6ed6d9a105

Requested commit: 91c3206b45074821749f52043937bf6ed6d9a105

Commit: 91c3206b45074821749f52043937bf6ed6d9a105

Tree: 5d6d674d146e4189bc22865bed42dea0f9ada320

Author: Jakub Konka

Committer: Andrew Kelley

## Message

````
macho: use start.zig for macOS entrypoint

This effectively allows us to compile

```zig
pub fn main() void {}
```

which then calls into `std.start`.

Changes required to make this happen:
* handle signed int to immediate in x86_64 and aarch64 codegen
* ensure that on arm64 macOS, `.x19` is a caller-preserved register -
  I'm not sure about that one at all and would like to brainstorm it
  with anyone interested and especially Joachim.
* finally, fix a bug in the linker - mark new got entry as dirty upon
  atom growth.

````

## Parents

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

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