]> git.lizzy.rs Git - rust.git/blobdiff - src/lib.rs
Rollup merge of #90796 - Amanieu:remove_reg_thumb, r=joshtriplett
[rust.git] / src / lib.rs
index 3c3a3568228c6ad4a6907f585d3a010a9707eb60..a549bcbd931069fd1d06d6591043e0a2cc008396 100644 (file)
@@ -22,7 +22,6 @@
 extern crate rustc_span;
 extern crate rustc_symbol_mangling;
 extern crate rustc_target;
-extern crate snap;
 
 // This prevents duplicating functions and statics that are already part of the host rustc process.
 #[allow(unused_extern_crates)]
 use rustc_codegen_ssa::traits::{CodegenBackend, ExtraBackendMethods, ModuleBufferMethods, ThinBufferMethods, WriteBackendMethods};
 use rustc_data_structures::fx::FxHashMap;
 use rustc_errors::{ErrorReported, Handler};
+use rustc_metadata::EncodedMetadata;
 use rustc_middle::dep_graph::{WorkProduct, WorkProductId};
-use rustc_middle::middle::cstore::EncodedMetadata;
 use rustc_middle::ty::TyCtxt;
-use rustc_session::config::{CrateType, Lto, OptLevel, OutputFilenames};
+use rustc_session::config::{Lto, OptLevel, OutputFilenames};
 use rustc_session::Session;
 use rustc_span::Symbol;
 use rustc_span::fatal_error::FatalError;
@@ -106,16 +105,8 @@ fn join_codegen(&self, ongoing_codegen: Box<dyn Any>, sess: &Session) -> Result<
         Ok((codegen_results, work_products))
     }
 
-    fn link(&self, sess: &Session, mut codegen_results: CodegenResults, outputs: &OutputFilenames) -> Result<(), ErrorReported> {
+    fn link(&self, sess: &Session, codegen_results: CodegenResults, outputs: &OutputFilenames) -> Result<(), ErrorReported> {
         use rustc_codegen_ssa::back::link::link_binary;
-        if let Some(symbols) = codegen_results.crate_info.exported_symbols.get_mut(&CrateType::Dylib) {
-            // TODO:(antoyo): remove when global initializer work without calling a function at runtime.
-            // HACK: since this codegen add some symbols (e.g. __gccGlobalCrateInit) and the UI
-            // tests load libstd.so as a dynamic library, and rustc use a version-script to specify
-            // the symbols visibility, we add * to export all symbols.
-            // It seems other symbols from libstd/libcore are causing some issues here as well.
-            symbols.push("*".to_string());
-        }
 
         link_binary::<crate::archive::ArArchiveBuilder<'_>>(
             sess,
@@ -136,10 +127,6 @@ fn new_metadata<'tcx>(&self, _tcx: TyCtxt<'tcx>, _mod_name: &str) -> Self::Modul
         }
     }
 
-    fn write_compressed_metadata<'tcx>(&self, tcx: TyCtxt<'tcx>, metadata: &EncodedMetadata, gcc_module: &mut Self::Module) {
-        base::write_compressed_metadata(tcx, metadata, gcc_module)
-    }
-
     fn codegen_allocator<'tcx>(&self, tcx: TyCtxt<'tcx>, mods: &mut Self::Module, module_name: &str, kind: AllocatorKind, has_alloc_error_handler: bool) {
         unsafe { allocator::codegen(tcx, mods, module_name, kind, has_alloc_error_handler) }
     }