59 lines
2.4 KiB
Diff
59 lines
2.4 KiB
Diff
From c6b54a373e74a1e4ce64f349b5b69105f2bc1a49 Mon Sep 17 00:00:00 2001
|
|
From: q66 <daniel@octaforge.org>
|
|
Date: Sun, 3 May 2020 18:08:09 +0200
|
|
Subject: [PATCH 15/15] Use ELFv2 ABI on all powerpc64 targets
|
|
|
|
This patches librustc_target so that ELFv2 is used everywhere, matching our
|
|
LLVM. While this is not perfect (it does not allow rustc to compile legacy
|
|
binaries), rustc never requests specific ABI from llvm in the first place,
|
|
so at least match the environment we have.
|
|
---
|
|
src/librustc_target/abi/call/powerpc64.rs | 9 +--------
|
|
src/librustc_target/spec/powerpc64_unknown_linux_gnu.rs | 6 +-----
|
|
2 files changed, 2 insertions(+), 13 deletions(-)
|
|
|
|
diff --git a/src/librustc_target/abi/call/powerpc64.rs b/src/librustc_target/abi/call/powerpc64.rs
|
|
index 93c4e97d..96b02486 100644
|
|
--- a/src/librustc_target/abi/call/powerpc64.rs
|
|
+++ b/src/librustc_target/abi/call/powerpc64.rs
|
|
@@ -119,14 +119,7 @@ where
|
|
Ty: TyLayoutMethods<'a, C> + Copy,
|
|
C: LayoutOf<Ty = Ty, TyLayout = TyLayout<'a, Ty>> + HasDataLayout + HasTargetSpec,
|
|
{
|
|
- let abi = if cx.target_spec().target_env == "musl" {
|
|
- ELFv2
|
|
- } else {
|
|
- match cx.data_layout().endian {
|
|
- Endian::Big => ELFv1,
|
|
- Endian::Little => ELFv2,
|
|
- }
|
|
- };
|
|
+ let abi = ELFv2;
|
|
|
|
if !fn_abi.ret.is_ignore() {
|
|
classify_ret(cx, &mut fn_abi.ret, abi);
|
|
diff --git a/src/librustc_target/spec/powerpc64_unknown_linux_gnu.rs b/src/librustc_target/spec/powerpc64_unknown_linux_gnu.rs
|
|
index 5306d905..c63eed85 100644
|
|
--- a/src/librustc_target/spec/powerpc64_unknown_linux_gnu.rs
|
|
+++ b/src/librustc_target/spec/powerpc64_unknown_linux_gnu.rs
|
|
@@ -1,4 +1,4 @@
|
|
-use crate::spec::{LinkerFlavor, RelroLevel, Target, TargetOptions, TargetResult};
|
|
+use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult};
|
|
|
|
pub fn target() -> TargetResult {
|
|
let mut base = super::linux_base::opts();
|
|
@@ -6,10 +6,6 @@ pub fn target() -> TargetResult {
|
|
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m64".to_string());
|
|
base.max_atomic_width = Some(64);
|
|
|
|
- // ld.so in at least RHEL6 on ppc64 has a bug related to BIND_NOW, so only enable partial RELRO
|
|
- // for now. https://github.com/rust-lang/rust/pull/43170#issuecomment-315411474
|
|
- base.relro_level = RelroLevel::Partial;
|
|
-
|
|
Ok(Target {
|
|
llvm_target: "powerpc64-unknown-linux-gnu".to_string(),
|
|
target_endian: "big".to_string(),
|
|
--
|
|
2.26.2
|
|
|