mirror of
https://github.com/ziglang/zig.git
synced 2026-02-06 06:27:05 +00:00
Merge pull request #11954 from ziglang/fixes-weak-l
macho: weak libraries and frameworks fixes
This commit is contained in:
commit
bb3e1bcf31
@ -4867,8 +4867,22 @@ flagpd1("version"),
|
||||
.psl = false,
|
||||
},
|
||||
flagpd1("w"),
|
||||
sepd1("weak_framework"),
|
||||
sepd1("weak_library"),
|
||||
.{
|
||||
.name = "weak_framework",
|
||||
.syntax = .separate,
|
||||
.zig_equivalent = .weak_framework,
|
||||
.pd1 = true,
|
||||
.pd2 = false,
|
||||
.psl = false,
|
||||
},
|
||||
.{
|
||||
.name = "weak_library",
|
||||
.syntax = .separate,
|
||||
.zig_equivalent = .weak_library,
|
||||
.pd1 = true,
|
||||
.pd2 = false,
|
||||
.psl = false,
|
||||
},
|
||||
sepd1("weak_reference_mismatches"),
|
||||
flagpd1("whatsloaded"),
|
||||
flagpd1("why_load"),
|
||||
@ -6200,7 +6214,14 @@ jspd1("iquote"),
|
||||
.pd2 = true,
|
||||
.psl = false,
|
||||
},
|
||||
joinpd1("weak-l"),
|
||||
.{
|
||||
.name = "weak-l",
|
||||
.syntax = .joined,
|
||||
.zig_equivalent = .weak_library,
|
||||
.pd1 = true,
|
||||
.pd2 = false,
|
||||
.psl = false,
|
||||
},
|
||||
.{
|
||||
.name = "Ofast",
|
||||
.syntax = .flag,
|
||||
|
||||
@ -19,6 +19,7 @@ const Package = @import("Package.zig");
|
||||
const Type = @import("type.zig").Type;
|
||||
const TypedValue = @import("TypedValue.zig");
|
||||
|
||||
/// When adding a new field, remember to update `hashAddSystemLibs`.
|
||||
pub const SystemLib = struct {
|
||||
needed: bool = false,
|
||||
weak: bool = false,
|
||||
@ -35,6 +36,7 @@ pub fn hashAddSystemLibs(
|
||||
hh.addListOfBytes(keys);
|
||||
for (hm.values()) |value| {
|
||||
hh.add(value.needed);
|
||||
hh.add(value.weak);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1625,6 +1625,8 @@ fn buildOutputType(
|
||||
.entry => {
|
||||
entry = it.only_arg;
|
||||
},
|
||||
.weak_library => try system_libs.put(it.only_arg, .{ .weak = true }),
|
||||
.weak_framework => try frameworks.put(gpa, it.only_arg, .{ .weak = true }),
|
||||
}
|
||||
}
|
||||
// Parse linker args.
|
||||
@ -4577,6 +4579,8 @@ pub const ClangArgIterator = struct {
|
||||
emit_llvm,
|
||||
sysroot,
|
||||
entry,
|
||||
weak_library,
|
||||
weak_framework,
|
||||
};
|
||||
|
||||
const Args = struct {
|
||||
|
||||
@ -432,6 +432,18 @@ const known_options = [_]KnownOpt{
|
||||
.name = "e",
|
||||
.ident = "entry",
|
||||
},
|
||||
.{
|
||||
.name = "weak-l",
|
||||
.ident = "weak_library",
|
||||
},
|
||||
.{
|
||||
.name = "weak_library",
|
||||
.ident = "weak_library",
|
||||
},
|
||||
.{
|
||||
.name = "weak_framework",
|
||||
.ident = "weak_framework",
|
||||
},
|
||||
};
|
||||
|
||||
const blacklisted_options = [_][]const u8{};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user