# fuzz testing: implement initial macos support · gitcafe/zig

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

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

Visibility: public

Requested revision: f8fe50314614aae1d1540f6a5ca0505bcbf66da0

Requested commit: f8fe50314614aae1d1540f6a5ca0505bcbf66da0

Commit: f8fe50314614aae1d1540f6a5ca0505bcbf66da0

Tree: 1fec56762b867017cb8c8f77933fe2ae42bb8893

Author: Loris Cro

Committer: Loris Cro

## Message

```
fuzz testing: implement initial macos support

This commit implements the linker-related code
required to have the `zig init` canyoufindme test
succeed on macos.

It fixes usage of the linker in order to account
for macos specific symbol mangling and introduces
some checks in the fuzzer code to prevent crashes
in case that instrumented code is invoked before
`fuzz_init` runs.

`@disableInstrumentation` has been added to the
start code to help reduce the amount of (needlessly)
instrumented code that runs, but the builtin is
active only in the scope where it's used, meaning
that any non-inlined function call that happens in
that same scope will still have instrumentation
enabled unless it too gets its own
`@disableInstrumentation` call.

Removing temporarily the code that bails out from
instrumentation callbacks when the fuzzer has not
been inited can be used to turn early (and wasteful)
execution of instrumented code into a crash, helping
finding places where to put more calls to
`@disableInstrumentation`.

```

## Parents

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

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