diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2020-12-24 14:11:58 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2020-12-24 14:11:58 -0700 |
| commit | 6ab9268a9024fe8e9076f07cb207107d2cad0876 (patch) | |
| tree | 64269aabb1a50ba35b9ac0951d9c365d2916be2e /src/mingw.zig | |
| parent | 894434988d96f3246e0525000f281563c1febb73 (diff) | |
| download | zig-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/mingw.zig')
| -rw-r--r-- | src/mingw.zig | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/src/mingw.zig b/src/mingw.zig index 8c819627ba..a9e275434f 100644 --- a/src/mingw.zig +++ b/src/mingw.zig @@ -91,8 +91,6 @@ pub fn buildCRTFile(comp: *Compilation, crt_file: CRTFile) !void { "-D_CRTBLD", "-D_WIN32_WINNT=0x0f00", "-D__MSVCRT_VERSION__=0x700", - "-g", - "-O2", }); c_source_files[i] = .{ .src_path = try comp.zig_lib_directory.join(arena, &[_][]const u8{ @@ -119,9 +117,6 @@ pub fn buildCRTFile(comp: *Compilation, crt_file: CRTFile) !void { "-isystem", try comp.zig_lib_directory.join(arena, &[_][]const u8{ "libc", "include", "any-windows-any" }), - - "-g", - "-O2", }); var c_source_files = std.ArrayList(Compilation.CSourceFile).init(arena); @@ -167,8 +162,6 @@ pub fn buildCRTFile(comp: *Compilation, crt_file: CRTFile) !void { "-D_CRTBLD", "-D_WIN32_WINNT=0x0f00", "-D__MSVCRT_VERSION__=0x700", - "-g", - "-O2", "-isystem", try comp.zig_lib_directory.join(arena, &[_][]const u8{ "libc", "include", "any-windows-any" }), @@ -233,8 +226,6 @@ pub fn buildCRTFile(comp: *Compilation, crt_file: CRTFile) !void { "-D_CRTBLD", "-D_WIN32_WINNT=0x0f00", "-D__MSVCRT_VERSION__=0x700", - "-g", - "-O2", "-isystem", try comp.zig_lib_directory.join(arena, &[_][]const u8{ |
