From 65bea514ae3860a5169d044d22ece7170c445bd3 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Sun, 11 Sep 2022 16:37:03 -0700 Subject: Compilation: handle system C compiler not found When linking libc and compiling natively, Zig tries to integrate with the system C compiler. However, this caused Zig to fail when no system C compiler is installed, despite the fact that Zig is perfectly capable of compiling & linking libc without one. This commit makes Zig fall back to using its own ability to provide libc in the case that no C compiler is installed. For glibc, it means sometimes getting the warning "zig cannot build new glibc version abc, providing instead xyz". Ideally, Zig would do some more validation about the system libraries being linked against, and report an error in case it could not provide the exact correct libc version of the system libraries (or that the system libraries themselves conflict with each other), however, I think it is fair to call that a separate enhancement. --- lib/std/child_process.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/std') diff --git a/lib/std/child_process.zig b/lib/std/child_process.zig index fb521eb784..f1604bb86c 100644 --- a/lib/std/child_process.zig +++ b/lib/std/child_process.zig @@ -508,7 +508,7 @@ pub const ChildProcess = struct { // it, that's the error code returned by the child process. _ = std.os.poll(&fd, 0) catch unreachable; - // According to eventfd(2) the descriptro is readable if the counter + // According to eventfd(2) the descriptor is readable if the counter // has a value greater than 0 if ((fd[0].revents & std.os.POLL.IN) != 0) { const err_int = try readIntFd(err_pipe[0]); -- cgit v1.2.3