aboutsummaryrefslogtreecommitdiff
path: root/src/mingw.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2021-11-15 16:32:15 -0700
committerAndrew Kelley <andrew@ziglang.org>2021-11-15 16:32:15 -0700
commit08c768ad82280463410eacc5b7f19389cb1ba49b (patch)
tree8dd79b588a3b7a20a8589a4fd08a11881a8ff35c /src/mingw.zig
parent564629f70475a1e3b397179067e22d3f61772104 (diff)
downloadzig-08c768ad82280463410eacc5b7f19389cb1ba49b.tar.gz
zig-08c768ad82280463410eacc5b7f19389cb1ba49b.zip
pre-merge cleanups
* Annotate workarounds with their corresponding GitHub issue links. * Enable test coverage for LTO on Windows with the added c_compiler test.
Diffstat (limited to 'src/mingw.zig')
-rw-r--r--src/mingw.zig6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mingw.zig b/src/mingw.zig
index b9d82ba784..8738bcbbcd 100644
--- a/src/mingw.zig
+++ b/src/mingw.zig
@@ -92,8 +92,10 @@ pub fn buildCRTFile(comp: *Compilation, crt_file: CRTFile) !void {
"-D_WIN32_WINNT=0x0f00",
"-D__MSVCRT_VERSION__=0x700",
});
- if (std.mem.eql(u8, dep, "tlssup.c")) {
- // Can't let LTO drop symbols defined in this file (eg: _tls_index)
+ if (std.mem.eql(u8, dep, "tlssup.c") and comp.bin_file.options.lto) {
+ // LLD will incorrectly drop the `_tls_index` symbol. Here we work
+ // around it by not using LTO for this one file.
+ // https://github.com/ziglang/zig/issues/8531
try args.append("-fno-lto");
}
c_source_files[i] = .{