about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFractalFir <fractalfirdev@gmail.com>2025-07-08 21:36:05 +0200
committerFractalFir <fractalfirdev@gmail.com>2025-07-09 20:29:02 +0200
commit29614643e41b6d21e9fdb5d57bfab0d6319bea5b (patch)
tree3e0e2558b2eab11ac72275e1ee40c7a7239d526f
parentb7091eca6d8eb0fe88b58cc9a7aec405d8de5b85 (diff)
downloadrust-29614643e41b6d21e9fdb5d57bfab0d6319bea5b.tar.gz
rust-29614643e41b6d21e9fdb5d57bfab0d6319bea5b.zip
Change the implementation of supports_parallel to signal tha cg_gcc is not thread safe.
-rw-r--r--src/lib.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 45e81aea551..790e32a4bc6 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -289,6 +289,10 @@ fn new_context<'gcc, 'tcx>(tcx: TyCtxt<'tcx>) -> Context<'gcc> {
 }
 
 impl ExtraBackendMethods for GccCodegenBackend {
+    fn supports_parallel(&self) -> bool {
+        false
+    }
+
     fn codegen_allocator(
         &self,
         tcx: TyCtxt<'_>,
@@ -357,8 +361,7 @@ impl Deref for SyncContext {
 }
 
 unsafe impl Send for SyncContext {}
-// FIXME(antoyo): that shouldn't be Sync. Parallel compilation is currently disabled with "-Zno-parallel-llvm".
-// TODO: disable it here by returning false in CodegenBackend::supports_parallel().
+// FIXME(antoyo): that shouldn't be Sync. Parallel compilation is currently disabled with "CodegenBackend::supports_parallel()".
 unsafe impl Sync for SyncContext {}
 
 impl WriteBackendMethods for GccCodegenBackend {