| ... | @@ -491,9 +491,21 @@ fn resolveSearchDir( | ... | @@ -491,9 +491,21 @@ fn resolveSearchDir( |
| 491 | ) !?[]const u8 { | 491 | ) !?[]const u8 { |
| 492 | var candidates = std.ArrayList([]const u8).init(arena); | 492 | var candidates = std.ArrayList([]const u8).init(arena); |
| 493 | | 493 | |
| 494 | if (!fs.path.isAbsolute(dir)) { | 494 | if (fs.path.isAbsolute(dir)) { |
| 495 | if (syslibroot) |root| { | 495 | if (syslibroot) |root| { |
| 496 | const full_path = try fs.path.join(arena, &[_][]const u8{ root, dir }); | 496 | const common_dir = if (std.Target.current.os.tag == .windows) blk: { |
| | 497 | // We need to check for disk designator and strip it out from dir path so |
| | 498 | // that we can concat dir with syslibroot. |
| | 499 | // TODO we should backport this mechanism to 'MachO.Dylib.parseDependentLibs()' |
| | 500 | const disk_designator = fs.path.diskDesignatorWindows(dir); |
| | 501 | |
| | 502 | if (mem.indexOf(u8, dir, disk_designator)) |where| { |
| | 503 | break :blk dir[where + disk_designator.len ..]; |
| | 504 | } |
| | 505 | |
| | 506 | break :blk dir; |
| | 507 | } else dir; |
| | 508 | const full_path = try fs.path.join(arena, &[_][]const u8{ root, common_dir }); |
| 497 | try candidates.append(full_path); | 509 | try candidates.append(full_path); |
| 498 | } | 510 | } |
| 499 | } | 511 | } |