diff options
Diffstat (limited to 'src/link.zig')
| -rw-r--r-- | src/link.zig | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/link.zig b/src/link.zig index 9edba50123..6e5921d815 100644 --- a/src/link.zig +++ b/src/link.zig @@ -26,7 +26,11 @@ const TypedValue = @import("TypedValue.zig"); pub const SystemLib = struct { needed: bool, weak: bool, - path: []const u8, + /// This can be null in two cases right now: + /// 1. Windows DLLs that zig ships such as advapi32. + /// 2. extern "foo" fn declarations where we find out about libraries too late + /// TODO: make this non-optional and resolve those two cases somehow. + path: ?[]const u8, }; /// When adding a new field, remember to update `hashAddFrameworks`. @@ -48,7 +52,7 @@ pub fn hashAddSystemLibs( for (hm.values()) |value| { man.hash.add(value.needed); man.hash.add(value.weak); - _ = try man.addFile(value.path, null); + if (value.path) |p| _ = try man.addFile(p, null); } } |
