| ... | ... | @@ -1643,20 +1643,19 @@ fn linkWithLLD(self: *Elf, comp: *Compilation) !void { |
| 1643 | 1643 | if (self.base.options.link_libcpp) { |
| 1644 | 1644 | try argv.append(comp.libcxxabi_static_lib.?.full_object_path); |
| 1645 | 1645 | try argv.append(comp.libcxx_static_lib.?.full_object_path); |
| 1646 | if (target_util.libcNeedsLibUnwind(target)) { |
| 1647 | try argv.append(comp.libunwind_static_lib.?.full_object_path); |
| 1648 | } |
| 1646 | 1649 | } |
| 1647 | 1650 | |
| 1648 | 1651 | // libc dep |
| 1649 | 1652 | if (self.base.options.link_libc) { |
| 1650 | 1653 | if (self.base.options.libc_installation != null) { |
| 1651 | | if (target_util.libcNeedsLibUnwind(target)) { |
| 1652 | | try argv.append(comp.libunwind_static_lib.?.full_object_path); |
| 1653 | | } |
| 1654 | 1654 | const needs_grouping = self.base.options.link_mode == .Static; |
| 1655 | 1655 | if (needs_grouping) try argv.append("--start-group"); |
| 1656 | 1656 | try argv.appendSlice(target_util.libcFullLinkFlags(target)); |
| 1657 | 1657 | if (needs_grouping) try argv.append("--end-group"); |
| 1658 | 1658 | } else if (target.isGnuLibC()) { |
| 1659 | | try argv.append(comp.libunwind_static_lib.?.full_object_path); |
| 1660 | 1659 | for (glibc.libs) |lib| { |
| 1661 | 1660 | const lib_path = try std.fmt.allocPrint(arena, "{s}{c}lib{s}.so.{d}", .{ |
| 1662 | 1661 | comp.glibc_so_files.?.dir_path, fs.path.sep, lib.name, lib.sover, |
| ... | ... | @@ -1665,13 +1664,10 @@ fn linkWithLLD(self: *Elf, comp: *Compilation) !void { |
| 1665 | 1664 | } |
| 1666 | 1665 | try argv.append(try comp.get_libc_crt_file(arena, "libc_nonshared.a")); |
| 1667 | 1666 | } else if (target.isMusl()) { |
| 1668 | | try argv.append(comp.libunwind_static_lib.?.full_object_path); |
| 1669 | 1667 | try argv.append(try comp.get_libc_crt_file(arena, switch (self.base.options.link_mode) { |
| 1670 | 1668 | .Static => "libc.a", |
| 1671 | 1669 | .Dynamic => "libc.so", |
| 1672 | 1670 | })); |
| 1673 | | } else if (self.base.options.link_libcpp) { |
| 1674 | | try argv.append(comp.libunwind_static_lib.?.full_object_path); |
| 1675 | 1671 | } else { |
| 1676 | 1672 | unreachable; // Compiler was supposed to emit an error for not being able to provide libc. |
| 1677 | 1673 | } |