authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-09-15 18:08:29-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-09-15 18:08:52-07:00
logda0fde59b6ffde5d505f664aa27b728aa2b1cc2a
treedaf2d54be2deb02fb7e65e286236643700f4186e
parent16bd0c63b4a8b1313bc05cb32b31e5345e467db3

stage2: update to new LibCInstallation API


3 files changed, 4 insertions(+), 6 deletions(-)

BRANCH_TODO-1
......@@ -33,7 +33,6 @@
3333 * incremental compilation - implement detection of which source files changed
3434 * improve the cache hash logic for c objects with respect to extra flags and file parameters
3535 * LLVM codegen backend: put a sub-arch in the triple in some cases
36 * rework libc_installation.zig abstraction to use std.log instead of taking a stderr stream
3736 * implement an LLVM backend for stage2
3837 * implement outputting dynamic libraries in self-hosted linker
3938 * implement outputting static libraries (archive files) in self-hosted linker
src-self-hosted/main.zig+2-3
......@@ -1086,7 +1086,7 @@ pub fn buildOutputType(
10861086 defer if (libc_installation) |*l| l.deinit(gpa);
10871087
10881088 if (libc_paths_file) |paths_file| {
1089 libc_installation = LibCInstallation.parse(gpa, paths_file, io.getStdErr().writer()) catch |err| {
1089 libc_installation = LibCInstallation.parse(gpa, paths_file) catch |err| {
10901090 fatal("unable to parse libc paths file: {}", .{@errorName(err)});
10911091 };
10921092 }
......@@ -1269,8 +1269,7 @@ pub fn cmdLibC(gpa: *Allocator, args: []const []const u8) !void {
12691269 }
12701270 }
12711271 if (input_file) |libc_file| {
1272 const stderr = std.io.getStdErr().writer();
1273 var libc = LibCInstallation.parse(gpa, libc_file, stderr) catch |err| {
1272 var libc = LibCInstallation.parse(gpa, libc_file) catch |err| {
12741273 fatal("unable to parse libc file: {}", .{@errorName(err)});
12751274 };
12761275 defer libc.deinit(gpa);
src-self-hosted/stage2.zig+2-2
......@@ -12,7 +12,7 @@ const ArrayListSentineled = std.ArrayListSentineled;
1212const Target = std.Target;
1313const CrossTarget = std.zig.CrossTarget;
1414const self_hosted_main = @import("main.zig");
15const DepTokenizer = @import("dep_tokenizer.zig").Tokenizer;
15const DepTokenizer = @import("DepTokenizer.zig");
1616const assert = std.debug.assert;
1717const LibCInstallation = @import("libc_installation.zig").LibCInstallation;
1818
......@@ -21,7 +21,7 @@ var stderr: fs.File.OutStream = undefined;
2121var stdout: fs.File.OutStream = undefined;
2222
2323comptime {
24 _ = @import("dep_tokenizer.zig");
24 _ = @import("DepTokenizer.zig");
2525}
2626
2727// ABI warning