Commit e798a3a779

Andrew Kelley <andrew@ziglang.org>
2022-06-17 05:51:15
compiler-rt: disable separate compilation units
1 parent 5cd548e
Changed files (2)
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);
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,