# stage2: use system libc when targeting the native OS/ABI · gitcafe/zig

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

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

Visibility: public

Requested revision: 5ac91794cce8bd53916a378815be01e4365d53d9

Requested commit: 5ac91794cce8bd53916a378815be01e4365d53d9

Commit: 5ac91794cce8bd53916a378815be01e4365d53d9

Tree: e8c8e858a3d72d8aa422722a99ea96c7eda06a51

Author: Isaac Freund

Committer: Isaac Freund

## Message

```
stage2: use system libc when targeting the native OS/ABI

Currently zig will always try to build its own libc and compile against
that. This of course makes sense for cross-compilation, but can cause
problems when targeting the native OS/ABI.

For example, if the system uses a newer glibc version than zig ships
zig will fall back to using the newest version it does ship. However
this causes linking system libraries to fail as they are built against a
different glibc version than the zig code is built against.

To remedy this, simply default to linking the system libc when targeting
the native OS/ABI.

```

## Parents

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

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