diff options
| author | Motiejus Jakštys <motiejus@jakstys.lt> | 2022-06-23 08:52:35 +0300 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2023-02-16 18:46:06 -0500 |
| commit | 705e9cb3caaa049336104662a833716757ffcb4a (patch) | |
| tree | 6213bae4f2b49e3efe13c18a702c68beb84784a1 /src | |
| parent | b1b944a683a2143584055468ca7958d298a9742b (diff) | |
| download | zig-705e9cb3caaa049336104662a833716757ffcb4a.tar.gz zig-705e9cb3caaa049336104662a833716757ffcb4a.zip | |
[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
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.zig | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/main.zig b/src/main.zig index 07a8d8b9e7..fcb52e93e9 100644 --- a/src/main.zig +++ b/src/main.zig @@ -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")) { |
