aboutsummaryrefslogtreecommitdiff
path: root/src/target.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2023-12-11 21:16:49 -0700
committerAndrew Kelley <andrew@ziglang.org>2024-01-01 17:51:18 -0700
commit2bef0715c740024c515dce73d267ead5af49d1a9 (patch)
tree0fa39b660ea8f9478fdd04f59ad8a5ece042bce6 /src/target.zig
parent12de7e3472cb2292e75578d33a8b8cc91f1ef0b0 (diff)
downloadzig-2bef0715c740024c515dce73d267ead5af49d1a9.tar.gz
zig-2bef0715c740024c515dce73d267ead5af49d1a9.zip
move a large chunk of linker logic away from "options"
These options are only supposed to be provided to the initialization functions, resolved, and then computed values stored in the appropriate place (base struct or the object-format-specific structs). Many more to go...
Diffstat (limited to 'src/target.zig')
-rw-r--r--src/target.zig8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/target.zig b/src/target.zig
index f610e55fb0..04c25a5f0c 100644
--- a/src/target.zig
+++ b/src/target.zig
@@ -323,6 +323,14 @@ pub fn hasLlvmSupport(target: std.Target, ofmt: std.Target.ObjectFormat) bool {
};
}
+/// The set of targets that Zig supports using LLD to link for.
+pub fn hasLldSupport(ofmt: std.Target.ObjectFormat) bool {
+ return switch (ofmt) {
+ .elf, .coff, .wasm => true,
+ else => false,
+ };
+}
+
/// The set of targets that our own self-hosted backends have robust support for.
/// Used to select between LLVM backend and self-hosted backend when compiling in
/// debug mode. A given target should only return true here if it is passing greater