1 Star 0 Fork 69

wk333/rust3

forked from jchzhou/rust3 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0001-add-support-for-ppc64le.patch 7.19 KB
一键复制 编辑 原始数据 按行查看 历史
wk333 提交于 2024-08-07 16:42 . Update to 1.80.0
From 85c7f9262e9d4fbfdaa5d7bc22a85eb5300fcca0 Mon Sep 17 00:00:00 2001
From: jcf <[email protected]>
Date: Wed, 12 Jun 2024 09:14:32 +0000
Subject: [PATCH] add support for ppc64le
---
compiler/rustc_target/src/spec/mod.rs | 2 ++
.../spec/targets/ppc64le_unknown_freebsd.rs | 23 +++++++++++++++++++
.../spec/targets/ppc64le_unknown_linux_gnu.rs | 23 +++++++++++++++++++
.../targets/ppc64le_unknown_linux_musl.rs | 23 +++++++++++++++++++
src/bootstrap/configure.py | 2 ++
vendor/openssl-src-111.28.1+1.1.1w/src/lib.rs | 3 +++
vendor/target-lexicon-0.12.14/src/targets.rs | 3 +++
7 files changed, 79 insertions(+)
create mode 100644 compiler/rustc_target/src/spec/targets/ppc64le_unknown_freebsd.rs
create mode 100644 compiler/rustc_target/src/spec/targets/ppc64le_unknown_linux_gnu.rs
create mode 100644 compiler/rustc_target/src/spec/targets/ppc64le_unknown_linux_musl.rs
diff --git a/compiler/rustc_target/src/spec/mod.rs b/compiler/rustc_target/src/spec/mod.rs
index 291a761..e6e80a1 100644
--- a/compiler/rustc_target/src/spec/mod.rs
+++ b/compiler/rustc_target/src/spec/mod.rs
@@ -1513,6 +1513,8 @@ supported_targets! {
("powerpc64-unknown-linux-musl", powerpc64_unknown_linux_musl),
("powerpc64le-unknown-linux-gnu", powerpc64le_unknown_linux_gnu),
("powerpc64le-unknown-linux-musl", powerpc64le_unknown_linux_musl),
+ ("ppc64le-unknown-linux-gnu", ppc64le_unknown_linux_gnu),
+ ("ppc64le-unknown-linux-musl", ppc64le_unknown_linux_musl),
("s390x-unknown-linux-gnu", s390x_unknown_linux_gnu),
("s390x-unknown-linux-musl", s390x_unknown_linux_musl),
("sparc-unknown-linux-gnu", sparc_unknown_linux_gnu),
diff --git a/compiler/rustc_target/src/spec/targets/ppc64le_unknown_freebsd.rs b/compiler/rustc_target/src/spec/targets/ppc64le_unknown_freebsd.rs
new file mode 100644
index 0000000..615bb67
--- /dev/null
+++ b/compiler/rustc_target/src/spec/targets/ppc64le_unknown_freebsd.rs
@@ -0,0 +1,23 @@
+use crate::spec::{base, Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetOptions};
+
+pub fn target() -> Target {
+ let mut base = base::freebsd::opts();
+ base.cpu = "ppc64le".into();
+ base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-m64"]);
+ base.max_atomic_width = Some(64);
+ base.stack_probes = StackProbeType::Inline;
+
+ Target {
+ llvm_target: "ppc64le-unknown-freebsd".into(),
+ metadata: crate::spec::TargetMetadata {
+ description: None,
+ tier: None,
+ host_tools: None,
+ std: None,
+ },
+ pointer_width: 64,
+ data_layout: "e-m:e-Fn32-i64:64-n32:64".into(),
+ arch: "powerpc64".into(),
+ options: TargetOptions { mcount: "_mcount".into(), ..base },
+ }
+}
diff --git a/compiler/rustc_target/src/spec/targets/ppc64le_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/targets/ppc64le_unknown_linux_gnu.rs
new file mode 100644
index 0000000..5ff45e2
--- /dev/null
+++ b/compiler/rustc_target/src/spec/targets/ppc64le_unknown_linux_gnu.rs
@@ -0,0 +1,23 @@
+use crate::spec::{base, Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetOptions};
+
+pub fn target() -> Target {
+ let mut base = base::linux_gnu::opts();
+ base.cpu = "ppc64le".into();
+ base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-m64"]);
+ base.max_atomic_width = Some(64);
+ base.stack_probes = StackProbeType::Inline;
+
+ Target {
+ llvm_target: "ppc64le-unknown-linux-gnu".into(),
+ metadata: crate::spec::TargetMetadata {
+ description: None,
+ tier: None,
+ host_tools: None,
+ std: None,
+ },
+ pointer_width: 64,
+ data_layout: "e-m:e-Fn32-i64:64-n32:64-S128-v256:256:256-v512:512:512".into(),
+ arch: "powerpc64".into(),
+ options: TargetOptions { mcount: "_mcount".into(), ..base },
+ }
+}
diff --git a/compiler/rustc_target/src/spec/targets/ppc64le_unknown_linux_musl.rs b/compiler/rustc_target/src/spec/targets/ppc64le_unknown_linux_musl.rs
new file mode 100644
index 0000000..2b612e7
--- /dev/null
+++ b/compiler/rustc_target/src/spec/targets/ppc64le_unknown_linux_musl.rs
@@ -0,0 +1,23 @@
+use crate::spec::{base, Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetOptions};
+
+pub fn target() -> Target {
+ let mut base = base::linux_musl::opts();
+ base.cpu = "ppc64le".into();
+ base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-m64"]);
+ base.max_atomic_width = Some(64);
+ base.stack_probes = StackProbeType::Inline;
+
+ Target {
+ llvm_target: "ppc64le-unknown-linux-musl".into(),
+ metadata: crate::spec::TargetMetadata {
+ description: None,
+ tier: None,
+ host_tools: None,
+ std: None,
+ },
+ pointer_width: 64,
+ data_layout: "e-m:e-Fn32-i64:64-n32:64-S128-v256:256:256-v512:512:512".into(),
+ arch: "powerpc64".into(),
+ options: TargetOptions { mcount: "_mcount".into(), ..base },
+ }
+}
diff --git a/src/bootstrap/configure.py b/src/bootstrap/configure.py
index 768aac9..155f21e 100755
--- a/src/bootstrap/configure.py
+++ b/src/bootstrap/configure.py
@@ -127,6 +127,8 @@ v("musl-root-mips64", "target.mips64-unknown-linux-muslabi64.musl-root",
"mips64-unknown-linux-muslabi64 install directory")
v("musl-root-mips64el", "target.mips64el-unknown-linux-muslabi64.musl-root",
"mips64el-unknown-linux-muslabi64 install directory")
+v("musl-root-ppc64le", "target.ppc64le-unknown-linux-musl.musl-root",
+ "ppc64le-unknown-linux-musl install directory")
v("musl-root-riscv32gc", "target.riscv32gc-unknown-linux-musl.musl-root",
"riscv32gc-unknown-linux-musl install directory")
v("musl-root-riscv64gc", "target.riscv64gc-unknown-linux-musl.musl-root",
diff --git a/vendor/openssl-src-111.28.2+1.1.1w/src/lib.rs b/vendor/openssl-src-111.28.2+1.1.1w/src/lib.rs
index 1264742..14427a7 100644
--- a/vendor/openssl-src-111.28.2+1.1.1w/src/lib.rs
+++ b/vendor/openssl-src-111.28.2+1.1.1w/src/lib.rs
@@ -282,6 +282,9 @@ impl Build {
"powerpc64le-unknown-freebsd" => "BSD-generic64",
"powerpc64le-unknown-linux-gnu" => "linux-ppc64le",
"powerpc64le-unknown-linux-musl" => "linux-ppc64le",
+ "ppc64le-unknown-freebsd" => "BSD-generic64",
+ "ppc64le-unknown-linux-gnu" => "linux-ppc64le",
+ "ppc64le-unknown-linux-musl" => "linux-ppc64le",
"riscv64gc-unknown-linux-gnu" => "linux-generic64",
"s390x-unknown-linux-gnu" => "linux64-s390x",
"s390x-unknown-linux-musl" => "linux64-s390x",
diff --git a/vendor/target-lexicon-0.12.14/src/targets.rs b/vendor/target-lexicon-0.12.14/src/targets.rs
index f764b34..e150f84 100644
--- a/vendor/target-lexicon-0.12.14/src/targets.rs
+++ b/vendor/target-lexicon-0.12.14/src/targets.rs
@@ -1639,6 +1639,9 @@ mod tests {
"powerpc64le-unknown-freebsd",
"powerpc64le-unknown-linux-gnu",
"powerpc64le-unknown-linux-musl",
+ "ppc64le-unknown-freebsd",
+ "ppc64le-unknown-linux-gnu",
+ "ppc64le-unknown-linux-musl",
"powerpc64-ibm-aix",
"powerpc64-unknown-freebsd",
"powerpc64-unknown-linux-gnu",
--
2.44.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wk333/rust3.git
[email protected]:wk333/rust3.git
wk333
rust3
rust3
master

搜索帮助