authorgravatar for motiejus@jakstys.ltMotiejus Jakštys <motiejus@jakstys.lt> 2022-06-23 08:52:35+03:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-02-16 18:46:06-05:00
log705e9cb3caaa049336104662a833716757ffcb4a
tree6213bae4f2b49e3efe13c18a702c68beb84784a1
parentb1b944a683a2143584055468ca7958d298a9742b

[linker] ignore --sort-common

From ld.lld(1): --sort-common This option is ignored for GNU compatibility. Refs https://github.com/zigchroot/zig-chroot/issues/1

1 files changed, 7 insertions(+), 0 deletions(-)

src/main.zig+7
......@@ -1619,6 +1619,10 @@ fn buildOutputType(
16191619 build_id = true;
16201620 warn("ignoring build-id style argument: '{s}'", .{value});
16211621 continue;
1622 } else if (mem.eql(u8, key, "--sort-common")) {
1623 // this ignores --sort=common=<anything>; ignoring plain --sort-common
1624 // is done below.
1625 continue;
16221626 }
16231627 try linker_args.append(key);
16241628 try linker_args.append(value);
......@@ -1631,6 +1635,9 @@ fn buildOutputType(
16311635 needed = true;
16321636 } else if (mem.eql(u8, linker_arg, "-no-pie")) {
16331637 want_pie = false;
1638 } else if (mem.eql(u8, linker_arg, "--sort-common")) {
1639 // from ld.lld(1): --sort-common is ignored for GNU compatibility,
1640 // this ignores plain --sort-common
16341641 } else if (mem.eql(u8, linker_arg, "--whole-archive") or
16351642 mem.eql(u8, linker_arg, "-whole-archive"))
16361643 {