# \[MachO\] add \-pagezero_size · gitcafe/zig

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

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

Visibility: public

Requested revision: 98138ba78c1540830a4fdb0537ed6ad5c7b57e7a

Requested commit: 98138ba78c1540830a4fdb0537ed6ad5c7b57e7a

Commit: 98138ba78c1540830a4fdb0537ed6ad5c7b57e7a

Tree: 8ff0a80295d0702fbe63bf8849c4b390ba94bd50

Author: Motiejus Jakštys

Committer: Jakub Konka

## Message

```
[MachO] add -pagezero_size

Pass `-pagezero_size` to the MachO linker. This is the final
"unsupported linker arg" that I could chase that CGo uses. After this
and #11874 we may be able to fail on an "unsupported linker arg" instead
of emiting a warning.

Test case:

    zig=/code/zig/build/zig
    CGO_ENABLED=1 GOOS=darwin GOARCH=amd64 CC="$zig cc -target x86_64-macos" CXX="$zig c++ -target x86_64-macos" go build -a -ldflags "-s -w" cgo.go

I compiled a trivial CGo program and executed it on an amd64 Darwin
host.

To be honest, I am not entirely sure what this is doing. This feels
right after reading what this argument does in LLVM sources, but I am by
no means qualified to make MachO pull requests. Will take feedback.

```

## Parents

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

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