void-packages/srcpkgs/rust/patches/0011-Use-ELFv2-ABI-on-all-p...

40 lines
1.4 KiB
Diff

From de93abe8a0d9dc7878a48f61b9e3ae4a923020f6 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 3 May 2020 18:08:09 +0200
Subject: [PATCH 11/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.
diff --git a/compiler/rustc_target/src/abi/call/powerpc64.rs b/compiler/rustc_target/src/abi/call/powerpc64.rs
index 749eea0ef..1dfa3cbd0 100644
--- a/compiler/rustc_target/src/abi/call/powerpc64.rs
+++ b/compiler/rustc_target/src/abi/call/powerpc64.rs
@@ -3,7 +3,7 @@
// need to be fixed when PowerPC vector support is added.
use crate::abi::call::{Align, ArgAbi, FnAbi, Reg, RegKind, Uniform};
-use crate::abi::{Endian, HasDataLayout, TyAbiInterface};
+use crate::abi::{HasDataLayout, TyAbiInterface};
use crate::spec::HasTargetSpec;
#[derive(Debug, Clone, Copy, PartialEq)]
@@ -91,14 +91,7 @@ where
Ty: TyAbiInterface<'a, C> + Copy,
C: HasDataLayout + HasTargetSpec,
{
- let abi = if cx.target_spec().env == "musl" {
- ELFv2
- } else {
- match cx.data_layout().endian {
- Endian::Big => ELFv1,
- Endian::Little => ELFv2,
- }
- };
+ let abi = ELFv2;
classify(cx, &mut fn_abi.ret, abi, true);