| ... | @@ -69,6 +69,8 @@ pub fn finish(f: *Flush, wasm: *Wasm) !void { | ... | @@ -69,6 +69,8 @@ pub fn finish(f: *Flush, wasm: *Wasm) !void { |
| 69 | const is_obj = comp.config.output_mode == .Obj; | 69 | const is_obj = comp.config.output_mode == .Obj; |
| 70 | const allow_undefined = is_obj or wasm.import_symbols; | 70 | const allow_undefined = is_obj or wasm.import_symbols; |
| 71 | | 71 | |
| | 72 | const entry_name = if (wasm.entry_resolution.isNavOrUnresolved(wasm)) wasm.entry_name else .none; |
| | 73 | |
| 72 | if (comp.zcu) |zcu| { | 74 | if (comp.zcu) |zcu| { |
| 73 | const ip: *const InternPool = &zcu.intern_pool; // No mutations allowed! | 75 | const ip: *const InternPool = &zcu.intern_pool; // No mutations allowed! |
| 74 | | 76 | |
| ... | @@ -88,8 +90,6 @@ pub fn finish(f: *Flush, wasm: *Wasm) !void { | ... | @@ -88,8 +90,6 @@ pub fn finish(f: *Flush, wasm: *Wasm) !void { |
| 88 | } | 90 | } |
| 89 | } | 91 | } |
| 90 | | 92 | |
| 91 | const entry_name = if (wasm.entry_resolution.isNavOrUnresolved(wasm)) wasm.entry_name else .none; | | |
| 92 | | | |
| 93 | for (wasm.nav_exports.keys()) |*nav_export| { | 93 | for (wasm.nav_exports.keys()) |*nav_export| { |
| 94 | if (ip.isFunctionType(ip.getNav(nav_export.nav_index).typeOf(ip))) { | 94 | if (ip.isFunctionType(ip.getNav(nav_export.nav_index).typeOf(ip))) { |
| 95 | log.debug("flush export '{s}' nav={d}", .{ nav_export.name.slice(wasm), nav_export.nav_index }); | 95 | log.debug("flush export '{s}' nav={d}", .{ nav_export.name.slice(wasm), nav_export.nav_index }); |
| ... | @@ -115,13 +115,13 @@ pub fn finish(f: *Flush, wasm: *Wasm) !void { | ... | @@ -115,13 +115,13 @@ pub fn finish(f: *Flush, wasm: *Wasm) !void { |
| 115 | for (f.missing_exports.keys()) |exp_name| { | 115 | for (f.missing_exports.keys()) |exp_name| { |
| 116 | diags.addError("manually specified export name '{s}' undefined", .{exp_name.slice(wasm)}); | 116 | diags.addError("manually specified export name '{s}' undefined", .{exp_name.slice(wasm)}); |
| 117 | } | 117 | } |
| | 118 | } |
| 118 | | 119 | |
| 119 | if (entry_name.unwrap()) |name| { | 120 | if (entry_name.unwrap()) |name| { |
| 120 | if (wasm.entry_resolution == .unresolved) { | 121 | if (wasm.entry_resolution == .unresolved) { |
| 121 | var err = try diags.addErrorWithNotes(1); | 122 | var err = try diags.addErrorWithNotes(1); |
| 122 | try err.addMsg("entry symbol '{s}' missing", .{name.slice(wasm)}); | 123 | try err.addMsg("entry symbol '{s}' missing", .{name.slice(wasm)}); |
| 123 | err.addNote("'-fno-entry' suppresses this error", .{}); | 124 | err.addNote("'-fno-entry' suppresses this error", .{}); |
| 124 | } | | |
| 125 | } | 125 | } |
| 126 | } | 126 | } |
| 127 | | 127 | |