aboutsummaryrefslogtreecommitdiff
path: root/src/Compilation.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/Compilation.zig')
-rw-r--r--src/Compilation.zig8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig
index 03d7962ccc..353a2f1ca3 100644
--- a/src/Compilation.zig
+++ b/src/Compilation.zig
@@ -1165,9 +1165,6 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation {
break :blk false;
} else if (options.c_source_files.len == 0) {
break :blk false;
- } else if (options.target.os.tag == .windows and link_libcpp) {
- // https://github.com/ziglang/zig/issues/8531
- break :blk false;
} else if (options.target.cpu.arch.isRISCV()) {
// Clang and LLVM currently don't support RISC-V target-abi for LTO.
// Compiling with LTO may fail or produce undesired results.
@@ -1793,6 +1790,7 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation {
.headerpad_size = options.headerpad_size,
.headerpad_max_install_names = options.headerpad_max_install_names,
.dead_strip_dylibs = options.dead_strip_dylibs,
+ .force_undefined_symbols = .{},
});
errdefer bin_file.destroy();
comp.* = .{
@@ -1943,6 +1941,10 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation {
for (mingw.always_link_libs) |name| {
try comp.bin_file.options.system_libs.put(comp.gpa, name, .{});
}
+
+ // LLD might drop some symbols as unused during LTO and GCing, therefore,
+ // we force mark them for resolution here.
+ try comp.bin_file.options.force_undefined_symbols.put(comp.gpa, "_tls_index", {});
}
// Generate Windows import libs.
if (target.os.tag == .windows) {