mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 14:23:09 +00:00
MachO: put system_libs into libs not positionals
Putting them in both causes collisions because the same lib ends up being linked in twice. Putting them in positionals instead of libs makes their properties about needed and weak being ignored.
This commit is contained in:
parent
2725c20a72
commit
9e50f96087
@ -3549,17 +3549,12 @@ pub fn linkWithZld(macho_file: *MachO, comp: *Compilation, prog_node: *std.Progr
|
|||||||
try positionals.append(comp.libcxx_static_lib.?.full_object_path);
|
try positionals.append(comp.libcxx_static_lib.?.full_object_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
|
||||||
// Add all system library paths to positionals.
|
|
||||||
const vals = options.system_libs.values();
|
|
||||||
try positionals.ensureUnusedCapacity(vals.len);
|
|
||||||
for (vals) |info| positionals.appendAssumeCapacity(info.path);
|
|
||||||
}
|
|
||||||
|
|
||||||
var libs = std.StringArrayHashMap(link.SystemLib).init(arena);
|
var libs = std.StringArrayHashMap(link.SystemLib).init(arena);
|
||||||
|
|
||||||
for (options.system_libs.values()) |v| {
|
{
|
||||||
try libs.put(v.path, v);
|
const vals = options.system_libs.values();
|
||||||
|
try libs.ensureUnusedCapacity(vals.len);
|
||||||
|
for (vals) |v| libs.putAssumeCapacity(v.path, v);
|
||||||
}
|
}
|
||||||
|
|
||||||
try MachO.resolveLibSystem(arena, comp, options.sysroot, target, options.lib_dirs, &libs);
|
try MachO.resolveLibSystem(arena, comp, options.sysroot, target, options.lib_dirs, &libs);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user