* 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
It's needed because LLVM emits library calls to compiler-rt when hardware lacks
functionality, for example, 64-bit integer multiplication on 32-bit x86.
This library is automatically built as-needed for the compilation target and
then statically linked and therefore is a transparent dependency for the
programmer.
Any bugs should be solved by trying to duplicate the bug upstream.
If the bug exists upstream, get it fixed with the LLVM team and then port
the fix downstream to Zig.
If the bug only exists in Zig, something went wrong porting the code,
and you can run the C code and Zig code side by side in a debugger
to figure out what's happening differently.