mirror of
https://github.com/ziglang/zig.git
synced 2026-01-12 10:25:13 +00:00
macho: fix incorrectly erroring out with multiple sym definition
This commit is contained in:
parent
a32bc0e39c
commit
baceaf65f2
@ -2702,13 +2702,17 @@ pub fn updateDeclExports(
|
||||
|
||||
self.resolveGlobalSymbol(sym_loc) catch |err| switch (err) {
|
||||
error.MultipleSymbolDefinitions => {
|
||||
_ = try module.failed_exports.put(module.gpa, exp, try Module.ErrorMsg.create(
|
||||
gpa,
|
||||
decl.srcLoc(),
|
||||
\\LinkError: symbol '{s}' defined multiple times
|
||||
,
|
||||
.{exp_name},
|
||||
));
|
||||
// TODO: this needs rethinking
|
||||
const global = self.getGlobal(exp_name).?;
|
||||
if (sym_loc.sym_index != global.sym_index and global.file != null) {
|
||||
_ = try module.failed_exports.put(module.gpa, exp, try Module.ErrorMsg.create(
|
||||
gpa,
|
||||
decl.srcLoc(),
|
||||
\\LinkError: symbol '{s}' defined multiple times
|
||||
,
|
||||
.{exp_name},
|
||||
));
|
||||
}
|
||||
},
|
||||
else => |e| return e,
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user