Skip to content

Commit 86f5318

Browse files
authored
Merge pull request #732 from FractalFir/thread_soundness_fix
Change the implementation of supports_parallel to signal tha cg_gcc is not thread safe.
2 parents 75a4fb9 + 2961464 commit 86f5318

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
@@ -277,6 +277,10 @@ fn new_context<'gcc, 'tcx>(tcx: TyCtxt<'tcx>) -> Context<'gcc> {
277277
}
278278

279279
impl ExtraBackendMethods for GccCodegenBackend {
280+
fn supports_parallel(&self) -> bool {
281+
false
282+
}
283+
280284
fn codegen_allocator(
281285
&self,
282286
tcx: TyCtxt<'_>,
@@ -345,8 +349,7 @@ impl Deref for SyncContext {
345349
}
346350

347351
unsafe impl Send for SyncContext {}
348-
// FIXME(antoyo): that shouldn't be Sync. Parallel compilation is currently disabled with "-Zno-parallel-llvm".
349-
// TODO: disable it here by returning false in CodegenBackend::supports_parallel().
352+
// FIXME(antoyo): that shouldn't be Sync. Parallel compilation is currently disabled with "CodegenBackend::supports_parallel()".
350353
unsafe impl Sync for SyncContext {}
351354

352355
impl WriteBackendMethods for GccCodegenBackend {

0 commit comments

Comments
 (0)