# fix static builds of zig from requiring c compiler · gitcafe/zig

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

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

Visibility: public

Requested revision: 6b36b756eb4b4c26b98d405310680ebe5679d111

Requested commit: 6b36b756eb4b4c26b98d405310680ebe5679d111

Commit: 6b36b756eb4b4c26b98d405310680ebe5679d111

Tree: 372ff21670a553664b443e08aae5601187d51bf4

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
fix static builds of zig from requiring c compiler

to be installed when linking libc.

When zig links against libc, it requires a dynamic linker path.
Usually this can be determined based on the architecture and operating
system components of the target. However on some systems this is not
correct; because of this zig checks its own dynamic linker.

When zig is statically linked, this information is not available, and so
it resorts to using cc -print-filename=foo to find the dynamic linker
path.

Before this commit, Zig incorrectly exited with an error if there was
no c compiler installed. Now, Zig falls back to the dynamic linker
determined based on the arch and os when no C compiler can be found.

```

## Parents

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

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