# \[all linkers\] fail hard on unsupported flags · gitcafe/zig

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

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

Visibility: public

Requested revision: 3f7e9ff597a3514bb1c4f1900027c40682ac9f13

Requested commit: 3f7e9ff597a3514bb1c4f1900027c40682ac9f13

Commit: 3f7e9ff597a3514bb1c4f1900027c40682ac9f13

Tree: 9573dd26dc4124f1709516c9262eec9d6031d9b6

Author: Motiejus Jakštys

Committer: Andrew Kelley

## Message

```
[all linkers] fail hard on unsupported flags

Currently `zig cc`, when confronted with a linker argument it does
not understand, skips the flag and emits a warning.

This has been causing headaches for people that build third-party
software (including me). Zig seemingly builds and links the final
executable, only to segfault when running it.

If there are linker warnings when compiling software, the first thing we
have to do is add support for ones linker is complaining, and only then
go file issues. If zig "successfully" (i.e. status code = 0) compiles a
binary, there is instead a tendency to blaim "zig doing something
weird". (I am guilty of this.) In my experience, adding the unsupported
arguments has been quite easy; see #11679, #11875, #11874 for recent
examples.

With the current ones (+ prerequisites below) I was able to build all of
the CGo programs that I am encountering at $dayjob. CGo is a reasonable
example, because it is exercising the unusual linker args quite a bit.

Prerequisites: #11614 and #11863.

```

## Parents

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

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