authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-01-04 17:26:06-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-01-04 17:26:06-07:00
log362460ec24d802e6fba7f45ddff5f969642839df
tree2cdeb8469c1cda5b6d50b86f38d87c4b5a3ea2b1
parentcbaaf6477fa314257a550515886563d6e7a06fc7

minor cosmetic fixups

* fix typos and redundancies in docs * use Target.isGnuLibc

2 files changed, 6 insertions(+), 8 deletions(-)

lib/libc/glibc/README.md+5-7
......@@ -1,15 +1,13 @@
11# Zig GNU C Library ("glibc") Support
22
3*Date*: November, 2023
4
53Zig supports building binaries that will dynamically link against the
64[GNU C Library ("glibc")](https://www.gnu.org/software/libc/) when run.
75This support extends across a range of glibc versions.
86
97By default, Zig binaries will not depend on any external C library, but
10they can be linked against one with the `-lc` option. The compilation
11target defines which C library: `musl` for the
12[musl C library](https://musl.libc.org/) or `gnu` for the GNU C library.
8they can be linked against one with the `-lc` option. The target ABI defines
9which C library: `musl` for the [musl C library](https://musl.libc.org/) or
10`gnu` for the GNU C library.
1311
1412A specific GNU C library version can be chosen with an appropriate
1513`-target`. For example, `-target native-native-gnu.2.19` will use the
......@@ -30,7 +28,7 @@ do not reference an actual implementation.
3028## Targets
3129
3230The GNU C Library supports a very wide set of platforms and architectures.
33The current Zig support for glibc only supports Linux.
31The current Zig support for glibc only includes Linux.
3432
3533Zig supports glibc versions back to v2.17 (2012) as the Zig standard
3634library depends on symbols that were introduced in 2.17.
......@@ -58,7 +56,7 @@ family of functions).
5856
5957The related Zig https://github.com/ziglang/universal-headers is a project
6058designed to more robustly build multi-version header files suitable for
61compliation across a variety of target C library versions.
59compilation across a variety of target C library versions.
6260
6361## Glibc static C-Runtime object files and libraries
6462
src/target.zig+1-1
......@@ -164,7 +164,7 @@ pub fn canBuildLibC(target: std.Target) bool {
164164 return ver.min.order(libc.os_ver.?) != .lt;
165165 }
166166 // Ensure glibc (aka *-linux-gnu) version is supported
167 if ((target.os.tag == .linux) and target.abi.isGnu()) {
167 if (target.isGnuLibC()) {
168168 const min_glibc_ver = libc.glibc_min orelse glibc_min_version;
169169 const target_glibc_ver = target.os.version_range.linux.glibc;
170170 return target_glibc_ver.order(min_glibc_ver) != .lt;