mirror of
https://github.com/ziglang/zig.git
synced 2026-02-03 13:13:40 +00:00
fix missing missing entry symbol error when no zcu
This commit is contained in:
parent
1a4c5837fe
commit
aebccb06e7
@ -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", .{});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user