aboutsummaryrefslogtreecommitdiff
path: root/src/libunwind.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2020-12-24 14:11:58 -0700
committerAndrew Kelley <andrew@ziglang.org>2020-12-24 14:11:58 -0700
commit6ab9268a9024fe8e9076f07cb207107d2cad0876 (patch)
tree64269aabb1a50ba35b9ac0951d9c365d2916be2e /src/libunwind.zig
parent894434988d96f3246e0525000f281563c1febb73 (diff)
downloadzig-6ab9268a9024fe8e9076f07cb207107d2cad0876.tar.gz
zig-6ab9268a9024fe8e9076f07cb207107d2cad0876.zip
stage2: re-use compiler runtime libs across opt modes and strip flag
Previously Zig would need to recompile runtime libs if you changed the values of --strip or -O. Now, unless the `debug_compiler_runtime_libs` flag is set (which is currently not exposed to the CLI), Zig will always choose ReleaseFast or ReleaseSmall for compiler runtime libraries. When the main application chooses ReleaseFast or ReleaseSmall, that value is propagated to compiler runtime libraries. Otherwise a decision is made based on the target, which is currently ReleaseSmall for freestanding WebAssembly and ReleaseFast for everything else. Ultimately the purpose of this commit is to have Debug and ReleaseSafe builds of applications still get optimized builds of, e.g. libcxx and libunwind, as well as to spend less time unnecessarily rebuilding compiler runtime libraries.
Diffstat (limited to 'src/libunwind.zig')
-rw-r--r--src/libunwind.zig4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libunwind.zig b/src/libunwind.zig
index 057663a44b..7710b1aa77 100644
--- a/src/libunwind.zig
+++ b/src/libunwind.zig
@@ -104,7 +104,7 @@ pub fn buildStaticLib(comp: *Compilation) !void {
.thread_pool = comp.thread_pool,
.libc_installation = comp.bin_file.options.libc_installation,
.emit_bin = emit_bin,
- .optimize_mode = comp.bin_file.options.optimize_mode,
+ .optimize_mode = comp.compilerRtOptMode(),
.link_mode = link_mode,
.want_sanitize_c = false,
.want_stack_check = false,
@@ -113,7 +113,7 @@ pub fn buildStaticLib(comp: *Compilation) !void {
.want_pic = comp.bin_file.options.pic,
.want_pie = comp.bin_file.options.pie,
.emit_h = null,
- .strip = comp.bin_file.options.strip,
+ .strip = comp.compilerRtStrip(),
.is_native_os = comp.bin_file.options.is_native_os,
.is_native_abi = comp.bin_file.options.is_native_abi,
.self_exe_path = comp.self_exe_path,