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