authorgravatar for mail@isaacfreund.comIsaac Freund <mail@isaacfreund.com> 2021-05-11 15:27:43+02:00
committergravatar for mail@isaacfreund.comIsaac Freund <mail@isaacfreund.com> 2021-05-11 21:30:13+02:00
log3b2c9ef828cc97a4c4664324d93ddbe3696b17fb
treee131d81ff8c115f65075f949bf5b6299662b682c
parent01e30002c52eda1ab3574f55c2e0568c56f2ed09
signaturelock-open Commit is signed but in an unrecognized format.

stage2: link all libc components if using system libc


1 files changed, 9 insertions(+), 3 deletions(-)

src/link/Elf.zig+9-3
...@@ -1650,9 +1650,15 @@ fn linkWithLLD(self: *Elf, comp: *Compilation) !void {...@@ -1650,9 +1650,15 @@ fn linkWithLLD(self: *Elf, comp: *Compilation) !void {
1650 if (self.base.options.libc_installation != null) {1650 if (self.base.options.libc_installation != null) {
1651 const needs_grouping = self.base.options.link_mode == .Static;1651 const needs_grouping = self.base.options.link_mode == .Static;
1652 if (needs_grouping) try argv.append("--start-group");1652 if (needs_grouping) try argv.append("--start-group");
1653 try argv.append("-lm");1653 // This matches the order of glibc.libs
1654 try argv.append("-lpthread");1654 try argv.appendSlice(&[_][]const u8{
1655 try argv.append("-lc");1655 "-lm",
1656 "-lpthread",
1657 "-lc",
1658 "-ldl",
1659 "-lrt",
1660 "-lutil",
1661 });
1656 if (needs_grouping) try argv.append("--end-group");1662 if (needs_grouping) try argv.append("--end-group");
1657 } else if (target.isGnuLibC()) {1663 } else if (target.isGnuLibC()) {
1658 try argv.append(comp.libunwind_static_lib.?.full_object_path);1664 try argv.append(comp.libunwind_static_lib.?.full_object_path);