From e798a3a7796892427ac4561839a35286108bbf6c Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Thu, 16 Jun 2022 20:51:15 -0700 Subject: [PATCH] compiler-rt: disable separate compilation units --- src/Compilation.zig | 4 +++- src/compiler_rt.zig | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Compilation.zig b/src/Compilation.zig index 65a2ad92b4..89e54b598f 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -2800,7 +2800,9 @@ pub fn performAllTheWork( if (comp.job_queued_compiler_rt_lib) { comp.job_queued_compiler_rt_lib = false; - if (use_stage1) { + // I have disabled the multi-threaded compiler-rt for now until + // the threading deadlock is resolved. + if (use_stage1 or true) { // stage1 LLVM backend uses the global context and thus cannot be used in // a multi-threaded context. buildCompilerRtOneShot(comp, .Lib, &comp.compiler_rt_lib); diff --git a/src/compiler_rt.zig b/src/compiler_rt.zig index 4e43f0be88..185ebf6b16 100644 --- a/src/compiler_rt.zig +++ b/src/compiler_rt.zig @@ -69,6 +69,7 @@ pub fn buildCompilerRtLib(comp: *Compilation, progress_node: *std.Progress.Node) .main_pkg = null, .output_mode = .Lib, .link_mode = .Static, + .function_sections = true, .thread_pool = comp.thread_pool, .libc_installation = comp.bin_file.options.libc_installation, .emit_bin = emit_bin, @@ -186,6 +187,7 @@ fn buildObject(comp: *Compilation, src_basename: []const u8, out: *?CRTFile) !vo .emit_bin = emit_bin, .optimize_mode = comp.compilerRtOptMode(), .link_mode = .Static, + .function_sections = true, .want_sanitize_c = false, .want_stack_check = false, .want_red_zone = comp.bin_file.options.red_zone,