[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
This commit is contained in:
Motiejus Jakštys 2022-06-23 08:52:35 +03:00 committed by Andrew Kelley
parent b1b944a683
commit 705e9cb3ca

View File

@ -1619,6 +1619,10 @@ fn buildOutputType(
build_id = true;
warn("ignoring build-id style argument: '{s}'", .{value});
continue;
} else if (mem.eql(u8, key, "--sort-common")) {
// this ignores --sort=common=<anything>; ignoring plain --sort-common
// is done below.
continue;
}
try linker_args.append(key);
try linker_args.append(value);
@ -1631,6 +1635,9 @@ fn buildOutputType(
needed = true;
} else if (mem.eql(u8, linker_arg, "-no-pie")) {
want_pie = false;
} else if (mem.eql(u8, linker_arg, "--sort-common")) {
// from ld.lld(1): --sort-common is ignored for GNU compatibility,
// this ignores plain --sort-common
} else if (mem.eql(u8, linker_arg, "--whole-archive") or
mem.eql(u8, linker_arg, "-whole-archive"))
{