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 @@...@@ -33,7 +33,6 @@
33 * incremental compilation - implement detection of which source files changed33 * incremental compilation - implement detection of which source files changed
34 * improve the cache hash logic for c objects with respect to extra flags and file parameters34 * improve the cache hash logic for c objects with respect to extra flags and file parameters
35 * LLVM codegen backend: put a sub-arch in the triple in some cases35 * 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
37 * implement an LLVM backend for stage236 * implement an LLVM backend for stage2
38 * implement outputting dynamic libraries in self-hosted linker37 * implement outputting dynamic libraries in self-hosted linker
39 * implement outputting static libraries (archive files) in self-hosted linker38 * implement outputting static libraries (archive files) in self-hosted linker
src-self-hosted/main.zig+2-3
...@@ -1086,7 +1086,7 @@ pub fn buildOutputType(...@@ -1086,7 +1086,7 @@ pub fn buildOutputType(
1086 defer if (libc_installation) |*l| l.deinit(gpa);1086 defer if (libc_installation) |*l| l.deinit(gpa);
10871087
1088 if (libc_paths_file) |paths_file| {1088 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| {
1090 fatal("unable to parse libc paths file: {}", .{@errorName(err)});1090 fatal("unable to parse libc paths file: {}", .{@errorName(err)});
1091 };1091 };
1092 }1092 }
...@@ -1269,8 +1269,7 @@ pub fn cmdLibC(gpa: *Allocator, args: []const []const u8) !void {...@@ -1269,8 +1269,7 @@ pub fn cmdLibC(gpa: *Allocator, args: []const []const u8) !void {
1269 }1269 }
1270 }1270 }
1271 if (input_file) |libc_file| {1271 if (input_file) |libc_file| {
1272 const stderr = std.io.getStdErr().writer();1272 var libc = LibCInstallation.parse(gpa, libc_file) catch |err| {
1273 var libc = LibCInstallation.parse(gpa, libc_file, stderr) catch |err| {
1274 fatal("unable to parse libc file: {}", .{@errorName(err)});1273 fatal("unable to parse libc file: {}", .{@errorName(err)});
1275 };1274 };
1276 defer libc.deinit(gpa);1275 defer libc.deinit(gpa);
src-self-hosted/stage2.zig+2-2
...@@ -12,7 +12,7 @@ const ArrayListSentineled = std.ArrayListSentineled;...@@ -12,7 +12,7 @@ const ArrayListSentineled = std.ArrayListSentineled;
12const Target = std.Target;12const Target = std.Target;
13const CrossTarget = std.zig.CrossTarget;13const CrossTarget = std.zig.CrossTarget;
14const self_hosted_main = @import("main.zig");14const self_hosted_main = @import("main.zig");
15const DepTokenizer = @import("dep_tokenizer.zig").Tokenizer;15const DepTokenizer = @import("DepTokenizer.zig");
16const assert = std.debug.assert;16const assert = std.debug.assert;
17const LibCInstallation = @import("libc_installation.zig").LibCInstallation;17const LibCInstallation = @import("libc_installation.zig").LibCInstallation;
1818
...@@ -21,7 +21,7 @@ var stderr: fs.File.OutStream = undefined;...@@ -21,7 +21,7 @@ var stderr: fs.File.OutStream = undefined;
21var stdout: fs.File.OutStream = undefined;21var stdout: fs.File.OutStream = undefined;
2222
23comptime {23comptime {
24 _ = @import("dep_tokenizer.zig");24 _ = @import("DepTokenizer.zig");
25}25}
2626
27// ABI warning27// ABI warning