# Re-enable system linker hack · gitcafe/zig

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

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

Visibility: public

Requested revision: e0e3ceac19c0de0f8b3e408f9d3728496bc051f7

Requested commit: e0e3ceac19c0de0f8b3e408f9d3728496bc051f7

Commit: e0e3ceac19c0de0f8b3e408f9d3728496bc051f7

Tree: 676bca514c95c540837e42106cd8b9e9bb998531

Author: Jakub Konka

Committer: Jakub Konka

## Message

````
Re-enable system linker hack

It is now possible to force linking with system linker `ld` instead
of the LLVM `lld` linker when building natively on the target. This
can be done at each stage by specifying `--system-linker-hack` flag,
and can be useful on platforms where `lld` fails to operate properly
such as macOS 11 Big Sur on ARM64 where every binary/dylib is expected
to be codesigned.

Some example invocations for each stage of compilation of Zig
toolchain:

```
cmake .. -DCMAKE_PREFIX_PATH=/path/to/llvm -DSYSTEM_LINKER_HACK=1
```

```
build/zig build test --system-linker-hack
```

```
build/zig build --prefix $(pwd)/stage2 -Denable-llvm
--system-linker-hack
```

```
build/zig build-exe hello.zig --system-linker-hack
```

````

## Parents

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

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