| ... | @@ -1551,16 +1551,18 @@ fn linkWithLLD(self: *Elf, comp: *Compilation) !void { | ... | @@ -1551,16 +1551,18 @@ fn linkWithLLD(self: *Elf, comp: *Compilation) !void { |
| 1551 | } | 1551 | } |
| 1552 | | 1552 | |
| 1553 | // Shared libraries. | 1553 | // Shared libraries. |
| 1554 | const system_libs = self.base.options.system_libs.items(); | 1554 | if (is_exe_or_dyn_lib) { |
| 1555 | try argv.ensureCapacity(argv.items.len + system_libs.len); | 1555 | const system_libs = self.base.options.system_libs.items(); |
| 1556 | for (system_libs) |entry| { | 1556 | try argv.ensureCapacity(argv.items.len + system_libs.len); |
| 1557 | const link_lib = entry.key; | 1557 | for (system_libs) |entry| { |
| 1558 | // By this time, we depend on these libs being dynamically linked libraries and not static libraries | 1558 | const link_lib = entry.key; |
| 1559 | // (the check for that needs to be earlier), but they could be full paths to .so files, in which | 1559 | // By this time, we depend on these libs being dynamically linked libraries and not static libraries |
| 1560 | // case we want to avoid prepending "-l". | 1560 | // (the check for that needs to be earlier), but they could be full paths to .so files, in which |
| 1561 | const ext = Compilation.classifyFileExt(link_lib); | 1561 | // case we want to avoid prepending "-l". |
| 1562 | const arg = if (ext == .shared_library) link_lib else try std.fmt.allocPrint(arena, "-l{}", .{link_lib}); | 1562 | const ext = Compilation.classifyFileExt(link_lib); |
| 1563 | argv.appendAssumeCapacity(arg); | 1563 | const arg = if (ext == .shared_library) link_lib else try std.fmt.allocPrint(arena, "-l{}", .{link_lib}); |
| | 1564 | argv.appendAssumeCapacity(arg); |
| | 1565 | } |
| 1564 | } | 1566 | } |
| 1565 | | 1567 | |
| 1566 | if (!is_obj) { | 1568 | if (!is_obj) { |