# introduce operating system version ranges as part of the target · gitcafe/zig

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

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

Visibility: public

Requested revision: 4616af0ca459358ffa09ba27f9daa8527a38fd35

Requested commit: 4616af0ca459358ffa09ba27f9daa8527a38fd35

Commit: 4616af0ca459358ffa09ba27f9daa8527a38fd35

Tree: 2705847ded931e30dc924bd44acf24847743855c

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
introduce operating system version ranges as part of the target

 * re-introduce `std.build.Target` which is distinct from `std.Target`.
   `std.build.Target` wraps `std.Target` so that it can be annotated as
   "the native target" or an explicitly specified target.
 * `std.Target.Os` is moved to `std.Target.Os.Tag`. The former is now a
   struct which has the tag as well as version range information.
 * `std.elf` gains some more ELF header constants.
 * `std.Target.parse` gains the ability to parse operating system
   version ranges as well as glibc version.
 * Added `std.Target.isGnuLibC()`.
 * self-hosted dynamic linker detection and glibc version detection.
   This also adds the improved logic using `/usr/bin/env` rather than
   invoking the system C compiler to find the dynamic linker when zig
   is statically linked. Related: #2084
   Note: this `/usr/bin/env` code is work-in-progress.
 * `-target-glibc` CLI option is removed in favor of the new `-target`
   syntax. Example: `-target x86_64-linux-gnu.2.27`

closes #1907

```

## Parents

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

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