mirror of
https://github.com/ziglang/zig.git
synced 2026-02-21 16:54:52 +00:00
build: workaround link error with LTO and mingw
The symbol "_tls_index" gets lost when using LTO. Disabling LTO on the object file that defines it allows the link to work. fixes https://github.com/ziglang/zig/issues/8531
This commit is contained in:
parent
353c19468d
commit
564629f704
@ -92,6 +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)
|
||||
try args.append("-fno-lto");
|
||||
}
|
||||
c_source_files[i] = .{
|
||||
.src_path = try comp.zig_lib_directory.join(arena, &[_][]const u8{
|
||||
"libc", "mingw", "crt", dep,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user