mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-24 05:33:41 +00:00
Auto merge of #111346 - JohnTitor:rollup-6g5cg9z, r=JohnTitor
Rollup of 7 pull requests Successful merges: - #105354 (Add deployment-target --print flag for Apple targets) - #110377 (Update max_atomic_width of armv7r and armv7_sony_vita targets to 64.) - #110638 (STD support for PSVita) - #111211 (Don't compute trait super bounds unless they're positive) - #111315 (Remove `identity_future` from stdlib) - #111331 (Mark s390x condition code register as clobbered in inline assembly) - #111332 (Improve inline asm for LoongArch) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
This commit is contained in:
commit
ce042889f7
@ -1938,9 +1938,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
|
||||
|
||||
[[package]]
|
||||
name = "libc"
|
||||
version = "0.2.142"
|
||||
version = "0.2.143"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6a987beff54b60ffa6d51982e1aa1146bc42f19bd26be28b0586f252fccf5317"
|
||||
checksum = "edc207893e85c5d6be840e969b496b53d94cec8be2d501b214f50daa97fa8024"
|
||||
dependencies = [
|
||||
"rustc-std-workspace-core",
|
||||
]
|
||||
|
@ -236,9 +236,22 @@ impl<'ll, 'tcx> AsmBuilderMethods<'tcx> for Builder<'_, 'll, 'tcx> {
|
||||
InlineAsmArch::Nvptx64 => {}
|
||||
InlineAsmArch::PowerPC | InlineAsmArch::PowerPC64 => {}
|
||||
InlineAsmArch::Hexagon => {}
|
||||
InlineAsmArch::LoongArch64 => {}
|
||||
InlineAsmArch::LoongArch64 => {
|
||||
constraints.extend_from_slice(&[
|
||||
"~{$fcc0}".to_string(),
|
||||
"~{$fcc1}".to_string(),
|
||||
"~{$fcc2}".to_string(),
|
||||
"~{$fcc3}".to_string(),
|
||||
"~{$fcc4}".to_string(),
|
||||
"~{$fcc5}".to_string(),
|
||||
"~{$fcc6}".to_string(),
|
||||
"~{$fcc7}".to_string(),
|
||||
]);
|
||||
}
|
||||
InlineAsmArch::Mips | InlineAsmArch::Mips64 => {}
|
||||
InlineAsmArch::S390x => {}
|
||||
InlineAsmArch::S390x => {
|
||||
constraints.push("~{cc}".to_string());
|
||||
}
|
||||
InlineAsmArch::SpirV => {}
|
||||
InlineAsmArch::Wasm32 | InlineAsmArch::Wasm64 => {}
|
||||
InlineAsmArch::Bpf => {}
|
||||
|
@ -745,6 +745,22 @@ fn print_crate_info(
|
||||
}
|
||||
}
|
||||
}
|
||||
DeploymentTarget => {
|
||||
use rustc_target::spec::current_apple_deployment_target;
|
||||
|
||||
if sess.target.is_like_osx {
|
||||
safe_println!(
|
||||
"deployment_target={}",
|
||||
current_apple_deployment_target(&sess.target)
|
||||
.expect("unknown Apple target OS")
|
||||
)
|
||||
} else {
|
||||
early_error(
|
||||
ErrorOutputType::default(),
|
||||
"only Apple targets currently support deployment version info",
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Compilation::Stop
|
||||
|
@ -657,14 +657,15 @@ pub(super) fn implied_predicates_with_filter(
|
||||
&*tcx.arena.alloc_from_iter(superbounds.predicates().chain(where_bounds_that_match));
|
||||
debug!(?implied_bounds);
|
||||
|
||||
// Now require that immediate supertraits are converted,
|
||||
// which will, in turn, reach indirect supertraits.
|
||||
// Now require that immediate supertraits are converted, which will, in
|
||||
// turn, reach indirect supertraits, so we detect cycles now instead of
|
||||
// overflowing during elaboration.
|
||||
if matches!(filter, PredicateFilter::SelfOnly) {
|
||||
// Now require that immediate supertraits are converted,
|
||||
// which will, in turn, reach indirect supertraits.
|
||||
for &(pred, span) in implied_bounds {
|
||||
debug!("superbound: {:?}", pred);
|
||||
if let ty::PredicateKind::Clause(ty::Clause::Trait(bound)) = pred.kind().skip_binder() {
|
||||
if let ty::PredicateKind::Clause(ty::Clause::Trait(bound)) = pred.kind().skip_binder()
|
||||
&& bound.polarity == ty::ImplPolarity::Positive
|
||||
{
|
||||
tcx.at(span).super_predicates_of(bound.def_id());
|
||||
}
|
||||
}
|
||||
|
@ -599,6 +599,7 @@ pub enum PrintRequest {
|
||||
StackProtectorStrategies,
|
||||
LinkArgs,
|
||||
SplitDebuginfo,
|
||||
DeploymentTarget,
|
||||
}
|
||||
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
@ -1481,7 +1482,7 @@ pub fn rustc_short_optgroups() -> Vec<RustcOptGroup> {
|
||||
"[crate-name|file-names|sysroot|target-libdir|cfg|calling-conventions|\
|
||||
target-list|target-cpus|target-features|relocation-models|code-models|\
|
||||
tls-models|target-spec-json|all-target-specs-json|native-static-libs|\
|
||||
stack-protector-strategies|link-args]",
|
||||
stack-protector-strategies|link-args|deployment-target]",
|
||||
),
|
||||
opt::flagmulti_s("g", "", "Equivalent to -C debuginfo=2"),
|
||||
opt::flagmulti_s("O", "", "Equivalent to -C opt-level=2"),
|
||||
@ -1931,6 +1932,7 @@ fn collect_print_requests(
|
||||
("all-target-specs-json", PrintRequest::AllTargetSpecs),
|
||||
("link-args", PrintRequest::LinkArgs),
|
||||
("split-debuginfo", PrintRequest::SplitDebuginfo),
|
||||
("deployment-target", PrintRequest::DeploymentTarget),
|
||||
];
|
||||
|
||||
prints.extend(matches.opt_strs("print").into_iter().map(|req| {
|
||||
|
@ -33,12 +33,11 @@ impl LoongArchInlineAsmRegClass {
|
||||
|
||||
pub fn supported_types(
|
||||
self,
|
||||
arch: InlineAsmArch,
|
||||
_arch: InlineAsmArch,
|
||||
) -> &'static [(InlineAsmType, Option<Symbol>)] {
|
||||
match (self, arch) {
|
||||
(Self::reg, InlineAsmArch::LoongArch64) => types! { _: I8, I16, I32, I64, F32, F64; },
|
||||
(Self::reg, _) => types! { _: I8, I16, I32, F32; },
|
||||
(Self::freg, _) => types! { _: F32, F64; },
|
||||
match self {
|
||||
Self::reg => types! { _: I8, I16, I32, I64, F32, F64; },
|
||||
Self::freg => types! { _: F32, F64; },
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
use std::{borrow::Cow, env};
|
||||
|
||||
use crate::spec::{cvs, Cc, DebuginfoKind, FramePointer, LinkArgs};
|
||||
use crate::spec::{LinkerFlavor, Lld, SplitDebuginfo, StaticCow, TargetOptions};
|
||||
use crate::spec::{LinkerFlavor, Lld, SplitDebuginfo, StaticCow, Target, TargetOptions};
|
||||
|
||||
#[cfg(test)]
|
||||
#[path = "apple/tests.rs"]
|
||||
@ -179,12 +179,28 @@ pub fn opts(os: &'static str, arch: Arch) -> TargetOptions {
|
||||
}
|
||||
}
|
||||
|
||||
fn deployment_target(var_name: &str) -> Option<(u32, u32)> {
|
||||
let deployment_target = env::var(var_name).ok();
|
||||
deployment_target
|
||||
.as_ref()
|
||||
.and_then(|s| s.split_once('.'))
|
||||
.and_then(|(a, b)| a.parse::<u32>().and_then(|a| b.parse::<u32>().map(|b| (a, b))).ok())
|
||||
pub fn deployment_target(target: &Target) -> Option<String> {
|
||||
let (major, minor) = match &*target.os {
|
||||
"macos" => {
|
||||
// This does not need to be specific. It just needs to handle x86 vs M1.
|
||||
let arch = if target.arch == "x86" || target.arch == "x86_64" { X86_64 } else { Arm64 };
|
||||
macos_deployment_target(arch)
|
||||
}
|
||||
"ios" => ios_deployment_target(),
|
||||
"watchos" => watchos_deployment_target(),
|
||||
"tvos" => tvos_deployment_target(),
|
||||
_ => return None,
|
||||
};
|
||||
|
||||
Some(format!("{major}.{minor}"))
|
||||
}
|
||||
|
||||
fn from_set_deployment_target(var_name: &str) -> Option<(u32, u32)> {
|
||||
let deployment_target = env::var(var_name).ok()?;
|
||||
let (unparsed_major, unparsed_minor) = deployment_target.split_once('.')?;
|
||||
let (major, minor) = (unparsed_major.parse().ok()?, unparsed_minor.parse().ok()?);
|
||||
|
||||
Some((major, minor))
|
||||
}
|
||||
|
||||
fn macos_default_deployment_target(arch: Arch) -> (u32, u32) {
|
||||
@ -198,7 +214,8 @@ fn macos_default_deployment_target(arch: Arch) -> (u32, u32) {
|
||||
}
|
||||
|
||||
fn macos_deployment_target(arch: Arch) -> (u32, u32) {
|
||||
deployment_target("MACOSX_DEPLOYMENT_TARGET")
|
||||
// If you are looking for the default deployment target, prefer `rustc --print deployment-target`.
|
||||
from_set_deployment_target("MACOSX_DEPLOYMENT_TARGET")
|
||||
.unwrap_or_else(|| macos_default_deployment_target(arch))
|
||||
}
|
||||
|
||||
@ -247,7 +264,8 @@ fn link_env_remove(arch: Arch, os: &'static str) -> StaticCow<[StaticCow<str>]>
|
||||
}
|
||||
|
||||
fn ios_deployment_target() -> (u32, u32) {
|
||||
deployment_target("IPHONEOS_DEPLOYMENT_TARGET").unwrap_or((7, 0))
|
||||
// If you are looking for the default deployment target, prefer `rustc --print deployment-target`.
|
||||
from_set_deployment_target("IPHONEOS_DEPLOYMENT_TARGET").unwrap_or((7, 0))
|
||||
}
|
||||
|
||||
pub fn ios_llvm_target(arch: Arch) -> String {
|
||||
@ -272,7 +290,8 @@ pub fn ios_sim_llvm_target(arch: Arch) -> String {
|
||||
}
|
||||
|
||||
fn tvos_deployment_target() -> (u32, u32) {
|
||||
deployment_target("TVOS_DEPLOYMENT_TARGET").unwrap_or((7, 0))
|
||||
// If you are looking for the default deployment target, prefer `rustc --print deployment-target`.
|
||||
from_set_deployment_target("TVOS_DEPLOYMENT_TARGET").unwrap_or((7, 0))
|
||||
}
|
||||
|
||||
fn tvos_lld_platform_version() -> String {
|
||||
@ -281,7 +300,8 @@ fn tvos_lld_platform_version() -> String {
|
||||
}
|
||||
|
||||
fn watchos_deployment_target() -> (u32, u32) {
|
||||
deployment_target("WATCHOS_DEPLOYMENT_TARGET").unwrap_or((5, 0))
|
||||
// If you are looking for the default deployment target, prefer `rustc --print deployment-target`.
|
||||
from_set_deployment_target("WATCHOS_DEPLOYMENT_TARGET").unwrap_or((5, 0))
|
||||
}
|
||||
|
||||
fn watchos_lld_platform_version() -> String {
|
||||
|
@ -16,7 +16,7 @@ pub fn target() -> Target {
|
||||
linker: Some("rust-lld".into()),
|
||||
relocation_model: RelocModel::Static,
|
||||
panic_strategy: PanicStrategy::Abort,
|
||||
max_atomic_width: Some(32),
|
||||
max_atomic_width: Some(64),
|
||||
emit_debug_gdb_scripts: false,
|
||||
// GCC and Clang default to 8 for arm-none here
|
||||
c_enum_min_bits: Some(8),
|
||||
|
@ -17,7 +17,7 @@ pub fn target() -> Target {
|
||||
relocation_model: RelocModel::Static,
|
||||
panic_strategy: PanicStrategy::Abort,
|
||||
features: "+vfp3,-d32,-fp16".into(),
|
||||
max_atomic_width: Some(32),
|
||||
max_atomic_width: Some(64),
|
||||
emit_debug_gdb_scripts: false,
|
||||
// GCC and Clang default to 8 for arm-none here
|
||||
c_enum_min_bits: Some(8),
|
||||
|
@ -9,7 +9,7 @@ pub fn target() -> Target {
|
||||
let pre_link_args = TargetOptions::link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-Wl,-q"]);
|
||||
|
||||
Target {
|
||||
llvm_target: "armv7a-vita-newlibeabihf".into(),
|
||||
llvm_target: "armv7a-vita-eabihf".into(),
|
||||
pointer_width: 32,
|
||||
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
|
||||
arch: "arm".into(),
|
||||
@ -33,7 +33,7 @@ pub fn target() -> Target {
|
||||
pre_link_args,
|
||||
exe_suffix: ".elf".into(),
|
||||
panic_strategy: PanicStrategy::Abort,
|
||||
max_atomic_width: Some(32),
|
||||
max_atomic_width: Some(64),
|
||||
..Default::default()
|
||||
},
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ pub fn target() -> Target {
|
||||
linker: Some("rust-lld".into()),
|
||||
relocation_model: RelocModel::Static,
|
||||
panic_strategy: PanicStrategy::Abort,
|
||||
max_atomic_width: Some(32),
|
||||
max_atomic_width: Some(64),
|
||||
emit_debug_gdb_scripts: false,
|
||||
// GCC and Clang default to 8 for arm-none here
|
||||
c_enum_min_bits: Some(8),
|
||||
|
@ -16,7 +16,7 @@ pub fn target() -> Target {
|
||||
relocation_model: RelocModel::Static,
|
||||
panic_strategy: PanicStrategy::Abort,
|
||||
features: "+vfp3,-d32,-fp16".into(),
|
||||
max_atomic_width: Some(32),
|
||||
max_atomic_width: Some(64),
|
||||
emit_debug_gdb_scripts: false,
|
||||
// GCC and Clang default to 8 for arm-none here
|
||||
c_enum_min_bits: Some(8),
|
||||
|
@ -60,6 +60,7 @@ pub mod crt_objects;
|
||||
mod aix_base;
|
||||
mod android_base;
|
||||
mod apple_base;
|
||||
pub use apple_base::deployment_target as current_apple_deployment_target;
|
||||
mod avr_gnu_base;
|
||||
mod bpf_base;
|
||||
mod dragonfly_base;
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 8ad84ca5ad88ade697637387e7cb4d7c3cf4bde8
|
||||
Subproject commit 4245978ca8169c40c088ff733825e4527f7b914c
|
@ -66,10 +66,3 @@ pub unsafe fn get_context<'a, 'b>(cx: ResumeTy) -> &'a mut Context<'b> {
|
||||
// that fulfills all the requirements for a mutable reference.
|
||||
unsafe { &mut *cx.0.as_ptr().cast() }
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
#[unstable(feature = "gen_future", issue = "50547")]
|
||||
#[inline]
|
||||
pub const fn identity_future<O, Fut: Future<Output = O>>(f: Fut) -> Fut {
|
||||
f
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ cfg-if = { version = "1.0", features = ['rustc-dep-of-std'] }
|
||||
panic_unwind = { path = "../panic_unwind", optional = true }
|
||||
panic_abort = { path = "../panic_abort" }
|
||||
core = { path = "../core" }
|
||||
libc = { version = "0.2.142", default-features = false, features = ['rustc-dep-of-std'] }
|
||||
libc = { version = "0.2.143", default-features = false, features = ['rustc-dep-of-std'] }
|
||||
compiler_builtins = { version = "0.1.91" }
|
||||
profiler_builtins = { path = "../profiler_builtins", optional = true }
|
||||
unwind = { path = "../unwind" }
|
||||
|
@ -34,6 +34,7 @@ fn main() {
|
||||
|| target.contains("espidf")
|
||||
|| target.contains("solid")
|
||||
|| target.contains("nintendo-3ds")
|
||||
|| target.contains("vita")
|
||||
|| target.contains("nto")
|
||||
{
|
||||
// These platforms don't have any special requirements.
|
||||
|
@ -137,6 +137,8 @@ pub mod redox;
|
||||
pub mod solaris;
|
||||
#[cfg(target_os = "solid_asp3")]
|
||||
pub mod solid;
|
||||
#[cfg(target_os = "vita")]
|
||||
pub mod vita;
|
||||
#[cfg(target_os = "vxworks")]
|
||||
pub mod vxworks;
|
||||
#[cfg(target_os = "watchos")]
|
||||
|
@ -73,6 +73,8 @@ mod platform {
|
||||
pub use crate::os::redox::*;
|
||||
#[cfg(target_os = "solaris")]
|
||||
pub use crate::os::solaris::*;
|
||||
#[cfg(target_os = "vita")]
|
||||
pub use crate::os::vita::*;
|
||||
#[cfg(target_os = "vxworks")]
|
||||
pub use crate::os::vxworks::*;
|
||||
#[cfg(target_os = "watchos")]
|
||||
|
95
library/std/src/os/vita/fs.rs
Normal file
95
library/std/src/os/vita/fs.rs
Normal file
@ -0,0 +1,95 @@
|
||||
#![stable(feature = "metadata_ext", since = "1.1.0")]
|
||||
|
||||
use crate::fs::Metadata;
|
||||
use crate::sys_common::AsInner;
|
||||
|
||||
/// OS-specific extensions to [`fs::Metadata`].
|
||||
///
|
||||
/// [`fs::Metadata`]: crate::fs::Metadata
|
||||
#[stable(feature = "metadata_ext", since = "1.1.0")]
|
||||
pub trait MetadataExt {
|
||||
#[stable(feature = "metadata_ext2", since = "1.8.0")]
|
||||
fn st_dev(&self) -> u64;
|
||||
#[stable(feature = "metadata_ext2", since = "1.8.0")]
|
||||
fn st_ino(&self) -> u64;
|
||||
#[stable(feature = "metadata_ext2", since = "1.8.0")]
|
||||
fn st_mode(&self) -> u32;
|
||||
#[stable(feature = "metadata_ext2", since = "1.8.0")]
|
||||
fn st_nlink(&self) -> u64;
|
||||
#[stable(feature = "metadata_ext2", since = "1.8.0")]
|
||||
fn st_uid(&self) -> u32;
|
||||
#[stable(feature = "metadata_ext2", since = "1.8.0")]
|
||||
fn st_gid(&self) -> u32;
|
||||
#[stable(feature = "metadata_ext2", since = "1.8.0")]
|
||||
fn st_rdev(&self) -> u64;
|
||||
#[stable(feature = "metadata_ext2", since = "1.8.0")]
|
||||
fn st_size(&self) -> u64;
|
||||
#[stable(feature = "metadata_ext2", since = "1.8.0")]
|
||||
fn st_atime(&self) -> i64;
|
||||
#[stable(feature = "metadata_ext2", since = "1.8.0")]
|
||||
fn st_atime_nsec(&self) -> i64;
|
||||
#[stable(feature = "metadata_ext2", since = "1.8.0")]
|
||||
fn st_mtime(&self) -> i64;
|
||||
#[stable(feature = "metadata_ext2", since = "1.8.0")]
|
||||
fn st_mtime_nsec(&self) -> i64;
|
||||
#[stable(feature = "metadata_ext2", since = "1.8.0")]
|
||||
fn st_ctime(&self) -> i64;
|
||||
#[stable(feature = "metadata_ext2", since = "1.8.0")]
|
||||
fn st_ctime_nsec(&self) -> i64;
|
||||
#[stable(feature = "metadata_ext2", since = "1.8.0")]
|
||||
fn st_blksize(&self) -> u64;
|
||||
#[stable(feature = "metadata_ext2", since = "1.8.0")]
|
||||
fn st_blocks(&self) -> u64;
|
||||
}
|
||||
|
||||
#[stable(feature = "metadata_ext", since = "1.1.0")]
|
||||
impl MetadataExt for Metadata {
|
||||
fn st_dev(&self) -> u64 {
|
||||
self.as_inner().as_inner().st_dev as u64
|
||||
}
|
||||
fn st_ino(&self) -> u64 {
|
||||
self.as_inner().as_inner().st_ino as u64
|
||||
}
|
||||
fn st_mode(&self) -> u32 {
|
||||
self.as_inner().as_inner().st_mode as u32
|
||||
}
|
||||
fn st_nlink(&self) -> u64 {
|
||||
self.as_inner().as_inner().st_nlink as u64
|
||||
}
|
||||
fn st_uid(&self) -> u32 {
|
||||
self.as_inner().as_inner().st_uid as u32
|
||||
}
|
||||
fn st_gid(&self) -> u32 {
|
||||
self.as_inner().as_inner().st_gid as u32
|
||||
}
|
||||
fn st_rdev(&self) -> u64 {
|
||||
self.as_inner().as_inner().st_rdev as u64
|
||||
}
|
||||
fn st_size(&self) -> u64 {
|
||||
self.as_inner().as_inner().st_size as u64
|
||||
}
|
||||
fn st_atime(&self) -> i64 {
|
||||
self.as_inner().as_inner().st_atime as i64
|
||||
}
|
||||
fn st_atime_nsec(&self) -> i64 {
|
||||
0
|
||||
}
|
||||
fn st_mtime(&self) -> i64 {
|
||||
self.as_inner().as_inner().st_mtime as i64
|
||||
}
|
||||
fn st_mtime_nsec(&self) -> i64 {
|
||||
0
|
||||
}
|
||||
fn st_ctime(&self) -> i64 {
|
||||
self.as_inner().as_inner().st_ctime as i64
|
||||
}
|
||||
fn st_ctime_nsec(&self) -> i64 {
|
||||
0
|
||||
}
|
||||
fn st_blksize(&self) -> u64 {
|
||||
self.as_inner().as_inner().st_blksize as u64
|
||||
}
|
||||
fn st_blocks(&self) -> u64 {
|
||||
self.as_inner().as_inner().st_blocks as u64
|
||||
}
|
||||
}
|
6
library/std/src/os/vita/mod.rs
Normal file
6
library/std/src/os/vita/mod.rs
Normal file
@ -0,0 +1,6 @@
|
||||
//! Definitions for vita
|
||||
|
||||
#![stable(feature = "raw_ext", since = "1.1.0")]
|
||||
|
||||
pub mod fs;
|
||||
pub(crate) mod raw;
|
70
library/std/src/os/vita/raw.rs
Normal file
70
library/std/src/os/vita/raw.rs
Normal file
@ -0,0 +1,70 @@
|
||||
//! vita raw type definitions
|
||||
|
||||
#![stable(feature = "raw_ext", since = "1.1.0")]
|
||||
#![deprecated(
|
||||
since = "1.8.0",
|
||||
note = "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)]
|
||||
|
||||
use crate::os::raw::c_long;
|
||||
use crate::os::unix::raw::{gid_t, uid_t};
|
||||
|
||||
#[stable(feature = "pthread_t", since = "1.8.0")]
|
||||
pub type pthread_t = libc::pthread_t;
|
||||
|
||||
#[stable(feature = "raw_ext", since = "1.1.0")]
|
||||
pub type blkcnt_t = libc::blkcnt_t;
|
||||
|
||||
#[stable(feature = "raw_ext", since = "1.1.0")]
|
||||
pub type blksize_t = libc::blksize_t;
|
||||
#[stable(feature = "raw_ext", since = "1.1.0")]
|
||||
pub type dev_t = libc::dev_t;
|
||||
#[stable(feature = "raw_ext", since = "1.1.0")]
|
||||
pub type ino_t = libc::ino_t;
|
||||
#[stable(feature = "raw_ext", since = "1.1.0")]
|
||||
pub type mode_t = libc::mode_t;
|
||||
#[stable(feature = "raw_ext", since = "1.1.0")]
|
||||
pub type nlink_t = libc::nlink_t;
|
||||
#[stable(feature = "raw_ext", since = "1.1.0")]
|
||||
pub type off_t = libc::off_t;
|
||||
|
||||
#[stable(feature = "raw_ext", since = "1.1.0")]
|
||||
pub type time_t = libc::time_t;
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Clone)]
|
||||
#[stable(feature = "raw_ext", since = "1.1.0")]
|
||||
pub struct stat {
|
||||
#[stable(feature = "raw_ext", since = "1.1.0")]
|
||||
pub st_dev: dev_t,
|
||||
#[stable(feature = "raw_ext", since = "1.1.0")]
|
||||
pub st_ino: ino_t,
|
||||
#[stable(feature = "raw_ext", since = "1.1.0")]
|
||||
pub st_mode: mode_t,
|
||||
#[stable(feature = "raw_ext", since = "1.1.0")]
|
||||
pub st_nlink: nlink_t,
|
||||
#[stable(feature = "raw_ext", since = "1.1.0")]
|
||||
pub st_uid: uid_t,
|
||||
#[stable(feature = "raw_ext", since = "1.1.0")]
|
||||
pub st_gid: gid_t,
|
||||
#[stable(feature = "raw_ext", since = "1.1.0")]
|
||||
pub st_rdev: dev_t,
|
||||
#[stable(feature = "raw_ext", since = "1.1.0")]
|
||||
pub st_size: off_t,
|
||||
#[stable(feature = "raw_ext", since = "1.1.0")]
|
||||
pub st_atime: time_t,
|
||||
#[stable(feature = "raw_ext", since = "1.1.0")]
|
||||
pub st_mtime: time_t,
|
||||
#[stable(feature = "raw_ext", since = "1.1.0")]
|
||||
pub st_ctime: time_t,
|
||||
#[stable(feature = "raw_ext", since = "1.1.0")]
|
||||
pub st_blksize: blksize_t,
|
||||
#[stable(feature = "raw_ext", since = "1.1.0")]
|
||||
pub st_blocks: blkcnt_t,
|
||||
#[stable(feature = "raw_ext", since = "1.1.0")]
|
||||
pub st_spare4: [c_long; 2usize],
|
||||
}
|
@ -59,7 +59,8 @@ cfg_if::cfg_if! {
|
||||
target_os = "redox",
|
||||
target_os = "solaris",
|
||||
target_os = "espidf",
|
||||
target_os = "horizon"
|
||||
target_os = "horizon",
|
||||
target_os = "vita",
|
||||
))] {
|
||||
#[inline]
|
||||
unsafe fn aligned_malloc(layout: &Layout) -> *mut u8 {
|
||||
|
@ -265,7 +265,7 @@ mod imp {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(target_os = "espidf")]
|
||||
#[cfg(any(target_os = "espidf", target_os = "vita"))]
|
||||
mod imp {
|
||||
use super::Args;
|
||||
|
||||
|
@ -141,6 +141,17 @@ pub mod os {
|
||||
pub const EXE_EXTENSION: &str = "elf";
|
||||
}
|
||||
|
||||
#[cfg(target_os = "vita")]
|
||||
pub mod os {
|
||||
pub const FAMILY: &str = "unix";
|
||||
pub const OS: &str = "vita";
|
||||
pub const DLL_PREFIX: &str = "lib";
|
||||
pub const DLL_SUFFIX: &str = ".so";
|
||||
pub const DLL_EXTENSION: &str = "so";
|
||||
pub const EXE_SUFFIX: &str = ".elf";
|
||||
pub const EXE_EXTENSION: &str = "elf";
|
||||
}
|
||||
|
||||
#[cfg(all(target_os = "emscripten", target_arch = "asmjs"))]
|
||||
pub mod os {
|
||||
pub const FAMILY: &str = "unix";
|
||||
|
@ -75,6 +75,7 @@ const fn max_iov() -> usize {
|
||||
target_os = "nto",
|
||||
target_os = "openbsd",
|
||||
target_os = "horizon",
|
||||
target_os = "vita",
|
||||
target_os = "watchos",
|
||||
)))]
|
||||
const fn max_iov() -> usize {
|
||||
@ -93,7 +94,7 @@ impl FileDesc {
|
||||
Ok(ret as usize)
|
||||
}
|
||||
|
||||
#[cfg(not(any(target_os = "espidf", target_os = "horizon")))]
|
||||
#[cfg(not(any(target_os = "espidf", target_os = "horizon", target_os = "vita")))]
|
||||
pub fn read_vectored(&self, bufs: &mut [IoSliceMut<'_>]) -> io::Result<usize> {
|
||||
let ret = cvt(unsafe {
|
||||
libc::readv(
|
||||
@ -105,14 +106,14 @@ impl FileDesc {
|
||||
Ok(ret as usize)
|
||||
}
|
||||
|
||||
#[cfg(any(target_os = "espidf", target_os = "horizon"))]
|
||||
#[cfg(any(target_os = "espidf", target_os = "horizon", target_os = "vita"))]
|
||||
pub fn read_vectored(&self, bufs: &mut [IoSliceMut<'_>]) -> io::Result<usize> {
|
||||
io::default_read_vectored(|b| self.read(b), bufs)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn is_read_vectored(&self) -> bool {
|
||||
cfg!(not(any(target_os = "espidf", target_os = "horizon")))
|
||||
cfg!(not(any(target_os = "espidf", target_os = "horizon", target_os = "vita")))
|
||||
}
|
||||
|
||||
pub fn read_to_end(&self, buf: &mut Vec<u8>) -> io::Result<usize> {
|
||||
@ -253,7 +254,7 @@ impl FileDesc {
|
||||
Ok(ret as usize)
|
||||
}
|
||||
|
||||
#[cfg(not(any(target_os = "espidf", target_os = "horizon")))]
|
||||
#[cfg(not(any(target_os = "espidf", target_os = "horizon", target_os = "vita")))]
|
||||
pub fn write_vectored(&self, bufs: &[IoSlice<'_>]) -> io::Result<usize> {
|
||||
let ret = cvt(unsafe {
|
||||
libc::writev(
|
||||
@ -265,14 +266,14 @@ impl FileDesc {
|
||||
Ok(ret as usize)
|
||||
}
|
||||
|
||||
#[cfg(any(target_os = "espidf", target_os = "horizon"))]
|
||||
#[cfg(any(target_os = "espidf", target_os = "horizon", target_os = "vita"))]
|
||||
pub fn write_vectored(&self, bufs: &[IoSlice<'_>]) -> io::Result<usize> {
|
||||
io::default_write_vectored(|b| self.write(b), bufs)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn is_write_vectored(&self) -> bool {
|
||||
cfg!(not(any(target_os = "espidf", target_os = "horizon")))
|
||||
cfg!(not(any(target_os = "espidf", target_os = "horizon", target_os = "vita")))
|
||||
}
|
||||
|
||||
pub fn write_at(&self, buf: &[u8], offset: u64) -> io::Result<usize> {
|
||||
|
@ -447,7 +447,12 @@ impl FileAttr {
|
||||
|
||||
#[cfg(not(any(target_os = "netbsd", target_os = "nto")))]
|
||||
impl FileAttr {
|
||||
#[cfg(not(any(target_os = "vxworks", target_os = "espidf", target_os = "horizon")))]
|
||||
#[cfg(not(any(
|
||||
target_os = "vxworks",
|
||||
target_os = "espidf",
|
||||
target_os = "horizon",
|
||||
target_os = "vita"
|
||||
)))]
|
||||
pub fn modified(&self) -> io::Result<SystemTime> {
|
||||
#[cfg(target_pointer_width = "32")]
|
||||
cfg_has_statx! {
|
||||
@ -459,7 +464,7 @@ impl FileAttr {
|
||||
Ok(SystemTime::new(self.stat.st_mtime as i64, self.stat.st_mtime_nsec as i64))
|
||||
}
|
||||
|
||||
#[cfg(any(target_os = "vxworks", target_os = "espidf"))]
|
||||
#[cfg(any(target_os = "vxworks", target_os = "espidf", target_os = "vita"))]
|
||||
pub fn modified(&self) -> io::Result<SystemTime> {
|
||||
Ok(SystemTime::new(self.stat.st_mtime as i64, 0))
|
||||
}
|
||||
@ -469,7 +474,12 @@ impl FileAttr {
|
||||
Ok(SystemTime::from(self.stat.st_mtim))
|
||||
}
|
||||
|
||||
#[cfg(not(any(target_os = "vxworks", target_os = "espidf", target_os = "horizon")))]
|
||||
#[cfg(not(any(
|
||||
target_os = "vxworks",
|
||||
target_os = "espidf",
|
||||
target_os = "horizon",
|
||||
target_os = "vita"
|
||||
)))]
|
||||
pub fn accessed(&self) -> io::Result<SystemTime> {
|
||||
#[cfg(target_pointer_width = "32")]
|
||||
cfg_has_statx! {
|
||||
@ -481,7 +491,7 @@ impl FileAttr {
|
||||
Ok(SystemTime::new(self.stat.st_atime as i64, self.stat.st_atime_nsec as i64))
|
||||
}
|
||||
|
||||
#[cfg(any(target_os = "vxworks", target_os = "espidf"))]
|
||||
#[cfg(any(target_os = "vxworks", target_os = "espidf", target_os = "vita"))]
|
||||
pub fn accessed(&self) -> io::Result<SystemTime> {
|
||||
Ok(SystemTime::new(self.stat.st_atime as i64, 0))
|
||||
}
|
||||
@ -866,6 +876,7 @@ impl DirEntry {
|
||||
target_os = "vxworks",
|
||||
target_os = "espidf",
|
||||
target_os = "horizon",
|
||||
target_os = "vita",
|
||||
target_os = "nto",
|
||||
))]
|
||||
pub fn ino(&self) -> u64 {
|
||||
|
@ -92,6 +92,7 @@ pub unsafe fn init(argc: isize, argv: *const *const u8, sigpipe: u8) {
|
||||
target_os = "redox",
|
||||
target_os = "l4re",
|
||||
target_os = "horizon",
|
||||
target_os = "vita",
|
||||
)))]
|
||||
'poll: {
|
||||
use crate::sys::os::errno;
|
||||
@ -140,6 +141,7 @@ pub unsafe fn init(argc: isize, argv: *const *const u8, sigpipe: u8) {
|
||||
target_os = "vxworks",
|
||||
target_os = "l4re",
|
||||
target_os = "horizon",
|
||||
target_os = "vita",
|
||||
)))]
|
||||
{
|
||||
use crate::sys::os::errno;
|
||||
@ -162,7 +164,12 @@ pub unsafe fn init(argc: isize, argv: *const *const u8, sigpipe: u8) {
|
||||
}
|
||||
|
||||
unsafe fn reset_sigpipe(#[allow(unused_variables)] sigpipe: u8) {
|
||||
#[cfg(not(any(target_os = "emscripten", target_os = "fuchsia", target_os = "horizon")))]
|
||||
#[cfg(not(any(
|
||||
target_os = "emscripten",
|
||||
target_os = "fuchsia",
|
||||
target_os = "horizon",
|
||||
target_os = "vita"
|
||||
)))]
|
||||
{
|
||||
// We don't want to add this as a public type to std, nor do we
|
||||
// want to `include!` a file from the compiler (which would break
|
||||
@ -199,7 +206,8 @@ pub unsafe fn init(argc: isize, argv: *const *const u8, sigpipe: u8) {
|
||||
target_os = "espidf",
|
||||
target_os = "emscripten",
|
||||
target_os = "fuchsia",
|
||||
target_os = "horizon"
|
||||
target_os = "horizon",
|
||||
target_os = "vita"
|
||||
)))]
|
||||
static UNIX_SIGPIPE_ATTR_SPECIFIED: crate::sync::atomic::AtomicBool =
|
||||
crate::sync::atomic::AtomicBool::new(false);
|
||||
@ -208,7 +216,8 @@ static UNIX_SIGPIPE_ATTR_SPECIFIED: crate::sync::atomic::AtomicBool =
|
||||
target_os = "espidf",
|
||||
target_os = "emscripten",
|
||||
target_os = "fuchsia",
|
||||
target_os = "horizon"
|
||||
target_os = "horizon",
|
||||
target_os = "vita",
|
||||
)))]
|
||||
pub(crate) fn unix_sigpipe_attr_specified() -> bool {
|
||||
UNIX_SIGPIPE_ATTR_SPECIFIED.load(crate::sync::atomic::Ordering::Relaxed)
|
||||
@ -402,7 +411,7 @@ cfg_if::cfg_if! {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(target_os = "espidf", target_os = "horizon"))]
|
||||
#[cfg(any(target_os = "espidf", target_os = "horizon", target_os = "vita"))]
|
||||
mod unsupported {
|
||||
use crate::io;
|
||||
|
||||
|
@ -460,7 +460,7 @@ pub fn current_exe() -> io::Result<PathBuf> {
|
||||
path.canonicalize()
|
||||
}
|
||||
|
||||
#[cfg(any(target_os = "espidf", target_os = "horizon"))]
|
||||
#[cfg(any(target_os = "espidf", target_os = "horizon", target_os = "vita"))]
|
||||
pub fn current_exe() -> io::Result<PathBuf> {
|
||||
super::unsupported::unsupported()
|
||||
}
|
||||
@ -614,7 +614,8 @@ pub fn home_dir() -> Option<PathBuf> {
|
||||
target_os = "redox",
|
||||
target_os = "vxworks",
|
||||
target_os = "espidf",
|
||||
target_os = "horizon"
|
||||
target_os = "horizon",
|
||||
target_os = "vita",
|
||||
))]
|
||||
unsafe fn fallback() -> Option<OsString> {
|
||||
None
|
||||
@ -627,7 +628,8 @@ pub fn home_dir() -> Option<PathBuf> {
|
||||
target_os = "redox",
|
||||
target_os = "vxworks",
|
||||
target_os = "espidf",
|
||||
target_os = "horizon"
|
||||
target_os = "horizon",
|
||||
target_os = "vita",
|
||||
)))]
|
||||
unsafe fn fallback() -> Option<OsString> {
|
||||
let amt = match libc::sysconf(libc::_SC_GETPW_R_SIZE_MAX) {
|
||||
|
@ -14,7 +14,7 @@ cfg_if::cfg_if! {
|
||||
} else if #[cfg(target_os = "vxworks")] {
|
||||
#[path = "process_vxworks.rs"]
|
||||
mod process_inner;
|
||||
} else if #[cfg(any(target_os = "espidf", target_os = "horizon"))] {
|
||||
} else if #[cfg(any(target_os = "espidf", target_os = "horizon", target_os = "vita"))] {
|
||||
#[path = "process_unsupported.rs"]
|
||||
mod process_inner;
|
||||
} else {
|
||||
|
@ -21,7 +21,8 @@ pub fn hashmap_random_keys() -> (u64, u64) {
|
||||
not(target_os = "fuchsia"),
|
||||
not(target_os = "redox"),
|
||||
not(target_os = "vxworks"),
|
||||
not(target_os = "emscripten")
|
||||
not(target_os = "emscripten"),
|
||||
not(target_os = "vita"),
|
||||
))]
|
||||
mod imp {
|
||||
use crate::fs::File;
|
||||
@ -175,7 +176,7 @@ mod imp {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(target_os = "openbsd", target_os = "emscripten"))]
|
||||
#[cfg(any(target_os = "openbsd", target_os = "emscripten", target_os = "vita"))]
|
||||
mod imp {
|
||||
use crate::sys::os::errno;
|
||||
|
||||
|
@ -248,8 +248,14 @@ The valid types of print values are:
|
||||
exact format of this debugging output is not a stable guarantee, other than
|
||||
that it will include the linker executable and the text of each command-line
|
||||
argument passed to the linker.
|
||||
- `deployment-target` - The currently selected [deployment target] (or minimum OS version)
|
||||
for the selected Apple platform target. This value can be used or passed along to other
|
||||
components alongside a Rust build that need this information, such as C compilers.
|
||||
This returns rustc's minimum supported deployment target if no `*_DEPLOYMENT_TARGET` variable
|
||||
is present in the environment, or otherwise returns the variable's parsed value.
|
||||
|
||||
[conditional compilation]: ../reference/conditional-compilation.html
|
||||
[deployment target]: https://developer.apple.com/library/archive/documentation/DeveloperTools/Conceptual/cross_development/Configuring/configuring.html
|
||||
|
||||
<a id="option-g-debug"></a>
|
||||
## `-g`: include debug information
|
||||
|
@ -1,26 +1,40 @@
|
||||
# armv7-sony-vita-eabihf
|
||||
# armv7-sony-vita-newlibeabihf
|
||||
|
||||
**Tier: 3**
|
||||
|
||||
This tier supports the ARM Cortex A9 processor running on a PlayStation Vita console. `armv7-vita-newlibeabihf` aims to have support for `std` crate using `newlib` as a bridge.
|
||||
|
||||
Rust support for this target is not affiliated with Sony, and is not derived
|
||||
from nor used with any official Sony SDK.
|
||||
|
||||
## Designated Developers
|
||||
|
||||
* [@amg98](https://github.com/amg98)
|
||||
* [@nikarh](https://github.com/nikarh)
|
||||
|
||||
## Requirements
|
||||
|
||||
This target is cross compiled, and requires installing [VITASDK](https://vitasdk.org/) toolchain on your system.
|
||||
This target is cross-compiled, and requires installing [VITASDK](https://vitasdk.org/) toolchain on your system. Dynamic linking is not supported.
|
||||
|
||||
`#![no_std]` crates can be built using `build-std` to build `core`, and optionally
|
||||
`alloc`, and `panic_abort`.
|
||||
|
||||
`std` is partially supported, but mostly works. Some APIs are unimplemented
|
||||
and will simply return an error, such as `std::process`. An allocator is provided
|
||||
by default.
|
||||
|
||||
In order to support some APIs, binaries must be linked against `libc` written
|
||||
for the target, using a linker for the target. These are provided by the
|
||||
VITASDK toolchain.
|
||||
|
||||
This target generates binaries in the ELF format.
|
||||
|
||||
## Building
|
||||
|
||||
You can build Rust with support for the target by adding it to the `target`
|
||||
list in `config.toml`:
|
||||
Rust does not ship pre-compiled artifacts for this target. You can use `build-std` flag to build binaries with `std`:
|
||||
|
||||
```toml
|
||||
[build]
|
||||
build-stage = 1
|
||||
target = ["armv7-sony-vita-newlibeabihf"]
|
||||
```sh
|
||||
cargo build -Z build-std=std,panic_abort --target=armv7-sony-vita-newlibeabihf --release
|
||||
```
|
||||
|
||||
## Cross-compilation
|
||||
@ -33,26 +47,81 @@ Currently there is no support to run the rustc test suite for this target.
|
||||
|
||||
## Building and Running Rust Programs
|
||||
|
||||
To test your developed rust programs for PlayStation Vita, first you have to prepare a proper executable for the device using the resulting ELF file you get from compilation step. The needed steps can be automated using tools like `cargo-make`. Use the example below as a template for your project:
|
||||
`std` support for this target relies on newlib. In order to work, newlib must be initialized correctly. The easiest way to achieve this with VITASDK newlib implementation is by compiling your program as a staticlib with and exposing your main function from rust to `_init` function in `crt0`.
|
||||
|
||||
Add this to your `Cargo.toml`:
|
||||
|
||||
```toml
|
||||
[lib]
|
||||
crate-type = ["staticlib"]
|
||||
|
||||
[profile.release]
|
||||
panic = 'abort'
|
||||
lto = true
|
||||
opt-level = 3
|
||||
```
|
||||
|
||||
Your entrypoint should look roughly like this, `src/lib.rs`:
|
||||
```rust,ignore,no_run
|
||||
#[used]
|
||||
#[export_name = "_newlib_heap_size_user"]
|
||||
pub static _NEWLIB_HEAP_SIZE_USER: u32 = 100 * 1024 * 1024; // Default heap size is only 32mb, increase it to something suitable for your application
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn main() {
|
||||
println!("Hello, world!");
|
||||
}
|
||||
```
|
||||
|
||||
To test your developed rust programs on PlayStation Vita, first you must correctly link and package your rust staticlib. These steps can be preformed using tools available in VITASDK, and can be automated using tools like `cargo-make`.
|
||||
|
||||
First, set up environment variables for `VITASDK`, and it's binaries:
|
||||
|
||||
```sh
|
||||
export VITASDK=/opt/vitasdk
|
||||
export PATH=$PATH:$VITASDK/bin
|
||||
```
|
||||
|
||||
Use the example below as a template for your project:
|
||||
|
||||
```toml
|
||||
[env]
|
||||
TITLE = "Rust Hello World"
|
||||
TITLEID = "RUST00001"
|
||||
# Add other libs required by your project here
|
||||
LINKER_LIBS = "-lpthread -lm -lmathneon"
|
||||
|
||||
# At least a "sce_sys" folder should be place there for app metadata (title, icons, description...)
|
||||
# You can find sample assets for that on $VITASDK/share/gcc-arm-vita-eabi/samples/hello_world/sce_sys/
|
||||
STATIC_DIR = "static" # Folder where static assets should be placed (sce_sys folder is at $STATIC_DIR/sce_sys)
|
||||
CARGO_TARGET_DIR = { script = ["echo ${CARGO_TARGET_DIR:=target}"] }
|
||||
RUST_TARGET_PATH = { script = ["echo $(pwd)"]}
|
||||
RUST_TARGET = "armv7-sony-vita-newlibeabihf"
|
||||
CARGO_OUT_DIR = "${CARGO_TARGET_DIR}/${RUST_TARGET}/release"
|
||||
|
||||
[tasks.xbuild]
|
||||
# This is the command where you get the ELF executable file (e.g. call to cargo build)
|
||||
TARGET_LINKER = "arm-vita-eabi-gcc"
|
||||
TARGET_LINKER_FLAGS = "-Wl,-q"
|
||||
|
||||
[tasks.build]
|
||||
description = "Build the project using `cargo` as a static lib."
|
||||
command = "cargo"
|
||||
args = ["build", "-Z", "build-std=std,panic_abort", "--target=armv7-sony-vita-newlibeabihf", "--release"]
|
||||
|
||||
[tasks.link]
|
||||
description = "Build an ELF executable using the `vitasdk` linker."
|
||||
dependencies = ["build"]
|
||||
script = [
|
||||
"""
|
||||
${TARGET_LINKER} ${TARGET_LINKER_FLAGS} \
|
||||
-L"${CARGO_OUT_DIR}" \
|
||||
-l"${CARGO_MAKE_CRATE_FS_NAME}" \
|
||||
${LINKER_LIBS} \
|
||||
-o"${CARGO_OUT_DIR}/${CARGO_MAKE_CRATE_NAME}.elf"
|
||||
"""
|
||||
]
|
||||
|
||||
[tasks.strip]
|
||||
description = "Strip the produced ELF executable."
|
||||
dependencies = ["xbuild"]
|
||||
dependencies = ["link"]
|
||||
command = "arm-vita-eabi-strip"
|
||||
args = ["-g", '${CARGO_OUT_DIR}/${CARGO_MAKE_CRATE_FS_NAME}.elf']
|
||||
|
||||
@ -124,4 +193,4 @@ script = [
|
||||
]
|
||||
```
|
||||
|
||||
After running the above script, you should be able to get a *.vpk file in the same folder your *.elf executable resides. Now you can pick it and install it on your own PlayStation Vita using, for example, [VitaShell](https://github.com/TheOfficialFloW/VitaShell/releases) or you can use an emulator. For the time being, the most mature emulator for PlayStation Vita is [Vita3K](https://vita3k.org/), although I personally recommend testing your programs in real hardware, as the emulator is quite experimental.
|
||||
After running the above script, you should be able to get a *.vpk file in the same folder your *.elf executable resides. Now you can pick it and install it on your own PlayStation Vita using, or you can use an [Vita3K](https://vita3k.org/) emulator.
|
@ -18,6 +18,7 @@ This feature tracks `asm!` and `global_asm!` support for the following architect
|
||||
- MSP430
|
||||
- M68k
|
||||
- LoongArch
|
||||
- s390x
|
||||
|
||||
## Register classes
|
||||
|
||||
@ -48,6 +49,8 @@ This feature tracks `asm!` and `global_asm!` support for the following architect
|
||||
| M68k | `reg_addr` | `a[0-3]` | `a` |
|
||||
| LoongArch | `reg` | `$r1`, `$r[4-20]`, `$r[23,30]` | `r` |
|
||||
| LoongArch | `freg` | `$f[0-31]` | `f` |
|
||||
| s390x | `reg` | `r[0-10]`, `r[12-14]` | `r` |
|
||||
| s390x | `freg` | `f[0-15]` | `f` |
|
||||
|
||||
> **Notes**:
|
||||
> - NVPTX doesn't have a fixed register set, so named registers are not supported.
|
||||
@ -81,6 +84,8 @@ This feature tracks `asm!` and `global_asm!` support for the following architect
|
||||
| M68k | `reg_data` | None | `i8`, `i16`, `i32` |
|
||||
| LoongArch64 | `reg` | None | `i8`, `i16`, `i32`, `i64`, `f32`, `f64` |
|
||||
| LoongArch64 | `freg` | None | `f32`, `f64` |
|
||||
| s390x | `reg` | None | `i8`, `i16`, `i32`, `i64` |
|
||||
| s390x | `freg` | None | `f32`, `f64` |
|
||||
|
||||
## Register aliases
|
||||
|
||||
@ -115,8 +120,8 @@ This feature tracks `asm!` and `global_asm!` support for the following architect
|
||||
|
||||
| Architecture | Unsupported register | Reason |
|
||||
| ------------ | --------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| All | `sp` | The stack pointer must be restored to its original value at the end of an asm code block. |
|
||||
| All | `fr` (Hexagon), `$fp` (MIPS), `Y` (AVR), `r4` (MSP430), `a6` (M68k), `$fp` (LoongArch) | The frame pointer cannot be used as an input or output. |
|
||||
| All | `sp`, `r15` (s390x) | The stack pointer must be restored to its original value at the end of an asm code block. |
|
||||
| All | `fr` (Hexagon), `$fp` (MIPS), `Y` (AVR), `r4` (MSP430), `a6` (M68k), `$fp` (LoongArch), `r11` (s390x) | The frame pointer cannot be used as an input or output. |
|
||||
| All | `r19` (Hexagon) | This is used internally by LLVM as a "base pointer" for functions with complex stack frames. |
|
||||
| MIPS | `$0` or `$zero` | This is a constant zero register which can't be modified. |
|
||||
| MIPS | `$1` or `$at` | Reserved for assembler. |
|
||||
@ -147,6 +152,8 @@ This feature tracks `asm!` and `global_asm!` support for the following architect
|
||||
| PowerPC | `freg` | None | `0` | None |
|
||||
| LoongArch | `reg` | None | `$r2` | None |
|
||||
| LoongArch | `freg` | None | `$f0` | None |
|
||||
| s390x | `reg` | None | `%r0` | None |
|
||||
| s390x | `freg` | None | `%f0` | None |
|
||||
|
||||
# Flags covered by `preserves_flags`
|
||||
|
||||
@ -157,3 +164,5 @@ These flags registers must be restored upon exiting the asm block if the `preser
|
||||
- The status register `r2`.
|
||||
- M68k
|
||||
- The condition code register `ccr`.
|
||||
- s390x
|
||||
- The condition code register `cc`.
|
||||
|
@ -379,7 +379,6 @@ language_item_table! {
|
||||
// FIXME(swatinem): the following lang items are used for async lowering and
|
||||
// should become obsolete eventually.
|
||||
ResumeTy, ResumeTy, resume_ty, Target::Struct, GenericRequirement::None;
|
||||
IdentityFuture, identity_future, identity_future_fn, Target::Fn, GenericRequirement::None;
|
||||
GetContext, get_context, get_context_fn, Target::Fn, GenericRequirement::None;
|
||||
|
||||
Context, Context, context, Target::Struct, GenericRequirement::None;
|
||||
|
@ -10,7 +10,7 @@ use std::path::{Path, PathBuf};
|
||||
const ENTRY_LIMIT: usize = 900;
|
||||
// FIXME: The following limits should be reduced eventually.
|
||||
const ISSUES_ENTRY_LIMIT: usize = 1953;
|
||||
const ROOT_ENTRY_LIMIT: usize = 894;
|
||||
const ROOT_ENTRY_LIMIT: usize = 895;
|
||||
|
||||
fn check_entries(tests_path: &Path, bad: &mut bool) {
|
||||
let mut directories: HashMap<PathBuf, usize> = HashMap::new();
|
||||
|
@ -1,2 +1,2 @@
|
||||
error: unknown print request `uwu`. Valid print requests are: `crate-name`, `file-names`, `sysroot`, `target-libdir`, `cfg`, `calling-conventions`, `target-list`, `target-cpus`, `target-features`, `relocation-models`, `code-models`, `tls-models`, `native-static-libs`, `stack-protector-strategies`, `target-spec-json`, `all-target-specs-json`, `link-args`, `split-debuginfo`
|
||||
error: unknown print request `uwu`. Valid print requests are: `crate-name`, `file-names`, `sysroot`, `target-libdir`, `cfg`, `calling-conventions`, `target-list`, `target-cpus`, `target-features`, `relocation-models`, `code-models`, `tls-models`, `native-static-libs`, `stack-protector-strategies`, `target-spec-json`, `all-target-specs-json`, `link-args`, `split-debuginfo`, `deployment-target`
|
||||
|
||||
|
4
tests/ui/deployment-target/invalid-target.rs
Normal file
4
tests/ui/deployment-target/invalid-target.rs
Normal file
@ -0,0 +1,4 @@
|
||||
// compile-flags: --target x86_64-unknown-linux-gnu --print deployment-target
|
||||
// needs-llvm-components: x86
|
||||
|
||||
fn main() {}
|
2
tests/ui/deployment-target/invalid-target.stderr
Normal file
2
tests/ui/deployment-target/invalid-target.stderr
Normal file
@ -0,0 +1,2 @@
|
||||
error: only Apple targets currently support deployment version info
|
||||
|
7
tests/ui/deployment-target/macos-target.rs
Normal file
7
tests/ui/deployment-target/macos-target.rs
Normal file
@ -0,0 +1,7 @@
|
||||
// only-macos
|
||||
// compile-flags: --print deployment-target
|
||||
// normalize-stdout-test: "\d+\." -> "$$CURRENT_MAJOR_VERSION."
|
||||
// normalize-stdout-test: "\d+" -> "$$CURRENT_MINOR_VERSION"
|
||||
// check-pass
|
||||
|
||||
fn main() {}
|
1
tests/ui/deployment-target/macos-target.stdout
Normal file
1
tests/ui/deployment-target/macos-target.stdout
Normal file
@ -0,0 +1 @@
|
||||
deployment_target=$CURRENT_MAJOR_VERSION.$CURRENT_MINOR_VERSION
|
9
tests/ui/traits/negative-bounds/supertrait.rs
Normal file
9
tests/ui/traits/negative-bounds/supertrait.rs
Normal file
@ -0,0 +1,9 @@
|
||||
// check-pass
|
||||
|
||||
#![feature(negative_bounds)]
|
||||
//~^ WARN the feature `negative_bounds` is incomplete
|
||||
|
||||
trait A: !B {}
|
||||
trait B: !A {}
|
||||
|
||||
fn main() {}
|
10
tests/ui/traits/negative-bounds/supertrait.stderr
Normal file
10
tests/ui/traits/negative-bounds/supertrait.stderr
Normal file
@ -0,0 +1,10 @@
|
||||
warning: the feature `negative_bounds` is incomplete and may not be safe to use and/or cause compiler crashes
|
||||
--> $DIR/supertrait.rs:3:12
|
||||
|
|
||||
LL | #![feature(negative_bounds)]
|
||||
| ^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `#[warn(incomplete_features)]` on by default
|
||||
|
||||
warning: 1 warning emitted
|
||||
|
Loading…
Reference in New Issue
Block a user