Skip to content

Commit 4796207

Browse files
committedDec 9, 2021
Use cg_ssa for creating the dylib metadata file
The new api was introduced in rust-lang/rust#91604
1 parent 95cfeb4 commit 4796207

File tree

3 files changed

+3
-78
lines changed

3 files changed

+3
-78
lines changed
 

‎src/driver/aot.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
use std::path::PathBuf;
55

66
use rustc_ast::{InlineAsmOptions, InlineAsmTemplatePiece};
7+
use rustc_codegen_ssa::back::metadata::create_compressed_metadata_file;
78
use rustc_codegen_ssa::{CodegenResults, CompiledModule, CrateInfo, ModuleKind};
89
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
910
use rustc_metadata::EncodedMetadata;
@@ -278,7 +279,8 @@ pub(crate) fn run_aot(
278279
let tmp_file =
279280
tcx.output_filenames(()).temp_path(OutputType::Metadata, Some(&metadata_cgu_name));
280281

281-
let obj = crate::metadata::new_metadata_object(tcx, &metadata_cgu_name, &metadata);
282+
let symbol_name = rustc_middle::middle::exported_symbols::metadata_symbol_name(tcx);
283+
let obj = create_compressed_metadata_file(tcx.sess, &metadata, &symbol_name);
282284

283285
if let Err(err) = std::fs::write(&tmp_file, obj) {
284286
tcx.sess.fatal(&format!("error writing metadata object file: {}", err));

‎src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ mod inline_asm;
6161
mod intrinsics;
6262
mod linkage;
6363
mod main_shim;
64-
mod metadata;
6564
mod num;
6665
mod optimize;
6766
mod pointer;

‎src/metadata.rs

-76
This file was deleted.

0 commit comments

Comments
 (0)