# std.zig.system.NativeTargetInfo: improve glibc version detection · gitcafe/zig

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

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

Visibility: public

Requested revision: fa940bafa2720f49ee249eda1ee4cf26a247172a

Requested commit: fa940bafa2720f49ee249eda1ee4cf26a247172a

Commit: fa940bafa2720f49ee249eda1ee4cf26a247172a

Tree: ab82a24917a27755897fb863bb0773ff723d75ca

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
std.zig.system.NativeTargetInfo: improve glibc version detection

Previously, this code would fail to detect glibc version because it
relied on libc.so.6 being a symlink which revealed the answer. On modern
distros, this is no longer the case.

This new strategy finds the path to libc.so.6 from /usr/bin/env, then
inspects the .dynstr section of libc.so.6, looking for symbols that
start with "GLIBC_2.". It then parses those as semantic versions and
takes the maximum value as the system-native glibc version.

closes #6469
   see #11137
closes #12567

```

## Parents

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

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