mirror of
https://git.proxmox.com/git/rustc
synced 2026-08-06 02:38:28 +00:00
drop patches which were applied upstream
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
parent
a823eb03cf
commit
8f036fc120
13
debian/patches/series
vendored
13
debian/patches/series
vendored
@ -8,29 +8,16 @@ u-make-tests-work-without-rpath.patch
|
||||
u-tests-ignore-arm.patch
|
||||
u-mips-fixes.diff
|
||||
#u-allow-system-compiler-rt.patch
|
||||
u-fix-cross-compile-install-again.patch
|
||||
u-riscv64-65953.patch
|
||||
u-riscv64-66661.patch
|
||||
u-riscv64-format-1.patch
|
||||
u-riscv64-format-2.patch
|
||||
u-riscv64-66899.patch
|
||||
u-riscv64-libc-1606.patch
|
||||
u-riscv64-cc-428.patch
|
||||
u-riscv64-cc-429.patch
|
||||
u-riscv64-cc-430.patch
|
||||
u-riscv64-cc-460.patch
|
||||
u-riscv64-cc-461.patch
|
||||
u-riscv64-cc-465.patch
|
||||
# TODO: forward this one
|
||||
u-riscv64-compiletest.patch
|
||||
u-wasm32-66750.patch
|
||||
u-wasm32-67267.patch
|
||||
u-wasm32-libc-1625.patch
|
||||
u-wasm32-wasi.patch
|
||||
|
||||
# not forwarded, or forwarded but unlikely to be merged
|
||||
u-rustbuild-rustflags.patch
|
||||
u-reproducible-compiler-builtins.patch
|
||||
u-rustc-llvm-cross-flags.patch
|
||||
u-reproducible-dl-stage0.patch
|
||||
|
||||
|
||||
@ -1,12 +0,0 @@
|
||||
Forwarded: https://github.com/rust-lang/rust/pull/66834
|
||||
--- a/src/bootstrap/install.rs
|
||||
+++ b/src/bootstrap/install.rs
|
||||
@@ -260,7 +260,7 @@
|
||||
};
|
||||
Rustc, "src/librustc", true, only_hosts: true, {
|
||||
builder.ensure(dist::Rustc {
|
||||
- compiler: self.compiler,
|
||||
+ compiler: builder.compiler(builder.top_stage, self.target),
|
||||
});
|
||||
install_rustc(builder, self.compiler.stage, self.target);
|
||||
};
|
||||
@ -1,14 +0,0 @@
|
||||
--- a/vendor/compiler_builtins/build.rs
|
||||
+++ b/vendor/compiler_builtins/build.rs
|
||||
@@ -423,6 +423,11 @@
|
||||
panic!("RUST_COMPILER_RT_ROOT={} does not exist", root.display());
|
||||
}
|
||||
|
||||
+ // Support deterministic builds by remapping the __FILE__ prefix if the
|
||||
+ // compiler supports it. This fixes the nondeterminism caused by the
|
||||
+ // use of that macro in lib/builtins/int_util.h in compiler-rt.
|
||||
+ cfg.flag_if_supported(&format!("-ffile-prefix-map={}=.", root.display()));
|
||||
+
|
||||
let src_dir = root.join("lib/builtins");
|
||||
for (sym, src) in sources.map.iter() {
|
||||
let src = src_dir.join(src);
|
||||
111
debian/patches/u-riscv64-65953.patch
vendored
111
debian/patches/u-riscv64-65953.patch
vendored
@ -1,111 +0,0 @@
|
||||
From 539de439ad6f32e9a9a8a593299072a106786890 Mon Sep 17 00:00:00 2001
|
||||
From: Gui Andrade <gh@archshift.com>
|
||||
Date: Tue, 29 Oct 2019 21:12:05 -0700
|
||||
Subject: [PATCH] Allow specifying key "llvm-abiname" in target specification
|
||||
|
||||
This addresses #65024, as it allows RISC-V target specification
|
||||
files to set "llvm-abiname": "lp64d". In general, it is useful
|
||||
for the programmer to be able to set this codegen parameter,
|
||||
which other languages usually expose under a compiler argument
|
||||
like "-mabi=<XYZ>".
|
||||
---
|
||||
src/librustc_codegen_llvm/back/write.rs | 3 ++-
|
||||
src/librustc_codegen_llvm/llvm/ffi.rs | 1 +
|
||||
src/librustc_target/spec/mod.rs | 8 +++++++-
|
||||
src/rustllvm/PassWrapper.cpp | 3 ++-
|
||||
4 files changed, 12 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/librustc_codegen_llvm/back/write.rs b/src/librustc_codegen_llvm/back/write.rs
|
||||
index 52f3a1cbb5c3..fa14ce7b03c8 100644
|
||||
--- a/src/librustc_codegen_llvm/back/write.rs
|
||||
+++ b/src/librustc_codegen_llvm/back/write.rs
|
||||
@@ -161,6 +161,7 @@ pub fn target_machine_factory(sess: &Session, optlvl: config::OptLevel, find_fea
|
||||
let cpu = SmallCStr::new(llvm_util::target_cpu(sess));
|
||||
let features = features.join(",");
|
||||
let features = CString::new(features).unwrap();
|
||||
+ let abi = SmallCStr::new(&sess.target.target.options.llvm_abiname);
|
||||
let is_pie_binary = !find_features && is_pie_binary(sess);
|
||||
let trap_unreachable = sess.target.target.options.trap_unreachable;
|
||||
let emit_stack_size_section = sess.opts.debugging_opts.emit_stack_sizes;
|
||||
@@ -170,7 +171,7 @@ pub fn target_machine_factory(sess: &Session, optlvl: config::OptLevel, find_fea
|
||||
Arc::new(move || {
|
||||
let tm = unsafe {
|
||||
llvm::LLVMRustCreateTargetMachine(
|
||||
- triple.as_ptr(), cpu.as_ptr(), features.as_ptr(),
|
||||
+ triple.as_ptr(), cpu.as_ptr(), features.as_ptr(), abi.as_ptr(),
|
||||
code_model,
|
||||
reloc_model,
|
||||
opt_level,
|
||||
diff --git a/src/librustc_codegen_llvm/llvm/ffi.rs b/src/librustc_codegen_llvm/llvm/ffi.rs
|
||||
index c69942ef3f2d..85c181ba2f31 100644
|
||||
--- a/src/librustc_codegen_llvm/llvm/ffi.rs
|
||||
+++ b/src/librustc_codegen_llvm/llvm/ffi.rs
|
||||
@@ -1684,6 +1684,7 @@ extern "C" {
|
||||
pub fn LLVMRustCreateTargetMachine(Triple: *const c_char,
|
||||
CPU: *const c_char,
|
||||
Features: *const c_char,
|
||||
+ Abi: *const c_char,
|
||||
Model: CodeModel,
|
||||
Reloc: RelocMode,
|
||||
Level: CodeGenOptLevel,
|
||||
diff --git a/src/librustc_target/spec/mod.rs b/src/librustc_target/spec/mod.rs
|
||||
index 6033d52c4411..e51772220b73 100644
|
||||
--- a/src/librustc_target/spec/mod.rs
|
||||
+++ b/src/librustc_target/spec/mod.rs
|
||||
@@ -793,7 +793,10 @@ pub struct TargetOptions {
|
||||
pub merge_functions: MergeFunctions,
|
||||
|
||||
/// Use platform dependent mcount function
|
||||
- pub target_mcount: String
|
||||
+ pub target_mcount: String,
|
||||
+
|
||||
+ /// LLVM ABI name, corresponds to the '-mabi' parameter available in multilib C compilers
|
||||
+ pub llvm_abiname: String,
|
||||
}
|
||||
|
||||
impl Default for TargetOptions {
|
||||
@@ -880,6 +883,7 @@ impl Default for TargetOptions {
|
||||
override_export_symbols: None,
|
||||
merge_functions: MergeFunctions::Aliases,
|
||||
target_mcount: "mcount".to_string(),
|
||||
+ llvm_abiname: "".to_string(),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1196,6 +1200,7 @@ impl Target {
|
||||
key!(override_export_symbols, opt_list);
|
||||
key!(merge_functions, MergeFunctions)?;
|
||||
key!(target_mcount);
|
||||
+ key!(llvm_abiname);
|
||||
|
||||
if let Some(array) = obj.find("abi-blacklist").and_then(Json::as_array) {
|
||||
for name in array.iter().filter_map(|abi| abi.as_string()) {
|
||||
@@ -1414,6 +1419,7 @@ impl ToJson for Target {
|
||||
target_option_val!(override_export_symbols);
|
||||
target_option_val!(merge_functions);
|
||||
target_option_val!(target_mcount);
|
||||
+ target_option_val!(llvm_abiname);
|
||||
|
||||
if default.abi_blacklist != self.options.abi_blacklist {
|
||||
d.insert("abi-blacklist".to_string(), self.options.abi_blacklist.iter()
|
||||
diff --git a/src/rustllvm/PassWrapper.cpp b/src/rustllvm/PassWrapper.cpp
|
||||
index 0cda3465dc09..5b3900ab4961 100644
|
||||
--- a/src/rustllvm/PassWrapper.cpp
|
||||
+++ b/src/rustllvm/PassWrapper.cpp
|
||||
@@ -343,7 +343,7 @@ extern "C" const char* LLVMRustGetHostCPUName(size_t *len) {
|
||||
|
||||
extern "C" LLVMTargetMachineRef LLVMRustCreateTargetMachine(
|
||||
const char *TripleStr, const char *CPU, const char *Feature,
|
||||
- LLVMRustCodeModel RustCM, LLVMRustRelocMode RustReloc,
|
||||
+ const char *ABIStr, LLVMRustCodeModel RustCM, LLVMRustRelocMode RustReloc,
|
||||
LLVMRustCodeGenOptLevel RustOptLevel, bool UseSoftFloat,
|
||||
bool PositionIndependentExecutable, bool FunctionSections,
|
||||
bool DataSections,
|
||||
@@ -374,6 +374,7 @@ extern "C" LLVMTargetMachineRef LLVMRustCreateTargetMachine(
|
||||
Options.FunctionSections = FunctionSections;
|
||||
Options.MCOptions.AsmVerbose = AsmComments;
|
||||
Options.MCOptions.PreserveAsmComments = AsmComments;
|
||||
+ Options.MCOptions.ABIName = ABIStr;
|
||||
|
||||
if (TrapUnreachable) {
|
||||
// Tell LLVM to codegen `unreachable` into an explicit trap instruction.
|
||||
54
debian/patches/u-riscv64-66661.patch
vendored
54
debian/patches/u-riscv64-66661.patch
vendored
@ -1,54 +0,0 @@
|
||||
From 75dac389fb168159e0b049f72141f889b7215889 Mon Sep 17 00:00:00 2001
|
||||
From: msizanoen1 <qtmlabs@protonmail.com>
|
||||
Date: Sat, 23 Nov 2019 14:15:27 +0700
|
||||
Subject: [PATCH] Add riscv64gc-unknown-linux-gnu target
|
||||
|
||||
---
|
||||
src/librustc_target/spec/mod.rs | 1 +
|
||||
.../spec/riscv64gc_unknown_linux_gnu.rs | 25 +++++++++++++++++++
|
||||
2 files changed, 26 insertions(+)
|
||||
create mode 100644 src/librustc_target/spec/riscv64gc_unknown_linux_gnu.rs
|
||||
|
||||
diff --git a/src/librustc_target/spec/mod.rs b/src/librustc_target/spec/mod.rs
|
||||
index 716aef056a35..1a7cb943de76 100644
|
||||
--- a/src/librustc_target/spec/mod.rs
|
||||
+++ b/src/librustc_target/spec/mod.rs
|
||||
@@ -487,6 +487,7 @@ supported_targets! {
|
||||
("riscv32imac-unknown-none-elf", riscv32imac_unknown_none_elf),
|
||||
("riscv64imac-unknown-none-elf", riscv64imac_unknown_none_elf),
|
||||
("riscv64gc-unknown-none-elf", riscv64gc_unknown_none_elf),
|
||||
+ ("riscv64gc-unknown-linux-gnu", riscv64gc_unknown_linux_gnu),
|
||||
|
||||
("aarch64-unknown-none", aarch64_unknown_none),
|
||||
("aarch64-unknown-none-softfloat", aarch64_unknown_none_softfloat),
|
||||
diff --git a/src/librustc_target/spec/riscv64gc_unknown_linux_gnu.rs b/src/librustc_target/spec/riscv64gc_unknown_linux_gnu.rs
|
||||
new file mode 100644
|
||||
index 000000000000..638e6770ebf8
|
||||
--- /dev/null
|
||||
+++ b/src/librustc_target/spec/riscv64gc_unknown_linux_gnu.rs
|
||||
@@ -0,0 +1,25 @@
|
||||
+use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult};
|
||||
+
|
||||
+pub fn target() -> TargetResult {
|
||||
+ Ok(Target {
|
||||
+ llvm_target: "riscv64-unknown-linux-gnu".to_string(),
|
||||
+ target_endian: "little".to_string(),
|
||||
+ target_pointer_width: "64".to_string(),
|
||||
+ target_c_int_width: "32".to_string(),
|
||||
+ target_env: "gnu".to_string(),
|
||||
+ data_layout: "e-m:e-p:64:64-i64:64-i128:128-n64-S128".to_string(),
|
||||
+ arch: "riscv64".to_string(),
|
||||
+ target_os: "linux".to_string(),
|
||||
+ target_vendor: "unknown".to_string(),
|
||||
+ linker_flavor: LinkerFlavor::Gcc,
|
||||
+ options: TargetOptions {
|
||||
+ abi_blacklist: super::riscv_base::abi_blacklist(),
|
||||
+ code_model: Some("medium".to_string()),
|
||||
+ cpu: "generic-rv64".to_string(),
|
||||
+ features: "+m,+a,+f,+d,+c".to_string(),
|
||||
+ llvm_abiname: "lp64d".to_string(),
|
||||
+ max_atomic_width: Some(64),
|
||||
+ ..super::linux_base::opts()
|
||||
+ },
|
||||
+ })
|
||||
+}
|
||||
48
debian/patches/u-riscv64-cc-428.patch
vendored
48
debian/patches/u-riscv64-cc-428.patch
vendored
@ -1,48 +0,0 @@
|
||||
From 4981b3cdf070c5f1f8ead508d5b56ea60ec657c2 Mon Sep 17 00:00:00 2001
|
||||
From: "Wladimir J. van der Laan" <laanwj@gmail.com>
|
||||
Date: Wed, 7 Aug 2019 13:57:33 +0000
|
||||
Subject: [PATCH] Add RISC-V support
|
||||
|
||||
Automatically choose the most common name for the toolchain, and add the
|
||||
command-line arguments to generate code that is compatible with the
|
||||
chosen architecture.
|
||||
|
||||
Fixes #397.
|
||||
---
|
||||
src/lib.rs | 16 ++++++++++++++++
|
||||
1 file changed, 16 insertions(+)
|
||||
|
||||
diff --git a/src/lib.rs b/src/lib.rs
|
||||
index 3500c527..f3b9343e 100644
|
||||
--- a/vendor/cc/src/lib.rs
|
||||
+++ b/vendor/cc/src/lib.rs
|
||||
@@ -1428,6 +1428,17 @@ impl Build {
|
||||
cmd.args.push("-mfloat-abi=soft".into());
|
||||
}
|
||||
}
|
||||
+ if target.starts_with("riscv32") || target.starts_with("riscv64") {
|
||||
+ // get the 32i/32imac/32imc/64gc/64imac/... part
|
||||
+ let mut parts = target.split('-');
|
||||
+ if let Some(arch) = parts.next() {
|
||||
+ let arch = &arch[5..];
|
||||
+ cmd.args.push(("-march=rv".to_owned() + arch).into());
|
||||
+ // ABI is always soft-float right now, update this when this is no longer the
|
||||
+ // case:
|
||||
+ cmd.args.push("-mabi=lp64".into());
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1809,6 +1820,11 @@ impl Build {
|
||||
"powerpc-unknown-netbsd" => Some("powerpc--netbsd"),
|
||||
"powerpc64-unknown-linux-gnu" => Some("powerpc-linux-gnu"),
|
||||
"powerpc64le-unknown-linux-gnu" => Some("powerpc64le-linux-gnu"),
|
||||
+ "riscv32i-unknown-none-elf" => Some("riscv32-unknown-elf"),
|
||||
+ "riscv32imac-unknown-none-elf" => Some("riscv32-unknown-elf"),
|
||||
+ "riscv32imc-unknown-none-elf" => Some("riscv32-unknown-elf"),
|
||||
+ "riscv64gc-unknown-none-elf" => Some("riscv64-unknown-elf"),
|
||||
+ "riscv64imac-unknown-none-elf" => Some("riscv64-unknown-elf"),
|
||||
"s390x-unknown-linux-gnu" => Some("s390x-linux-gnu"),
|
||||
"sparc-unknown-linux-gnu" => Some("sparc-linux-gnu"),
|
||||
"sparc64-unknown-linux-gnu" => Some("sparc64-linux-gnu"),
|
||||
34
debian/patches/u-riscv64-cc-429.patch
vendored
34
debian/patches/u-riscv64-cc-429.patch
vendored
@ -1,34 +0,0 @@
|
||||
From b15493847edca64203a08565863d74dd08961fdc Mon Sep 17 00:00:00 2001
|
||||
From: "Wladimir J. van der Laan" <laanwj@gmail.com>
|
||||
Date: Thu, 8 Aug 2019 06:52:55 +0000
|
||||
Subject: [PATCH] risc-v: Set ABI correctly for 32-bit targets
|
||||
|
||||
Pick the correct softfloat mode based on bitness:
|
||||
|
||||
- `-mabi=lp64` for 64 bit RISC-V
|
||||
- `-mabi=ilp32` for 32-bit RISC-V
|
||||
|
||||
Currently it fails for rv32 due to a conflict between the ABI and arch:
|
||||
|
||||
cc1: error: ABI requires -march=rv64
|
||||
---
|
||||
src/lib.rs | 6 +++++-
|
||||
1 file changed, 5 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/lib.rs b/src/lib.rs
|
||||
index f3b9343e..4fe1b34e 100644
|
||||
--- a/vendor/cc/src/lib.rs
|
||||
+++ b/vendor/cc/src/lib.rs
|
||||
@@ -1436,7 +1436,11 @@ impl Build {
|
||||
cmd.args.push(("-march=rv".to_owned() + arch).into());
|
||||
// ABI is always soft-float right now, update this when this is no longer the
|
||||
// case:
|
||||
- cmd.args.push("-mabi=lp64".into());
|
||||
+ if arch.starts_with("64") {
|
||||
+ cmd.args.push("-mabi=lp64".into());
|
||||
+ } else {
|
||||
+ cmd.args.push("-mabi=ilp32".into());
|
||||
+ }
|
||||
}
|
||||
}
|
||||
}
|
||||
43
debian/patches/u-riscv64-cc-430.patch
vendored
43
debian/patches/u-riscv64-cc-430.patch
vendored
@ -1,43 +0,0 @@
|
||||
From 97b648e1d2597363d6baea7190469d45c857c8f6 Mon Sep 17 00:00:00 2001
|
||||
From: "Wladimir J. van der Laan" <laanwj@gmail.com>
|
||||
Date: Thu, 8 Aug 2019 06:27:30 +0000
|
||||
Subject: [PATCH] risc-v: Disable PIC by default for now
|
||||
|
||||
Rust's linker cannot currently handle gcc's fPIC compilation units
|
||||
for RISC-V targets:
|
||||
|
||||
= note: rust-lld: error:
|
||||
.got section detected in the input files. Dynamic relocations are not
|
||||
supported. If you are linking to C code compiled using the `gcc` crate
|
||||
then modify your build script to compile the C code _without_ the
|
||||
-fPIC flag. See the documentation of the `gcc::Config.fpic` method for
|
||||
details.
|
||||
|
||||
So disable PIC by default for now for `riscv` targets.
|
||||
---
|
||||
src/lib.rs | 5 +++--
|
||||
1 file changed, 3 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/lib.rs b/src/lib.rs
|
||||
index f3b9343e..fd67d0be 100644
|
||||
--- a/vendor/cc/src/lib.rs
|
||||
+++ b/vendor/cc/src/lib.rs
|
||||
@@ -824,7 +824,7 @@ impl Build {
|
||||
|
||||
/// Configures whether the compiler will emit position independent code.
|
||||
///
|
||||
- /// This option defaults to `false` for `windows-gnu` targets and
|
||||
+ /// This option defaults to `false` for `windows-gnu` and `riscv` targets and
|
||||
/// to `true` for all other targets.
|
||||
pub fn pic(&mut self, pic: bool) -> &mut Build {
|
||||
self.pic = Some(pic);
|
||||
@@ -1225,7 +1225,8 @@ impl Build {
|
||||
cmd.push_cc_arg("-ffunction-sections".into());
|
||||
cmd.push_cc_arg("-fdata-sections".into());
|
||||
}
|
||||
- if self.pic.unwrap_or(!target.contains("windows-gnu")) {
|
||||
+ // Disable generation of PIC on RISC-V for now: rust-lld doesn't support this yet
|
||||
+ if self.pic.unwrap_or(!target.contains("windows-gnu") && !target.contains("riscv")) {
|
||||
cmd.push_cc_arg("-fPIC".into());
|
||||
// PLT only applies if code is compiled with PIC support,
|
||||
// and only for ELF targets.
|
||||
38
debian/patches/u-riscv64-cc-460.patch
vendored
38
debian/patches/u-riscv64-cc-460.patch
vendored
@ -1,38 +0,0 @@
|
||||
From f0e5025a94e22a30734e338eb2a2a2e79e59486c Mon Sep 17 00:00:00 2001
|
||||
From: msizanoen1 <qtmlabs@protonmail.com>
|
||||
Date: Sun, 1 Dec 2019 20:19:11 +0700
|
||||
Subject: [PATCH] Default to double-float ABI on RISC-V Linux
|
||||
|
||||
---
|
||||
src/lib.rs | 8 +++++---
|
||||
1 file changed, 5 insertions(+), 3 deletions(-)
|
||||
|
||||
--- a/vendor/cc/src/lib.rs
|
||||
+++ b/vendor/cc/src/lib.rs
|
||||
@@ -1220,7 +1220,10 @@
|
||||
cmd.push_cc_arg("-fdata-sections".into());
|
||||
}
|
||||
// Disable generation of PIC on RISC-V for now: rust-lld doesn't support this yet
|
||||
- if self.pic.unwrap_or(!target.contains("windows-gnu") && !target.contains("riscv")) {
|
||||
+ if self
|
||||
+ .pic
|
||||
+ .unwrap_or(!target.contains("windows-gnu") && !target.contains("riscv"))
|
||||
+ {
|
||||
cmd.push_cc_arg("-fPIC".into());
|
||||
// PLT only applies if code is compiled with PIC support,
|
||||
// and only for ELF targets.
|
||||
@@ -1429,9 +1432,11 @@
|
||||
if let Some(arch) = parts.next() {
|
||||
let arch = &arch[5..];
|
||||
cmd.args.push(("-march=rv".to_owned() + arch).into());
|
||||
- // ABI is always soft-float right now, update this when this is no longer the
|
||||
- // case:
|
||||
- if arch.starts_with("64") {
|
||||
+ if target.contains("linux") && arch.starts_with("64") {
|
||||
+ cmd.args.push("-mabi=lp64d".into());
|
||||
+ } else if target.contains("linux") && arch.starts_with("32") {
|
||||
+ cmd.args.push("-mabi=ilp32d".into());
|
||||
+ } else if arch.starts_with("64") {
|
||||
cmd.args.push("-mabi=lp64".into());
|
||||
} else {
|
||||
cmd.args.push("-mabi=ilp32".into());
|
||||
449
debian/patches/u-riscv64-format-1.patch
vendored
449
debian/patches/u-riscv64-format-1.patch
vendored
@ -1,449 +0,0 @@
|
||||
commit 60091ee826b071a122ad4ef4ae833591e1db553b
|
||||
gpg: Signature made Sat 30 Nov 2019 02:32:46 GMT
|
||||
gpg: using RSA key 4628C5D82CFF65D68164A78AF9BA143B95FF6D82
|
||||
gpg: Can't check signature: No public key
|
||||
Author: David Tolnay <dtolnay@gmail.com>
|
||||
Date: Wed Nov 27 10:28:21 2019 -0800
|
||||
|
||||
Format libstd/os with rustfmt
|
||||
|
||||
This commit applies rustfmt with rust-lang/rust's default settings to
|
||||
files in src/libstd/os *that are not involved in any currently open PR*
|
||||
to minimize merge conflicts. THe list of files involved in open PRs was
|
||||
determined by querying GitHub's GraphQL API with this script:
|
||||
https://gist.github.com/dtolnay/aa9c34993dc051a4f344d1b10e4487e8
|
||||
|
||||
With the list of files from the script in outstanding_files, the
|
||||
relevant commands were:
|
||||
|
||||
$ find src/libstd/os -name '*.rs' \
|
||||
| xargs rustfmt --edition=2018 --unstable-features --skip-children
|
||||
$ rg libstd/os outstanding_files | xargs git checkout --
|
||||
|
||||
Repeating this process several months apart should get us coverage of
|
||||
most of the rest of the files.
|
||||
|
||||
To confirm no funny business:
|
||||
|
||||
$ git checkout $THIS_COMMIT^
|
||||
$ git show --pretty= --name-only $THIS_COMMIT \
|
||||
| xargs rustfmt --edition=2018 --unstable-features --skip-children
|
||||
$ git diff $THIS_COMMIT # there should be no difference
|
||||
|
||||
diff --git a/src/libstd/os/linux/raw.rs b/src/libstd/os/linux/raw.rs
|
||||
index 21e1cf8a22b..d9b2236047b 100644
|
||||
--- a/src/libstd/os/linux/raw.rs
|
||||
+++ b/src/libstd/os/linux/raw.rs
|
||||
@@ -1,41 +1,53 @@
|
||||
//! Linux-specific raw type definitions
|
||||
|
||||
#![stable(feature = "raw_ext", since = "1.1.0")]
|
||||
-#![rustc_deprecated(since = "1.8.0",
|
||||
- reason = "these type aliases are no longer supported by \
|
||||
- the standard library, the `libc` crate on \
|
||||
- crates.io should be used instead for the correct \
|
||||
- definitions")]
|
||||
+#![rustc_deprecated(
|
||||
+ since = "1.8.0",
|
||||
+ reason = "these type aliases are no longer supported by \
|
||||
+ the standard library, the `libc` crate on \
|
||||
+ crates.io should be used instead for the correct \
|
||||
+ definitions"
|
||||
+)]
|
||||
#![allow(deprecated)]
|
||||
#![allow(missing_debug_implementations)]
|
||||
|
||||
use crate::os::raw::c_ulong;
|
||||
|
||||
-#[stable(feature = "raw_ext", since = "1.1.0")] pub type dev_t = u64;
|
||||
-#[stable(feature = "raw_ext", since = "1.1.0")] pub type mode_t = u32;
|
||||
+#[stable(feature = "raw_ext", since = "1.1.0")]
|
||||
+pub type dev_t = u64;
|
||||
+#[stable(feature = "raw_ext", since = "1.1.0")]
|
||||
+pub type mode_t = u32;
|
||||
|
||||
#[stable(feature = "pthread_t", since = "1.8.0")]
|
||||
pub type pthread_t = c_ulong;
|
||||
|
||||
#[doc(inline)]
|
||||
#[stable(feature = "raw_ext", since = "1.1.0")]
|
||||
-pub use self::arch::{off_t, ino_t, nlink_t, blksize_t, blkcnt_t, stat, time_t};
|
||||
+pub use self::arch::{blkcnt_t, blksize_t, ino_t, nlink_t, off_t, stat, time_t};
|
||||
|
||||
-#[cfg(any(target_arch = "x86",
|
||||
- target_arch = "le32",
|
||||
- target_arch = "powerpc",
|
||||
- target_arch = "arm",
|
||||
- target_arch = "asmjs",
|
||||
- target_arch = "wasm32"))]
|
||||
+#[cfg(any(
|
||||
+ target_arch = "x86",
|
||||
+ target_arch = "le32",
|
||||
+ target_arch = "powerpc",
|
||||
+ target_arch = "arm",
|
||||
+ target_arch = "asmjs",
|
||||
+ target_arch = "wasm32"
|
||||
+))]
|
||||
mod arch {
|
||||
use crate::os::raw::{c_long, c_short, c_uint};
|
||||
|
||||
- #[stable(feature = "raw_ext", since = "1.1.0")] pub type blkcnt_t = u64;
|
||||
- #[stable(feature = "raw_ext", since = "1.1.0")] pub type blksize_t = u64;
|
||||
- #[stable(feature = "raw_ext", since = "1.1.0")] pub type ino_t = u64;
|
||||
- #[stable(feature = "raw_ext", since = "1.1.0")] pub type nlink_t = u64;
|
||||
- #[stable(feature = "raw_ext", since = "1.1.0")] pub type off_t = u64;
|
||||
- #[stable(feature = "raw_ext", since = "1.1.0")] pub type time_t = i64;
|
||||
+ #[stable(feature = "raw_ext", since = "1.1.0")]
|
||||
+ pub type blkcnt_t = u64;
|
||||
+ #[stable(feature = "raw_ext", since = "1.1.0")]
|
||||
+ pub type blksize_t = u64;
|
||||
+ #[stable(feature = "raw_ext", since = "1.1.0")]
|
||||
+ pub type ino_t = u64;
|
||||
+ #[stable(feature = "raw_ext", since = "1.1.0")]
|
||||
+ pub type nlink_t = u64;
|
||||
+ #[stable(feature = "raw_ext", since = "1.1.0")]
|
||||
+ pub type off_t = u64;
|
||||
+ #[stable(feature = "raw_ext", since = "1.1.0")]
|
||||
+ pub type time_t = i64;
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Clone)]
|
||||
@@ -87,20 +99,29 @@ mod arch {
|
||||
use crate::os::raw::{c_long, c_ulong};
|
||||
|
||||
#[cfg(target_env = "musl")]
|
||||
- #[stable(feature = "raw_ext", since = "1.1.0")] pub type blkcnt_t = i64;
|
||||
+ #[stable(feature = "raw_ext", since = "1.1.0")]
|
||||
+ pub type blkcnt_t = i64;
|
||||
#[cfg(not(target_env = "musl"))]
|
||||
- #[stable(feature = "raw_ext", since = "1.1.0")] pub type blkcnt_t = u64;
|
||||
- #[stable(feature = "raw_ext", since = "1.1.0")] pub type blksize_t = u64;
|
||||
+ #[stable(feature = "raw_ext", since = "1.1.0")]
|
||||
+ pub type blkcnt_t = u64;
|
||||
+ #[stable(feature = "raw_ext", since = "1.1.0")]
|
||||
+ pub type blksize_t = u64;
|
||||
#[cfg(target_env = "musl")]
|
||||
- #[stable(feature = "raw_ext", since = "1.1.0")] pub type ino_t = u64;
|
||||
+ #[stable(feature = "raw_ext", since = "1.1.0")]
|
||||
+ pub type ino_t = u64;
|
||||
#[cfg(not(target_env = "musl"))]
|
||||
- #[stable(feature = "raw_ext", since = "1.1.0")] pub type ino_t = u64;
|
||||
- #[stable(feature = "raw_ext", since = "1.1.0")] pub type nlink_t = u64;
|
||||
+ #[stable(feature = "raw_ext", since = "1.1.0")]
|
||||
+ pub type ino_t = u64;
|
||||
+ #[stable(feature = "raw_ext", since = "1.1.0")]
|
||||
+ pub type nlink_t = u64;
|
||||
#[cfg(target_env = "musl")]
|
||||
- #[stable(feature = "raw_ext", since = "1.1.0")] pub type off_t = u64;
|
||||
+ #[stable(feature = "raw_ext", since = "1.1.0")]
|
||||
+ pub type off_t = u64;
|
||||
#[cfg(not(target_env = "musl"))]
|
||||
- #[stable(feature = "raw_ext", since = "1.1.0")] pub type off_t = u64;
|
||||
- #[stable(feature = "raw_ext", since = "1.1.0")] pub type time_t = i64;
|
||||
+ #[stable(feature = "raw_ext", since = "1.1.0")]
|
||||
+ pub type off_t = u64;
|
||||
+ #[stable(feature = "raw_ext", since = "1.1.0")]
|
||||
+ pub type time_t = i64;
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Clone)]
|
||||
@@ -149,14 +170,20 @@ mod arch {
|
||||
|
||||
#[cfg(target_arch = "hexagon")]
|
||||
mod arch {
|
||||
- use crate::os::raw::{c_long, c_int, c_longlong, culonglong};
|
||||
+ use crate::os::raw::{c_int, c_long, c_longlong, culonglong};
|
||||
|
||||
- #[stable(feature = "raw_ext", since = "1.1.0")] pub type blkcnt_t = c_longlong;
|
||||
- #[stable(feature = "raw_ext", since = "1.1.0")] pub type blksize_t = c_long;
|
||||
- #[stable(feature = "raw_ext", since = "1.1.0")] pub type ino_t = c_ulonglong;
|
||||
- #[stable(feature = "raw_ext", since = "1.1.0")] pub type nlink_t = c_uint;
|
||||
- #[stable(feature = "raw_ext", since = "1.1.0")] pub type off_t = c_longlong;
|
||||
- #[stable(feature = "raw_ext", since = "1.1.0")] pub type time_t = c_long;
|
||||
+ #[stable(feature = "raw_ext", since = "1.1.0")]
|
||||
+ pub type blkcnt_t = c_longlong;
|
||||
+ #[stable(feature = "raw_ext", since = "1.1.0")]
|
||||
+ pub type blksize_t = c_long;
|
||||
+ #[stable(feature = "raw_ext", since = "1.1.0")]
|
||||
+ pub type ino_t = c_ulonglong;
|
||||
+ #[stable(feature = "raw_ext", since = "1.1.0")]
|
||||
+ pub type nlink_t = c_uint;
|
||||
+ #[stable(feature = "raw_ext", since = "1.1.0")]
|
||||
+ pub type off_t = c_longlong;
|
||||
+ #[stable(feature = "raw_ext", since = "1.1.0")]
|
||||
+ pub type time_t = c_long;
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Clone)]
|
||||
@@ -199,27 +226,31 @@ mod arch {
|
||||
#[stable(feature = "raw_ext", since = "1.1.0")]
|
||||
pub st_ctime_nsec: ::c_long,
|
||||
#[stable(feature = "raw_ext", since = "1.1.0")]
|
||||
- pub __pad3: [::c_int;2],
|
||||
+ pub __pad3: [::c_int; 2],
|
||||
}
|
||||
}
|
||||
|
||||
-#[cfg(any(target_arch = "mips64",
|
||||
- target_arch = "s390x",
|
||||
- target_arch = "sparc64"))]
|
||||
+#[cfg(any(target_arch = "mips64", target_arch = "s390x", target_arch = "sparc64"))]
|
||||
mod arch {
|
||||
- pub use libc::{off_t, ino_t, nlink_t, blksize_t, blkcnt_t, stat, time_t};
|
||||
+ pub use libc::{blkcnt_t, blksize_t, ino_t, nlink_t, off_t, stat, time_t};
|
||||
}
|
||||
|
||||
#[cfg(target_arch = "aarch64")]
|
||||
mod arch {
|
||||
- use crate::os::raw::{c_long, c_int};
|
||||
+ use crate::os::raw::{c_int, c_long};
|
||||
|
||||
- #[stable(feature = "raw_ext", since = "1.1.0")] pub type blkcnt_t = u64;
|
||||
- #[stable(feature = "raw_ext", since = "1.1.0")] pub type blksize_t = u64;
|
||||
- #[stable(feature = "raw_ext", since = "1.1.0")] pub type ino_t = u64;
|
||||
- #[stable(feature = "raw_ext", since = "1.1.0")] pub type nlink_t = u64;
|
||||
- #[stable(feature = "raw_ext", since = "1.1.0")] pub type off_t = u64;
|
||||
- #[stable(feature = "raw_ext", since = "1.1.0")] pub type time_t = i64;
|
||||
+ #[stable(feature = "raw_ext", since = "1.1.0")]
|
||||
+ pub type blkcnt_t = u64;
|
||||
+ #[stable(feature = "raw_ext", since = "1.1.0")]
|
||||
+ pub type blksize_t = u64;
|
||||
+ #[stable(feature = "raw_ext", since = "1.1.0")]
|
||||
+ pub type ino_t = u64;
|
||||
+ #[stable(feature = "raw_ext", since = "1.1.0")]
|
||||
+ pub type nlink_t = u64;
|
||||
+ #[stable(feature = "raw_ext", since = "1.1.0")]
|
||||
+ pub type off_t = u64;
|
||||
+ #[stable(feature = "raw_ext", since = "1.1.0")]
|
||||
+ pub type time_t = i64;
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Clone)]
|
||||
@@ -268,14 +299,20 @@ mod arch {
|
||||
|
||||
#[cfg(any(target_arch = "x86_64", target_arch = "powerpc64"))]
|
||||
mod arch {
|
||||
- use crate::os::raw::{c_long, c_int};
|
||||
+ use crate::os::raw::{c_int, c_long};
|
||||
|
||||
- #[stable(feature = "raw_ext", since = "1.1.0")] pub type blkcnt_t = u64;
|
||||
- #[stable(feature = "raw_ext", since = "1.1.0")] pub type blksize_t = u64;
|
||||
- #[stable(feature = "raw_ext", since = "1.1.0")] pub type ino_t = u64;
|
||||
- #[stable(feature = "raw_ext", since = "1.1.0")] pub type nlink_t = u64;
|
||||
- #[stable(feature = "raw_ext", since = "1.1.0")] pub type off_t = u64;
|
||||
- #[stable(feature = "raw_ext", since = "1.1.0")] pub type time_t = i64;
|
||||
+ #[stable(feature = "raw_ext", since = "1.1.0")]
|
||||
+ pub type blkcnt_t = u64;
|
||||
+ #[stable(feature = "raw_ext", since = "1.1.0")]
|
||||
+ pub type blksize_t = u64;
|
||||
+ #[stable(feature = "raw_ext", since = "1.1.0")]
|
||||
+ pub type ino_t = u64;
|
||||
+ #[stable(feature = "raw_ext", since = "1.1.0")]
|
||||
+ pub type nlink_t = u64;
|
||||
+ #[stable(feature = "raw_ext", since = "1.1.0")]
|
||||
+ pub type off_t = u64;
|
||||
+ #[stable(feature = "raw_ext", since = "1.1.0")]
|
||||
+ pub type time_t = i64;
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Clone)]
|
||||
diff --git a/src/libstd/os/raw/mod.rs b/src/libstd/os/raw/mod.rs
|
||||
index 611a1709c8d..e09012007f2 100644
|
||||
--- a/src/libstd/os/raw/mod.rs
|
||||
+++ b/src/libstd/os/raw/mod.rs
|
||||
@@ -9,85 +9,135 @@
|
||||
#![stable(feature = "raw_os", since = "1.1.0")]
|
||||
|
||||
#[doc(include = "char.md")]
|
||||
-#[cfg(any(all(target_os = "linux", any(target_arch = "aarch64",
|
||||
- target_arch = "arm",
|
||||
- target_arch = "hexagon",
|
||||
- target_arch = "powerpc",
|
||||
- target_arch = "powerpc64",
|
||||
- target_arch = "s390x")),
|
||||
- all(target_os = "android", any(target_arch = "aarch64",
|
||||
- target_arch = "arm")),
|
||||
- all(target_os = "l4re", target_arch = "x86_64"),
|
||||
- all(target_os = "freebsd", any(target_arch = "aarch64",
|
||||
- target_arch = "arm",
|
||||
- target_arch = "powerpc",
|
||||
- target_arch = "powerpc64")),
|
||||
- all(target_os = "netbsd", any(target_arch = "aarch64",
|
||||
- target_arch = "arm",
|
||||
- target_arch = "powerpc")),
|
||||
- all(target_os = "openbsd", target_arch = "aarch64"),
|
||||
- all(target_os = "vxworks", any(target_arch = "aarch64",
|
||||
- target_arch = "arm",
|
||||
- target_arch = "powerpc64",
|
||||
- target_arch = "powerpc")),
|
||||
- all(target_os = "fuchsia", target_arch = "aarch64")))]
|
||||
-#[stable(feature = "raw_os", since = "1.1.0")] pub type c_char = u8;
|
||||
+#[cfg(any(
|
||||
+ all(
|
||||
+ target_os = "linux",
|
||||
+ any(
|
||||
+ target_arch = "aarch64",
|
||||
+ target_arch = "arm",
|
||||
+ target_arch = "hexagon",
|
||||
+ target_arch = "powerpc",
|
||||
+ target_arch = "powerpc64",
|
||||
+ target_arch = "s390x"
|
||||
+ )
|
||||
+ ),
|
||||
+ all(target_os = "android", any(target_arch = "aarch64", target_arch = "arm")),
|
||||
+ all(target_os = "l4re", target_arch = "x86_64"),
|
||||
+ all(
|
||||
+ target_os = "freebsd",
|
||||
+ any(
|
||||
+ target_arch = "aarch64",
|
||||
+ target_arch = "arm",
|
||||
+ target_arch = "powerpc",
|
||||
+ target_arch = "powerpc64"
|
||||
+ )
|
||||
+ ),
|
||||
+ all(
|
||||
+ target_os = "netbsd",
|
||||
+ any(target_arch = "aarch64", target_arch = "arm", target_arch = "powerpc")
|
||||
+ ),
|
||||
+ all(target_os = "openbsd", target_arch = "aarch64"),
|
||||
+ all(
|
||||
+ target_os = "vxworks",
|
||||
+ any(
|
||||
+ target_arch = "aarch64",
|
||||
+ target_arch = "arm",
|
||||
+ target_arch = "powerpc64",
|
||||
+ target_arch = "powerpc"
|
||||
+ )
|
||||
+ ),
|
||||
+ all(target_os = "fuchsia", target_arch = "aarch64")
|
||||
+))]
|
||||
+#[stable(feature = "raw_os", since = "1.1.0")]
|
||||
+pub type c_char = u8;
|
||||
#[doc(include = "char.md")]
|
||||
-#[cfg(not(any(all(target_os = "linux", any(target_arch = "aarch64",
|
||||
- target_arch = "arm",
|
||||
- target_arch = "hexagon",
|
||||
- target_arch = "powerpc",
|
||||
- target_arch = "powerpc64",
|
||||
- target_arch = "s390x")),
|
||||
- all(target_os = "android", any(target_arch = "aarch64",
|
||||
- target_arch = "arm")),
|
||||
- all(target_os = "l4re", target_arch = "x86_64"),
|
||||
- all(target_os = "freebsd", any(target_arch = "aarch64",
|
||||
- target_arch = "arm",
|
||||
- target_arch = "powerpc",
|
||||
- target_arch = "powerpc64")),
|
||||
- all(target_os = "netbsd", any(target_arch = "aarch64",
|
||||
- target_arch = "arm",
|
||||
- target_arch = "powerpc")),
|
||||
- all(target_os = "openbsd", target_arch = "aarch64"),
|
||||
- all(target_os = "vxworks", any(target_arch = "aarch64",
|
||||
- target_arch = "arm",
|
||||
- target_arch = "powerpc64",
|
||||
- target_arch = "powerpc")),
|
||||
- all(target_os = "fuchsia", target_arch = "aarch64"))))]
|
||||
-#[stable(feature = "raw_os", since = "1.1.0")] pub type c_char = i8;
|
||||
+#[cfg(not(any(
|
||||
+ all(
|
||||
+ target_os = "linux",
|
||||
+ any(
|
||||
+ target_arch = "aarch64",
|
||||
+ target_arch = "arm",
|
||||
+ target_arch = "hexagon",
|
||||
+ target_arch = "powerpc",
|
||||
+ target_arch = "powerpc64",
|
||||
+ target_arch = "s390x"
|
||||
+ )
|
||||
+ ),
|
||||
+ all(target_os = "android", any(target_arch = "aarch64", target_arch = "arm")),
|
||||
+ all(target_os = "l4re", target_arch = "x86_64"),
|
||||
+ all(
|
||||
+ target_os = "freebsd",
|
||||
+ any(
|
||||
+ target_arch = "aarch64",
|
||||
+ target_arch = "arm",
|
||||
+ target_arch = "powerpc",
|
||||
+ target_arch = "powerpc64"
|
||||
+ )
|
||||
+ ),
|
||||
+ all(
|
||||
+ target_os = "netbsd",
|
||||
+ any(target_arch = "aarch64", target_arch = "arm", target_arch = "powerpc")
|
||||
+ ),
|
||||
+ all(target_os = "openbsd", target_arch = "aarch64"),
|
||||
+ all(
|
||||
+ target_os = "vxworks",
|
||||
+ any(
|
||||
+ target_arch = "aarch64",
|
||||
+ target_arch = "arm",
|
||||
+ target_arch = "powerpc64",
|
||||
+ target_arch = "powerpc"
|
||||
+ )
|
||||
+ ),
|
||||
+ all(target_os = "fuchsia", target_arch = "aarch64")
|
||||
+)))]
|
||||
+#[stable(feature = "raw_os", since = "1.1.0")]
|
||||
+pub type c_char = i8;
|
||||
#[doc(include = "schar.md")]
|
||||
-#[stable(feature = "raw_os", since = "1.1.0")] pub type c_schar = i8;
|
||||
+#[stable(feature = "raw_os", since = "1.1.0")]
|
||||
+pub type c_schar = i8;
|
||||
#[doc(include = "uchar.md")]
|
||||
-#[stable(feature = "raw_os", since = "1.1.0")] pub type c_uchar = u8;
|
||||
+#[stable(feature = "raw_os", since = "1.1.0")]
|
||||
+pub type c_uchar = u8;
|
||||
#[doc(include = "short.md")]
|
||||
-#[stable(feature = "raw_os", since = "1.1.0")] pub type c_short = i16;
|
||||
+#[stable(feature = "raw_os", since = "1.1.0")]
|
||||
+pub type c_short = i16;
|
||||
#[doc(include = "ushort.md")]
|
||||
-#[stable(feature = "raw_os", since = "1.1.0")] pub type c_ushort = u16;
|
||||
+#[stable(feature = "raw_os", since = "1.1.0")]
|
||||
+pub type c_ushort = u16;
|
||||
#[doc(include = "int.md")]
|
||||
-#[stable(feature = "raw_os", since = "1.1.0")] pub type c_int = i32;
|
||||
+#[stable(feature = "raw_os", since = "1.1.0")]
|
||||
+pub type c_int = i32;
|
||||
#[doc(include = "uint.md")]
|
||||
-#[stable(feature = "raw_os", since = "1.1.0")] pub type c_uint = u32;
|
||||
+#[stable(feature = "raw_os", since = "1.1.0")]
|
||||
+pub type c_uint = u32;
|
||||
#[doc(include = "long.md")]
|
||||
#[cfg(any(target_pointer_width = "32", windows))]
|
||||
-#[stable(feature = "raw_os", since = "1.1.0")] pub type c_long = i32;
|
||||
+#[stable(feature = "raw_os", since = "1.1.0")]
|
||||
+pub type c_long = i32;
|
||||
#[doc(include = "ulong.md")]
|
||||
#[cfg(any(target_pointer_width = "32", windows))]
|
||||
-#[stable(feature = "raw_os", since = "1.1.0")] pub type c_ulong = u32;
|
||||
+#[stable(feature = "raw_os", since = "1.1.0")]
|
||||
+pub type c_ulong = u32;
|
||||
#[doc(include = "long.md")]
|
||||
#[cfg(all(target_pointer_width = "64", not(windows)))]
|
||||
-#[stable(feature = "raw_os", since = "1.1.0")] pub type c_long = i64;
|
||||
+#[stable(feature = "raw_os", since = "1.1.0")]
|
||||
+pub type c_long = i64;
|
||||
#[doc(include = "ulong.md")]
|
||||
#[cfg(all(target_pointer_width = "64", not(windows)))]
|
||||
-#[stable(feature = "raw_os", since = "1.1.0")] pub type c_ulong = u64;
|
||||
+#[stable(feature = "raw_os", since = "1.1.0")]
|
||||
+pub type c_ulong = u64;
|
||||
#[doc(include = "longlong.md")]
|
||||
-#[stable(feature = "raw_os", since = "1.1.0")] pub type c_longlong = i64;
|
||||
+#[stable(feature = "raw_os", since = "1.1.0")]
|
||||
+pub type c_longlong = i64;
|
||||
#[doc(include = "ulonglong.md")]
|
||||
-#[stable(feature = "raw_os", since = "1.1.0")] pub type c_ulonglong = u64;
|
||||
+#[stable(feature = "raw_os", since = "1.1.0")]
|
||||
+pub type c_ulonglong = u64;
|
||||
#[doc(include = "float.md")]
|
||||
-#[stable(feature = "raw_os", since = "1.1.0")] pub type c_float = f32;
|
||||
+#[stable(feature = "raw_os", since = "1.1.0")]
|
||||
+pub type c_float = f32;
|
||||
#[doc(include = "double.md")]
|
||||
-#[stable(feature = "raw_os", since = "1.1.0")] pub type c_double = f64;
|
||||
+#[stable(feature = "raw_os", since = "1.1.0")]
|
||||
+pub type c_double = f64;
|
||||
|
||||
#[stable(feature = "raw_os", since = "1.1.0")]
|
||||
#[doc(no_inline)]
|
||||
74
debian/patches/u-riscv64-format-2.patch
vendored
74
debian/patches/u-riscv64-format-2.patch
vendored
@ -1,74 +0,0 @@
|
||||
commit 4436c9d35498e7ae3da261f6141d6d73b915e1e8
|
||||
gpg: Signature made Sat 30 Nov 2019 02:43:27 GMT
|
||||
gpg: using RSA key 4628C5D82CFF65D68164A78AF9BA143B95FF6D82
|
||||
gpg: Can't check signature: No public key
|
||||
Author: David Tolnay <dtolnay@gmail.com>
|
||||
Date: Wed Nov 27 10:29:00 2019 -0800
|
||||
|
||||
Format libstd with rustfmt
|
||||
|
||||
This commit applies rustfmt with rust-lang/rust's default settings to
|
||||
files in src/libstd *that are not involved in any currently open PR* to
|
||||
minimize merge conflicts. THe list of files involved in open PRs was
|
||||
determined by querying GitHub's GraphQL API with this script:
|
||||
https://gist.github.com/dtolnay/aa9c34993dc051a4f344d1b10e4487e8
|
||||
|
||||
With the list of files from the script in outstanding_files, the
|
||||
relevant commands were:
|
||||
|
||||
$ find src/libstd -name '*.rs' \
|
||||
| xargs rustfmt --edition=2018 --unstable-features --skip-children
|
||||
$ rg libstd outstanding_files | xargs git checkout --
|
||||
|
||||
Repeating this process several months apart should get us coverage of
|
||||
most of the rest of libstd.
|
||||
|
||||
To confirm no funny business:
|
||||
|
||||
$ git checkout $THIS_COMMIT^
|
||||
$ git show --pretty= --name-only $THIS_COMMIT \
|
||||
| xargs rustfmt --edition=2018 --unstable-features --skip-children
|
||||
$ git diff $THIS_COMMIT # there should be no difference
|
||||
|
||||
diff --git a/src/libstd/sys_common/alloc.rs b/src/libstd/sys_common/alloc.rs
|
||||
index 1cfc7ed17f2..713b9949f64 100644
|
||||
--- a/src/libstd/sys_common/alloc.rs
|
||||
+++ b/src/libstd/sys_common/alloc.rs
|
||||
@@ -6,20 +6,24 @@ use crate::ptr;
|
||||
|
||||
// The minimum alignment guaranteed by the architecture. This value is used to
|
||||
// add fast paths for low alignment values.
|
||||
-#[cfg(all(any(target_arch = "x86",
|
||||
- target_arch = "arm",
|
||||
- target_arch = "mips",
|
||||
- target_arch = "powerpc",
|
||||
- target_arch = "powerpc64",
|
||||
- target_arch = "asmjs",
|
||||
- target_arch = "wasm32",
|
||||
- target_arch = "hexagon")))]
|
||||
+#[cfg(all(any(
|
||||
+ target_arch = "x86",
|
||||
+ target_arch = "arm",
|
||||
+ target_arch = "mips",
|
||||
+ target_arch = "powerpc",
|
||||
+ target_arch = "powerpc64",
|
||||
+ target_arch = "asmjs",
|
||||
+ target_arch = "wasm32",
|
||||
+ target_arch = "hexagon"
|
||||
+)))]
|
||||
pub const MIN_ALIGN: usize = 8;
|
||||
-#[cfg(all(any(target_arch = "x86_64",
|
||||
- target_arch = "aarch64",
|
||||
- target_arch = "mips64",
|
||||
- target_arch = "s390x",
|
||||
- target_arch = "sparc64")))]
|
||||
+#[cfg(all(any(
|
||||
+ target_arch = "x86_64",
|
||||
+ target_arch = "aarch64",
|
||||
+ target_arch = "mips64",
|
||||
+ target_arch = "s390x",
|
||||
+ target_arch = "sparc64"
|
||||
+)))]
|
||||
pub const MIN_ALIGN: usize = 16;
|
||||
|
||||
pub unsafe fn realloc_fallback(
|
||||
32
debian/patches/u-rustbuild-rustflags.patch
vendored
32
debian/patches/u-rustbuild-rustflags.patch
vendored
@ -1,32 +0,0 @@
|
||||
Forwarded: https://github.com/rust-lang/rust/pull/66834
|
||||
--- a/src/bootstrap/bootstrap.py
|
||||
+++ b/src/bootstrap/bootstrap.py
|
||||
@@ -628,7 +628,9 @@
|
||||
env["LIBRARY_PATH"] = os.path.join(self.bin_root(), "lib") + \
|
||||
(os.pathsep + env["LIBRARY_PATH"]) \
|
||||
if "LIBRARY_PATH" in env else ""
|
||||
- env["RUSTFLAGS"] = "-Cdebuginfo=2 "
|
||||
+ # preserve existing RUSTFLAGS
|
||||
+ env.setdefault("RUSTFLAGS", "")
|
||||
+ env["RUSTFLAGS"] += " -Cdebuginfo=2"
|
||||
|
||||
build_section = "target.{}".format(self.build_triple())
|
||||
target_features = []
|
||||
@@ -637,13 +639,13 @@
|
||||
elif self.get_toml("crt-static", build_section) == "false":
|
||||
target_features += ["-crt-static"]
|
||||
if target_features:
|
||||
- env["RUSTFLAGS"] += "-C target-feature=" + (",".join(target_features)) + " "
|
||||
+ env["RUSTFLAGS"] += " -C target-feature=" + (",".join(target_features))
|
||||
target_linker = self.get_toml("linker", build_section)
|
||||
if target_linker is not None:
|
||||
- env["RUSTFLAGS"] += "-C linker=" + target_linker + " "
|
||||
- env["RUSTFLAGS"] += " -Wrust_2018_idioms -Wunused_lifetimes "
|
||||
+ env["RUSTFLAGS"] += " -C linker=" + target_linker
|
||||
+ env["RUSTFLAGS"] += " -Wrust_2018_idioms -Wunused_lifetimes"
|
||||
if self.get_toml("deny-warnings", "rust") != "false":
|
||||
- env["RUSTFLAGS"] += "-Dwarnings "
|
||||
+ env["RUSTFLAGS"] += " -Dwarnings"
|
||||
|
||||
env["PATH"] = os.path.join(self.bin_root(), "bin") + \
|
||||
os.pathsep + env["PATH"]
|
||||
1522
debian/patches/u-wasm32-66750.patch
vendored
1522
debian/patches/u-wasm32-66750.patch
vendored
File diff suppressed because it is too large
Load Diff
123
debian/patches/u-wasm32-67267.patch
vendored
123
debian/patches/u-wasm32-67267.patch
vendored
@ -1,123 +0,0 @@
|
||||
commit 641ccd58c168a296f5c36a191660ef63a32a98b9
|
||||
Author: Alex Crichton <alex@alexcrichton.com>
|
||||
Date: Thu Dec 12 14:48:47 2019 -0800
|
||||
|
||||
Fix signature of `__wasilibc_find_relpath`
|
||||
|
||||
Looks like this function changed upstream, so it needs to be adjusted
|
||||
for when used by libstd.
|
||||
|
||||
diff --git a/src/libstd/sys/wasi/fs.rs b/src/libstd/sys/wasi/fs.rs
|
||||
index fad092e35c3..04bfdf67e12 100644
|
||||
--- a/src/libstd/sys/wasi/fs.rs
|
||||
+++ b/src/libstd/sys/wasi/fs.rs
|
||||
@@ -364,7 +364,7 @@ impl OpenOptions {
|
||||
|
||||
impl File {
|
||||
pub fn open(path: &Path, opts: &OpenOptions) -> io::Result<File> {
|
||||
- let (dir, file) = open_parent(path, wasi::RIGHTS_PATH_OPEN)?;
|
||||
+ let (dir, file) = open_parent(path)?;
|
||||
open_at(&dir, &file, opts)
|
||||
}
|
||||
|
||||
@@ -452,7 +452,7 @@ impl DirBuilder {
|
||||
}
|
||||
|
||||
pub fn mkdir(&self, p: &Path) -> io::Result<()> {
|
||||
- let (dir, file) = open_parent(p, wasi::RIGHTS_PATH_CREATE_DIRECTORY)?;
|
||||
+ let (dir, file) = open_parent(p)?;
|
||||
dir.create_directory(osstr2str(file.as_ref())?)
|
||||
}
|
||||
}
|
||||
@@ -478,13 +478,13 @@ pub fn readdir(p: &Path) -> io::Result<ReadDir> {
|
||||
}
|
||||
|
||||
pub fn unlink(p: &Path) -> io::Result<()> {
|
||||
- let (dir, file) = open_parent(p, wasi::RIGHTS_PATH_UNLINK_FILE)?;
|
||||
+ let (dir, file) = open_parent(p)?;
|
||||
dir.unlink_file(osstr2str(file.as_ref())?)
|
||||
}
|
||||
|
||||
pub fn rename(old: &Path, new: &Path) -> io::Result<()> {
|
||||
- let (old, old_file) = open_parent(old, wasi::RIGHTS_PATH_RENAME_SOURCE)?;
|
||||
- let (new, new_file) = open_parent(new, wasi::RIGHTS_PATH_RENAME_TARGET)?;
|
||||
+ let (old, old_file) = open_parent(old)?;
|
||||
+ let (new, new_file) = open_parent(new)?;
|
||||
old.rename(osstr2str(old_file.as_ref())?, &new, osstr2str(new_file.as_ref())?)
|
||||
}
|
||||
|
||||
@@ -495,12 +495,12 @@ pub fn set_perm(_p: &Path, _perm: FilePermissions) -> io::Result<()> {
|
||||
}
|
||||
|
||||
pub fn rmdir(p: &Path) -> io::Result<()> {
|
||||
- let (dir, file) = open_parent(p, wasi::RIGHTS_PATH_REMOVE_DIRECTORY)?;
|
||||
+ let (dir, file) = open_parent(p)?;
|
||||
dir.remove_directory(osstr2str(file.as_ref())?)
|
||||
}
|
||||
|
||||
pub fn readlink(p: &Path) -> io::Result<PathBuf> {
|
||||
- let (dir, file) = open_parent(p, wasi::RIGHTS_PATH_READLINK)?;
|
||||
+ let (dir, file) = open_parent(p)?;
|
||||
read_link(&dir, &file)
|
||||
}
|
||||
|
||||
@@ -536,13 +536,13 @@ fn read_link(fd: &WasiFd, file: &Path) -> io::Result<PathBuf> {
|
||||
}
|
||||
|
||||
pub fn symlink(src: &Path, dst: &Path) -> io::Result<()> {
|
||||
- let (dst, dst_file) = open_parent(dst, wasi::RIGHTS_PATH_SYMLINK)?;
|
||||
+ let (dst, dst_file) = open_parent(dst)?;
|
||||
dst.symlink(osstr2str(src.as_ref())?, osstr2str(dst_file.as_ref())?)
|
||||
}
|
||||
|
||||
pub fn link(src: &Path, dst: &Path) -> io::Result<()> {
|
||||
- let (src, src_file) = open_parent(src, wasi::RIGHTS_PATH_LINK_SOURCE)?;
|
||||
- let (dst, dst_file) = open_parent(dst, wasi::RIGHTS_PATH_LINK_TARGET)?;
|
||||
+ let (src, src_file) = open_parent(src)?;
|
||||
+ let (dst, dst_file) = open_parent(dst)?;
|
||||
src.link(
|
||||
wasi::LOOKUPFLAGS_SYMLINK_FOLLOW,
|
||||
osstr2str(src_file.as_ref())?,
|
||||
@@ -552,12 +552,12 @@ pub fn link(src: &Path, dst: &Path) -> io::Result<()> {
|
||||
}
|
||||
|
||||
pub fn stat(p: &Path) -> io::Result<FileAttr> {
|
||||
- let (dir, file) = open_parent(p, wasi::RIGHTS_PATH_FILESTAT_GET)?;
|
||||
+ let (dir, file) = open_parent(p)?;
|
||||
metadata_at(&dir, wasi::LOOKUPFLAGS_SYMLINK_FOLLOW, &file)
|
||||
}
|
||||
|
||||
pub fn lstat(p: &Path) -> io::Result<FileAttr> {
|
||||
- let (dir, file) = open_parent(p, wasi::RIGHTS_PATH_FILESTAT_GET)?;
|
||||
+ let (dir, file) = open_parent(p)?;
|
||||
metadata_at(&dir, 0, &file)
|
||||
}
|
||||
|
||||
@@ -611,11 +611,11 @@ fn open_at(fd: &WasiFd, path: &Path, opts: &OpenOptions) -> io::Result<File> {
|
||||
///
|
||||
/// Note that this can fail if `p` doesn't look like it can be opened relative
|
||||
/// to any preopened file descriptor.
|
||||
-fn open_parent(p: &Path, rights: wasi::Rights) -> io::Result<(ManuallyDrop<WasiFd>, PathBuf)> {
|
||||
+fn open_parent(p: &Path) -> io::Result<(ManuallyDrop<WasiFd>, PathBuf)> {
|
||||
let p = CString::new(p.as_os_str().as_bytes())?;
|
||||
unsafe {
|
||||
let mut ret = ptr::null();
|
||||
- let fd = libc::__wasilibc_find_relpath(p.as_ptr(), rights, 0, &mut ret);
|
||||
+ let fd = __wasilibc_find_relpath(p.as_ptr(), &mut ret);
|
||||
if fd == -1 {
|
||||
let msg = format!(
|
||||
"failed to find a preopened file descriptor \
|
||||
@@ -635,6 +635,13 @@ fn open_parent(p: &Path, rights: wasi::Rights) -> io::Result<(ManuallyDrop<WasiF
|
||||
|
||||
return Ok((ManuallyDrop::new(WasiFd::from_raw(fd as u32)), path));
|
||||
}
|
||||
+
|
||||
+ extern "C" {
|
||||
+ pub fn __wasilibc_find_relpath(
|
||||
+ path: *const libc::c_char,
|
||||
+ relative_path: *mut *const libc::c_char,
|
||||
+ ) -> libc::c_int;
|
||||
+ }
|
||||
}
|
||||
|
||||
pub fn osstr2str(f: &OsStr) -> io::Result<&str> {
|
||||
Loading…
Reference in New Issue
Block a user