aboutsummaryrefslogtreecommitdiff
path: root/src/main.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2020-11-30 16:40:25 -0700
committerAndrew Kelley <andrew@ziglang.org>2020-11-30 16:40:25 -0700
commit205af5b14828d64c10f5c67e05cebf32b882c646 (patch)
treea76c48fca7b7458f41c4dca14f9ec9eb30325818 /src/main.zig
parent51d7c14ce1bdadc4405474cfb3945581c198c741 (diff)
parentff9798eb265b02d572ecbced675efcd7c763aea9 (diff)
downloadzig-205af5b14828d64c10f5c67e05cebf32b882c646.tar.gz
zig-205af5b14828d64c10f5c67e05cebf32b882c646.zip
Merge branch 'alexnask-bundle_compiler_rt' into master
Closes #7013 Closes #6817
Diffstat (limited to 'src/main.zig')
-rw-r--r--src/main.zig8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/main.zig b/src/main.zig
index ee36a25220..5e406152d3 100644
--- a/src/main.zig
+++ b/src/main.zig
@@ -314,6 +314,8 @@ const usage_build_generic =
\\ -fno-soname (Linux) Disable emitting a SONAME
\\ -fLLD Force using LLD as the linker
\\ -fno-LLD Prevent using LLD as the linker
+ \\ -fcompiler-rt Always include compiler-rt symbols in output
+ \\ -fno-compiler-rt Prevent including compiler-rt symbols in output
\\ -rdynamic Add all symbols to the dynamic symbol table
\\ -rpath [path] Add directory to the runtime library search path
\\ -feach-lib-rpath Ensure adding rpath for each used dynamic library
@@ -478,6 +480,7 @@ fn buildOutputType(
var want_sanitize_c: ?bool = null;
var want_stack_check: ?bool = null;
var want_valgrind: ?bool = null;
+ var want_compiler_rt: ?bool = null;
var rdynamic: bool = false;
var linker_script: ?[]const u8 = null;
var version_script: ?[]const u8 = null;
@@ -794,6 +797,10 @@ fn buildOutputType(
if (i + 1 >= args.len) fatal("expected parameter after {}", .{arg});
i += 1;
override_lib_dir = args[i];
+ } else if (mem.eql(u8, arg, "-fcompiler-rt")) {
+ want_compiler_rt = true;
+ } else if (mem.eql(u8, arg, "-fno-compiler-rt")) {
+ want_compiler_rt = false;
} else if (mem.eql(u8, arg, "-feach-lib-rpath")) {
each_lib_rpath = true;
} else if (mem.eql(u8, arg, "-fno-each-lib-rpath")) {
@@ -1688,6 +1695,7 @@ fn buildOutputType(
.want_sanitize_c = want_sanitize_c,
.want_stack_check = want_stack_check,
.want_valgrind = want_valgrind,
+ .want_compiler_rt = want_compiler_rt,
.use_llvm = use_llvm,
.use_lld = use_lld,
.use_clang = use_clang,