Skip to content

Commit 8b66395

Browse files
committed
increase add_buffer using
1 parent 19c3e8f commit 8b66395

File tree

1 file changed

+4
-5
lines changed
  • compiler/rustc_codegen_ssa/src/back

1 file changed

+4
-5
lines changed

Diff for: compiler/rustc_codegen_ssa/src/back/link.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use rustc_errors::{ErrorGuaranteed, Handler};
88
use rustc_fs_util::fix_windows_verbatim_for_gcc;
99
use rustc_hir::def_id::{CrateNum, LOCAL_CRATE};
1010
use rustc_metadata::find_native_static_library;
11-
use rustc_metadata::fs::{emit_wrapper_file, METADATA_FILENAME};
11+
use rustc_metadata::fs::METADATA_FILENAME;
1212
use rustc_middle::middle::dependency_format::Linkage;
1313
use rustc_middle::middle::exported_symbols::SymbolExportKind;
1414
use rustc_session::config::{self, CFGuard, CrateType, DebugInfo, LdImpl, Lto, Strip};
@@ -293,7 +293,6 @@ fn link_rlib<'a>(
293293
RlibFlavor::Normal => {
294294
let (metadata, metadata_position) =
295295
create_wrapper_file(sess, b".rmeta".to_vec(), codegen_results.metadata.raw_data());
296-
let metadata = emit_wrapper_file(sess, &metadata, tmpdir, METADATA_FILENAME);
297296
match metadata_position {
298297
MetadataPosition::First => {
299298
// Most of the time metadata in rlib files is wrapped in a "dummy" object
@@ -387,8 +386,8 @@ fn link_rlib<'a>(
387386
let src = read(lib_path)
388387
.map_err(|e| sess.emit_fatal(errors::ReadFileError { message: e }))?;
389388
let (data, _) = create_wrapper_file(sess, b".bundled_lib".to_vec(), &src);
390-
let wrapper_file = emit_wrapper_file(sess, &data, tmpdir, filename.as_str());
391-
packed_bundled_libs.push(wrapper_file);
389+
// let wrapper_file = emit_wrapper_file(sess, &data, tmpdir, filename.as_str());
390+
packed_bundled_libs.push((data, filename));
392391
continue;
393392
}
394393
ab.add_archive(&location, Box::new(|_| false)).unwrap_or_else(|error| {
@@ -446,7 +445,7 @@ fn link_rlib<'a>(
446445
// Add all bundled static native library dependencies.
447446
// Archives added to the end of .rlib archive, see comment above for the reason.
448447
for lib in packed_bundled_libs {
449-
ab.add_file(&lib)
448+
ab.add_buffer(lib.0, lib.1.as_str())
450449
}
451450

452451
return Ok(ab);

0 commit comments

Comments
 (0)