When building for the target, some build paths end up embedded in the binaries. These changes remove that. Further investigation is needed to work out the way to resolve these issues properly upstream. Upstream-Status: Inappropriate [patches need rework] Signed-off-by: Richard Purdie Signed-off-by: Alex Kiernan diff --git a/compiler/rustc_codegen_llvm/src/context.rs b/compiler/rustc_codegen_llvm/src/context.rs index b4b2ab1e1f8a..8bb3e3f0557c 100644 --- a/compiler/rustc_codegen_llvm/src/context.rs +++ b/compiler/rustc_codegen_llvm/src/context.rs @@ -34,7 +34,6 @@ use smallvec::SmallVec; use libc::c_uint; -use std::borrow::Borrow; use std::cell::{Cell, RefCell}; use std::ffi::CStr; use std::str; @@ -155,25 +154,6 @@ } } - // Ensure the data-layout values hardcoded remain the defaults. - { - let tm = crate::back::write::create_informational_target_machine(tcx.sess); - llvm::LLVMRustSetDataLayoutFromTargetMachine(llmod, &tm); - - let llvm_data_layout = llvm::LLVMGetDataLayoutStr(llmod); - let llvm_data_layout = str::from_utf8(CStr::from_ptr(llvm_data_layout).to_bytes()) - .expect("got a non-UTF8 data-layout from LLVM"); - - if target_data_layout != llvm_data_layout { - tcx.dcx().emit_err(crate::errors::MismatchedDataLayout { - rustc_target: sess.opts.target_triple.to_string().as_str(), - rustc_layout: target_data_layout.as_str(), - llvm_target: sess.target.llvm_target.borrow(), - llvm_layout: llvm_data_layout, - }); - } - } - let data_layout = SmallCStr::new(&target_data_layout); llvm::LLVMSetDataLayout(llmod, data_layout.as_ptr());