diff options
| author | antoyo <antoyo@users.noreply.github.com> | 2025-07-09 15:28:37 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-09 15:28:37 -0400 |
| commit | 86f5318bbebd5c93c05d71e8b1448500cff7eb52 (patch) | |
| tree | 4411af77236bfaeb8d4c3813876d7c2240ed3231 | |
| parent | 75a4fb996a6b175919095c11b167b5a53eb2c7aa (diff) | |
| parent | 29614643e41b6d21e9fdb5d57bfab0d6319bea5b (diff) | |
| download | rust-86f5318bbebd5c93c05d71e8b1448500cff7eb52.tar.gz rust-86f5318bbebd5c93c05d71e8b1448500cff7eb52.zip | |
Merge pull request #732 from FractalFir/thread_soundness_fix
Change the implementation of supports_parallel to signal tha cg_gcc is not thread safe.
| -rw-r--r-- | src/lib.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/lib.rs b/src/lib.rs index a912678ef2a..bd8a82206b7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -277,6 +277,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<'_>, @@ -345,8 +349,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 { |
