mirror of
https://github.com/ziglang/zig.git
synced 2024-11-26 23:22:44 +00:00
macho: fix various linker flags
fix drivers: zig {cc,c++} - `-dynamiclib` is an alias to `-shared` - associate `-dynamiclib` with zig `.shared` semantics fix drivers: zig {cc,c++,build-lib,build-exe} - use `-dynamic` for {exe,dylib} - for dylib this fixes a regression - for exe this replaces incorrect use of `-static`
This commit is contained in:
parent
27d07c6c4d
commit
a502c160cd
@ -2426,7 +2426,14 @@ flagpd1("dwarf-ext-refs"),
|
||||
sepd1("dylib_file"),
|
||||
flagpd1("dylinker"),
|
||||
flagpd1("dynamic"),
|
||||
flagpd1("dynamiclib"),
|
||||
.{
|
||||
.name = "dynamiclib",
|
||||
.syntax = .flag,
|
||||
.zig_equivalent = .shared,
|
||||
.pd1 = true,
|
||||
.pd2 = false,
|
||||
.psl = false,
|
||||
},
|
||||
flagpd1("emit-ast"),
|
||||
flagpd1("emit-codegen-only"),
|
||||
flagpd1("emit-header-module"),
|
||||
|
@ -644,9 +644,7 @@ fn linkWithLLD(self: *MachO, comp: *Compilation) !void {
|
||||
try argv.append("defs");
|
||||
}
|
||||
|
||||
if (is_dyn_lib) {
|
||||
try argv.append("-static");
|
||||
} else {
|
||||
if (is_exe_or_dyn_lib) {
|
||||
try argv.append("-dynamic");
|
||||
}
|
||||
|
||||
|
@ -332,6 +332,10 @@ const known_options = [_]KnownOpt{
|
||||
.name = "s",
|
||||
.ident = "strip",
|
||||
},
|
||||
.{
|
||||
.name = "dynamiclib",
|
||||
.ident = "shared",
|
||||
},
|
||||
};
|
||||
|
||||
const blacklisted_options = [_][]const u8{};
|
||||
|
Loading…
Reference in New Issue
Block a user