aboutsummaryrefslogtreecommitdiff
path: root/lib/std
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2021-03-22 23:34:37 +1100
committerIsaac Freund <ifreund@ifreund.xyz>2021-04-16 22:51:51 +0200
commit99e7ba24b17d9b0a948c8fd01904d3597b5d4f84 (patch)
tree2fa6f400a62eff48fe202bb6582d6b409a5c6315 /lib/std
parent0e687d125bac2b0a282c01c39963ad22426b8147 (diff)
downloadzig-99e7ba24b17d9b0a948c8fd01904d3597b5d4f84.tar.gz
zig-99e7ba24b17d9b0a948c8fd01904d3597b5d4f84.zip
Add LibExeObjStep.linker_allow_shlib_undefined field to set --allow-shlib-undefined
Diffstat (limited to 'lib/std')
-rw-r--r--lib/std/build.zig5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/std/build.zig b/lib/std/build.zig
index 05871efba8..fa7fb9f018 100644
--- a/lib/std/build.zig
+++ b/lib/std/build.zig
@@ -1386,6 +1386,8 @@ pub const LibExeObjStep = struct {
/// safely garbage-collected during the linking phase.
link_function_sections: bool = false,
+ linker_allow_shlib_undefined: ?bool = null,
+
/// Uses system Wine installation to run cross compiled Windows build artifacts.
enable_wine: bool = false,
@@ -2338,6 +2340,9 @@ pub const LibExeObjStep = struct {
if (self.link_function_sections) {
try zig_args.append("-ffunction-sections");
}
+ if (self.linker_allow_shlib_undefined) |x| {
+ try zig_args.append(if (x) "--allow-shlib-undefined" else "--no-allow-shlib-undefined");
+ }
if (self.single_threaded) {
try zig_args.append("--single-threaded");
}