diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2024-12-23 18:29:16 -0800 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2025-01-15 15:11:36 -0800 |
| commit | aebccb06e774107d18c4259eafbf5eb3c642237a (patch) | |
| tree | c39e9e4a53bf0b2764fa39443b873c3c35f36a31 /src | |
| parent | 1a4c5837fedcad57f6c81301672e6246e0f0a8c1 (diff) | |
| download | zig-aebccb06e774107d18c4259eafbf5eb3c642237a.tar.gz zig-aebccb06e774107d18c4259eafbf5eb3c642237a.zip | |
fix missing missing entry symbol error when no zcu
Diffstat (limited to 'src')
| -rw-r--r-- | src/link/Wasm/Flush.zig | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/link/Wasm/Flush.zig b/src/link/Wasm/Flush.zig index f4a9ffeb73..21a5919010 100644 --- a/src/link/Wasm/Flush.zig +++ b/src/link/Wasm/Flush.zig @@ -69,6 +69,8 @@ pub fn finish(f: *Flush, wasm: *Wasm) !void { const is_obj = comp.config.output_mode == .Obj; const allow_undefined = is_obj or wasm.import_symbols; + const entry_name = if (wasm.entry_resolution.isNavOrUnresolved(wasm)) wasm.entry_name else .none; + if (comp.zcu) |zcu| { const ip: *const InternPool = &zcu.intern_pool; // No mutations allowed! @@ -88,8 +90,6 @@ pub fn finish(f: *Flush, wasm: *Wasm) !void { } } - const entry_name = if (wasm.entry_resolution.isNavOrUnresolved(wasm)) wasm.entry_name else .none; - for (wasm.nav_exports.keys()) |*nav_export| { if (ip.isFunctionType(ip.getNav(nav_export.nav_index).typeOf(ip))) { 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 { for (f.missing_exports.keys()) |exp_name| { diags.addError("manually specified export name '{s}' undefined", .{exp_name.slice(wasm)}); } + } - if (entry_name.unwrap()) |name| { - if (wasm.entry_resolution == .unresolved) { - var err = try diags.addErrorWithNotes(1); - try err.addMsg("entry symbol '{s}' missing", .{name.slice(wasm)}); - err.addNote("'-fno-entry' suppresses this error", .{}); - } + if (entry_name.unwrap()) |name| { + if (wasm.entry_resolution == .unresolved) { + var err = try diags.addErrorWithNotes(1); + try err.addMsg("entry symbol '{s}' missing", .{name.slice(wasm)}); + err.addNote("'-fno-entry' suppresses this error", .{}); } } |
