| ... | ... | @@ -2240,8 +2240,8 @@ fn resolveLibInput( |
| 2240 | 2240 | } |
| 2241 | 2241 | |
| 2242 | 2242 | // In the case of OpenBSD, dynamic libraries are always versioned, without |
| 2243 | | // unversioned symlinks, so we need to look for the highest-versioned shared |
| 2244 | | // library. |
| 2243 | // unversioned symlinks. OpenBSD patches LLD to select the highest-versioned |
| 2244 | // shared library, and this code is intended to match that upstream behavior. |
| 2245 | 2245 | if (target.isOpenBSDLibC() and link_mode == .dynamic) versioned: { |
| 2246 | 2246 | const prefix = try std.fmt.allocPrint(arena, "lib{s}.so.", .{lib_name}); |
| 2247 | 2247 | |
| ... | ... | @@ -2251,11 +2251,8 @@ fn resolveLibInput( |
| 2251 | 2251 | }; |
| 2252 | 2252 | defer dir.close(io); |
| 2253 | 2253 | |
| 2254 | | var best_match_version = std.SemanticVersion{ |
| 2255 | | .major = 0, |
| 2256 | | .minor = 0, |
| 2257 | | .patch = 0, |
| 2258 | | }; |
| 2254 | var best_match_major: u32 = 0; |
| 2255 | var best_match_minor: u32 = 0; |
| 2259 | 2256 | var best_match: ?[]const u8 = null; |
| 2260 | 2257 | |
| 2261 | 2258 | var iter = dir.iterate(); |
| ... | ... | @@ -2270,12 +2267,12 @@ fn resolveLibInput( |
| 2270 | 2267 | const major_str = sit.next() orelse continue; |
| 2271 | 2268 | const minor_str = sit.next() orelse continue; |
| 2272 | 2269 | if (sit.next() != null) continue; |
| 2273 | | const major = std.fmt.parseInt(usize, major_str, 10) catch continue; |
| 2274 | | const minor = std.fmt.parseInt(usize, minor_str, 10) catch continue; |
| 2270 | const major = std.fmt.parseInt(u32, major_str, 10) catch continue; |
| 2271 | const minor = std.fmt.parseInt(u32, minor_str, 10) catch continue; |
| 2275 | 2272 | |
| 2276 | | if (major > best_match_version.major or (major == best_match_version.major and minor >= best_match_version.minor)) { |
| 2277 | | best_match_version.major = major; |
| 2278 | | best_match_version.minor = minor; |
| 2273 | if (major > best_match_major or (major == best_match_major and minor >= best_match_minor)) { |
| 2274 | best_match_major = major; |
| 2275 | best_match_minor = minor; |
| 2279 | 2276 | best_match = try arena.dupe(u8, entry.name); |
| 2280 | 2277 | } |
| 2281 | 2278 | } |