Skip to content

Commit 2961464

Browse files
committed
Change the implementation of supports_parallel to signal tha cg_gcc is not thread safe.
1 parent b7091ec commit 2961464

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/lib.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,10 @@ fn new_context<'gcc, 'tcx>(tcx: TyCtxt<'tcx>) -> Context<'gcc> {
289289
}
290290

291291
impl ExtraBackendMethods for GccCodegenBackend {
292+
fn supports_parallel(&self) -> bool {
293+
false
294+
}
295+
292296
fn codegen_allocator(
293297
&self,
294298
tcx: TyCtxt<'_>,
@@ -357,8 +361,7 @@ impl Deref for SyncContext {
357361
}
358362

359363
unsafe impl Send for SyncContext {}
360-
// FIXME(antoyo): that shouldn't be Sync. Parallel compilation is currently disabled with "-Zno-parallel-llvm".
361-
// TODO: disable it here by returning false in CodegenBackend::supports_parallel().
364+
// FIXME(antoyo): that shouldn't be Sync. Parallel compilation is currently disabled with "CodegenBackend::supports_parallel()".
362365
unsafe impl Sync for SyncContext {}
363366

364367
impl WriteBackendMethods for GccCodegenBackend {

0 commit comments

Comments
 (0)