authorgravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2019-11-24 09:13:01+02:00
committergravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2019-11-24 10:24:47+02:00
log0cbf00a3ec3f6640556e39efaa6e936b0b42630b
treec0bc74564724f5aed82506e7fb991f6e99a746c0
parent010494d8af69ecbb14619ebab177c32a074b69e5
signaturelock-open Commit is signed but in an unrecognized format.

self hosted compiler: final small fixes to get it compiling


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

build.zig+4-1
......@@ -74,7 +74,7 @@ pub fn build(b: *Builder) !void {
7474 const skip_libc = b.option(bool, "skip-libc", "Main test suite skips tests that link libc") orelse false;
7575 const skip_self_hosted = b.option(bool, "skip-self-hosted", "Main test suite skips building self hosted compiler") orelse false;
7676 if (!skip_self_hosted and builtin.os == .linux) {
77 // TODO evented I/O other OS'spu
77 // TODO evented I/O other OS's
7878 test_step.dependOn(&exe.step);
7979 }
8080
......@@ -232,6 +232,9 @@ fn findLLVM(b: *Builder, llvm_config_exe: []const u8) !LibraryDep {
232232 if (fs.path.isAbsolute(lib_arg)) {
233233 try result.libs.append(lib_arg);
234234 } else {
235 if (mem.endsWith(u8, lib_arg, ".lib")) {
236 lib_arg = lib_arg[0 .. lib_arg.len - 4];
237 }
235238 try result.system_libs.append(lib_arg);
236239 }
237240 }
src-self-hosted/compilation.zig+3
......@@ -517,6 +517,9 @@ pub const Compilation = struct {
517517 comp.target_layout_str = llvm.CopyStringRepOfTargetData(comp.target_data_ref) orelse return error.OutOfMemory;
518518 defer llvm.DisposeMessage(comp.target_layout_str);
519519
520 comp.events = try allocator.create(event.Channel(Event));
521 defer allocator.destroy(comp.events);
522
520523 comp.events.init([0]Event{});
521524 defer comp.events.deinit();
522525
src-self-hosted/test.zig+7-3
......@@ -13,12 +13,16 @@ test "stage2" {
1313 // TODO provide a way to run tests in evented I/O mode
1414 if (!std.io.is_async) return error.SkipZigTest;
1515
16 // TODO https://github.com/ziglang/zig/issues/1364
17 // TODO https://github.com/ziglang/zig/issues/3117
18 if (true) return error.SkipZigTest;
19
1620 try ctx.init();
1721 defer ctx.deinit();
1822
1923 try @import("stage2_tests").addCases(&ctx);
2024
21 _ = async ctx.run();
25 try ctx.run();
2226}
2327
2428const file1 = "1.zig";
......@@ -61,8 +65,8 @@ pub const TestContext = struct {
6165 self.zig_compiler.deinit();
6266 }
6367
64 fn run(self: *TestContext) void {
65 std.event.Loop.instance.?.startCpuBoundOperation();
68 fn run(self: *TestContext) !void {
69 std.event.Loop.startCpuBoundOperation();
6670 self.any_err = self.group.wait();
6771 return self.any_err;
6872 }