diff options
| author | Jakub Konka <kubkon@jakubkonka.com> | 2021-06-09 11:15:12 +0200 |
|---|---|---|
| committer | Jakub Konka <kubkon@jakubkonka.com> | 2021-06-09 11:15:12 +0200 |
| commit | 5fa5fba3ce57b128b37b371eb3daa8ca39221613 (patch) | |
| tree | 177ff2d1a4a011a47b320f6726bf9ddfd47a9005 /src/Compilation.zig | |
| parent | a6ae5a77dac6466617cdf57357aa79c2b79403b3 (diff) | |
| parent | 9f8de83d931f1f59ffa7010afc52a1bd54778447 (diff) | |
| download | zig-5fa5fba3ce57b128b37b371eb3daa8ca39221613.tar.gz zig-5fa5fba3ce57b128b37b371eb3daa8ca39221613.zip | |
Merge branch 'mathetake-cc-wasi-execmodel'
Diffstat (limited to 'src/Compilation.zig')
| -rw-r--r-- | src/Compilation.zig | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig index 371bcdaf18..5c75caa598 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -725,6 +725,8 @@ pub const InitOptions = struct { test_filter: ?[]const u8 = null, test_name_prefix: ?[]const u8 = null, subsystem: ?std.Target.SubSystem = null, + /// WASI-only. Type of WASI execution model ("command" or "reactor"). + wasi_exec_model: ?wasi_libc.CRTFile = null, }; fn addPackageTableToCacheHash( @@ -1340,6 +1342,7 @@ pub fn create(gpa: *Allocator, options: InitOptions) !*Compilation { .disable_lld_caching = options.disable_lld_caching, .subsystem = options.subsystem, .is_test = options.is_test, + .wasi_exec_model = options.wasi_exec_model, }); errdefer bin_file.destroy(); comp.* = .{ @@ -1441,9 +1444,8 @@ pub fn create(gpa: *Allocator, options: InitOptions) !*Compilation { .wasi_libc_crt_file = crt_file, }); } - // TODO add logic deciding which crt1 we want here. comp.work_queue.writeAssumeCapacity(&[_]Job{ - .{ .wasi_libc_crt_file = .crt1_o }, + .{ .wasi_libc_crt_file = comp.bin_file.options.wasi_exec_model orelse .crt1_o }, .{ .wasi_libc_crt_file = .libc_a }, }); } @@ -1868,7 +1870,7 @@ pub fn getAllErrorsAlloc(self: *Compilation) !AllErrors { for (keys[1..]) |key, i| { err_msg.notes[i] = .{ - .src_loc = key.nodeOffsetSrcLoc(values[i+1]), + .src_loc = key.nodeOffsetSrcLoc(values[i + 1]), .msg = "also here", }; } |
