diff options
Diffstat (limited to 'meta/recipes-devtools/rust/files/hardcodepaths.patch')
-rw-r--r-- | meta/recipes-devtools/rust/files/hardcodepaths.patch | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/meta/recipes-devtools/rust/files/hardcodepaths.patch b/meta/recipes-devtools/rust/files/hardcodepaths.patch deleted file mode 100644 index a043095f62..0000000000 --- a/meta/recipes-devtools/rust/files/hardcodepaths.patch +++ /dev/null | |||
@@ -1,59 +0,0 @@ | |||
1 | When building for the target, some build paths end up embedded in the binaries. | ||
2 | These changes remove that. Further investigation is needed to work out the way | ||
3 | to resolve these issues properly upstream. | ||
4 | |||
5 | Upstream-Status: Inappropriate [patches need rework] | ||
6 | Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> | ||
7 | Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> | ||
8 | |||
9 | diff --git a/compiler/rustc_codegen_llvm/src/context.rs b/compiler/rustc_codegen_llvm/src/context.rs | ||
10 | index b4b2ab1e1f8a..8bb3e3f0557c 100644 | ||
11 | --- a/compiler/rustc_codegen_llvm/src/context.rs | ||
12 | +++ b/compiler/rustc_codegen_llvm/src/context.rs | ||
13 | @@ -158,46 +158,6 @@ pub unsafe fn create_module<'ll>( | ||
14 | } | ||
15 | } | ||
16 | |||
17 | - // Ensure the data-layout values hardcoded remain the defaults. | ||
18 | - if sess.target.is_builtin { | ||
19 | - // tm is disposed by its drop impl | ||
20 | - let tm = crate::back::write::create_informational_target_machine(tcx.sess); | ||
21 | - llvm::LLVMRustSetDataLayoutFromTargetMachine(llmod, &tm); | ||
22 | - | ||
23 | - let llvm_data_layout = llvm::LLVMGetDataLayoutStr(llmod); | ||
24 | - let llvm_data_layout = str::from_utf8(CStr::from_ptr(llvm_data_layout).to_bytes()) | ||
25 | - .expect("got a non-UTF8 data-layout from LLVM"); | ||
26 | - | ||
27 | - // Unfortunately LLVM target specs change over time, and right now we | ||
28 | - // don't have proper support to work with any more than one | ||
29 | - // `data_layout` than the one that is in the rust-lang/rust repo. If | ||
30 | - // this compiler is configured against a custom LLVM, we may have a | ||
31 | - // differing data layout, even though we should update our own to use | ||
32 | - // that one. | ||
33 | - // | ||
34 | - // As an interim hack, if CFG_LLVM_ROOT is not an empty string then we | ||
35 | - // disable this check entirely as we may be configured with something | ||
36 | - // that has a different target layout. | ||
37 | - // | ||
38 | - // Unsure if this will actually cause breakage when rustc is configured | ||
39 | - // as such. | ||
40 | - // | ||
41 | - // FIXME(#34960) | ||
42 | - let cfg_llvm_root = option_env!("CFG_LLVM_ROOT").unwrap_or(""); | ||
43 | - let custom_llvm_used = !cfg_llvm_root.trim().is_empty(); | ||
44 | - | ||
45 | - if !custom_llvm_used && target_data_layout != llvm_data_layout { | ||
46 | - bug!( | ||
47 | - "data-layout for target `{rustc_target}`, `{rustc_layout}`, \ | ||
48 | - differs from LLVM target's `{llvm_target}` default layout, `{llvm_layout}`", | ||
49 | - rustc_target = sess.opts.target_triple, | ||
50 | - rustc_layout = target_data_layout, | ||
51 | - llvm_target = sess.target.llvm_target, | ||
52 | - llvm_layout = llvm_data_layout | ||
53 | - ); | ||
54 | - } | ||
55 | - } | ||
56 | - | ||
57 | let data_layout = SmallCStr::new(&target_data_layout); | ||
58 | llvm::LLVMSetDataLayout(llmod, data_layout.as_ptr()); | ||
59 | |||