aboutsummaryrefslogtreecommitdiff
path: root/src/main.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2022-02-09 11:36:30 -0700
committerAndrew Kelley <andrew@ziglang.org>2022-02-09 11:38:33 -0700
commit2836cd5fbdcbb22b1e03c01005e0e09777c5475f (patch)
treee0410656d83b3ed802211e201902e4f0d08f917a /src/main.zig
parentdb56d74a3bc9c6240d24838753a7042ba91501a1 (diff)
downloadzig-2836cd5fbdcbb22b1e03c01005e0e09777c5475f.tar.gz
zig-2836cd5fbdcbb22b1e03c01005e0e09777c5475f.zip
CLI: ignore -lgcc_s when it is redundant with compiler-rt
For some projects, they can't help themselves, -lgcc_s ends up on the compiler command line even though it does not belong there. In Zig we know what -lgcc_s does. It's an alternative to compiler-rt. With this commit we emit a warning telling that it is unnecessary to put such thing on the command line, and happily ignore it, since we will fulfill the dependency with compiler-rt.
Diffstat (limited to 'src/main.zig')
-rw-r--r--src/main.zig5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main.zig b/src/main.zig
index 3f38fd1f78..75655d6a2a 100644
--- a/src/main.zig
+++ b/src/main.zig
@@ -2010,6 +2010,11 @@ fn buildOutputType(
_ = system_libs.orderedRemove(lib_name);
continue;
}
+ if (target_util.is_compiler_rt_lib_name(target_info.target, lib_name)) {
+ std.log.warn("ignoring superfluous library '{s}': this dependency is fulfilled instead by compiler-rt which zig unconditionally provides", .{lib_name});
+ _ = system_libs.orderedRemove(lib_name);
+ continue;
+ }
if (std.fs.path.isAbsolute(lib_name)) {
fatal("cannot use absolute path as a system library: {s}", .{lib_name});
}