about summary refs log tree commit diff
path: root/compiler/rustc_target/src
AgeCommit message (Collapse)AuthorLines
2022-11-17Remove periods from QNX/nto target namesFlorian Bartels-2/+2
2022-11-17Add powerpc64-ibm-aix as Tier-3 targetQiu Chaofan-0/+63
2022-11-16Rollup merge of #104137 - StackDoubleFlow:err-lsc-unsupported, r=bjorn3Matthias Krüger-5/+5
Issue error when -C link-self-contained option is used on unsupported platforms The documentation was also updated to reflect this. I'm assuming the supported platforms are the same as initially written in [RELEASES.md](https://github.com/rust-lang/rust/blob/master/RELEASES.md#compiler-17). Fixes #103576
2022-11-14Issue error when `-C link-self-contained` option is used on unsupported ↵StackDoubleFlow-5/+5
platforms Document supported targets for `-C link-self-contained` Move `LinkSelfContainedDefault::True` from wasm_base to wasm32_wasi
2022-11-14Rollup merge of #104349 - rustaceanclub:master, r=oli-obkMatthias Krüger-1/+1
fix some typos in comments
2022-11-13Rollup merge of #104357 - RalfJung:is-sized, r=cjgillotMatthias Krüger-0/+10
add is_sized method on Abi and Layout, and use it This avoids the double negation of `!is_unsized()` that we have quite a lot.
2022-11-13[watchos] Dynamic linking is not allowed for watchos targetsVladimir Michael Eatwell-0/+4
2022-11-13add is_sized method on Abi and Layout, and use itRalf Jung-0/+10
2022-11-13fix some typos in commentscui fliter-1/+1
Signed-off-by: cui fliter <imcusg@gmail.com>
2022-11-11Add no_std AArch64 support for the QNX Neutrino (nto) 7.1 RTOSFlorian Bartels-0/+72
This change allows to compile no_std applications for the QNX Neutrino realtime operating system for ARM 64 bit CPUs. Tested with QNX Neutrino 7.1.
2022-11-11Improve generating Custom entry functionAyush Singh-0/+80
This commit is aimed at making compiler generated entry functions (Basically just C `main` right now) more generic so other targets can do similar things for custom entry. This was initially implemented as part of https://github.com/rust-lang/rust/pull/100316. Currently, this moves the entry function name and Call convention to the target spec. Signed-off-by: Ayush Singh <ayushsingh1325@gmail.com>
2022-11-10Rollup merge of #104077 - nicholasbishop:bishop-uefi-aapcs, r=nagisaManish Goregaokar-0/+1
Use aapcs for efiapi calling convention on arm On arm, [llvm treats the C calling convention as `aapcs` on soft-float targets and `aapcs-vfp` on hard-float targets](https://github.com/rust-lang/compiler-builtins/issues/116#issuecomment-261057422). UEFI specifies in the arm calling convention that [floating point extensions aren't used](https://uefi.org/specs/UEFI/2.10/02_Overview.html#detailed-calling-convention), so always translate `efiapi` to `aapcs` on arm. https://github.com/rust-lang/rust/issues/65815
2022-11-10Rollup merge of #101939 - zhaixiaojuan:loongarch64-abi, r=oli-obkManish Goregaokar-0/+344
Add loongarch64 abi support
2022-11-09Rollup merge of #104020 - nicholasbishop:bishop-limit-efiapi, r=nagisaManish Goregaokar-1/+3
Limit efiapi calling convention to supported arches Supported architectures in UEFI are described here: https://uefi.org/specs/UEFI/2.10/02_Overview.html#calling-conventions https://github.com/rust-lang/rust/issues/65815
2022-11-09Rollup merge of #104015 - alex:remove-kernel, r=oli-obkManish Goregaokar-55/+5
Remove linuxkernel targets These are not used by the actual Rust-for-Linux project, so they're mostly just confusing.
2022-11-09Rollup merge of #103929 - BlackHoleFox:apple-targets-cleanup, r=petrochenkovManish Goregaokar-221/+218
Cleanup Apple-related code in rustc_target While working on https://github.com/rust-lang/rust/pull/103455, the consistency of the `rustc_target` code for Apple's platforms was "kind of bad." There were two "base" files (`apple_base.rs` and `apple_sdk_base.rs`) that the targets each pulled some parts out of, each and all of them were written slightly differently, and sometimes missed comments other implementations had. So to hopefully make future maintenance, like implementing https://github.com/rust-lang/compiler-team/issues/556, easier, this makes all of them use similar patterns and the same target base logic everywhere instead of picking bits from both. This also has some other smaller upsides like less stringly-typed functions.
2022-11-08Rollup merge of #104067 - jeremyd2019:patch-1, r=davidtwcoDylan DPC-2/+6
fix debuginfo for windows_gnullvm_base.rs These lines (including the FIXME comment) were added to windows_gnu_base.rs in cf2c492ef8c87c049b4e3a62f43c841aafc88cba but windows_gnullvm_base.rs was not updated. This resulted in an error `LLVM ERROR: dwo only supported with ELF and Wasm` attempting to build on aarch64-pc-windows-gnullvm. See also https://github.com/msys2/MINGW-packages/pull/13921#issuecomment-1304391707 /cc ```@mati865``` ```@davidtwco``` r? ```@davidtwco```
2022-11-06fix debuginfo for windows_gnullvm_base.rsjeremyd2019-2/+6
These lines (including the FIXME comment) were added to windows_gnu_base.rs in cf2c492ef8c87c049b4e3a62f43c841aafc88cba but windows_gnullvm_base.rs was not updated. This resulted in an error `LLVM ERROR: dwo only supported with ELF and Wasm` attempting to build on aarch64-pc-windows-gnullvm. Signed-off-by: Jeremy Drake <github@jdrake.com>
2022-11-06Use aapcs for efiapi calling convention on armNicholas Bishop-0/+1
On arm, llvm treats the C calling convention as `aapcs` on soft-float targets and `aapcs-vfp` on hard-float targets [1]. UEFI specifies in the arm calling convention that floating point extensions aren't used [2], so always translate `efiapi` to `aapcs` on arm. [1]: https://github.com/rust-lang/compiler-builtins/issues/116#issuecomment-261057422 [2]: https://uefi.org/specs/UEFI/2.10/02_Overview.html#detailed-calling-convention https://github.com/rust-lang/rust/issues/65815
2022-11-06Limit efiapi calling convention to supported archesNicholas Bishop-1/+3
Supported architectures in UEFI are described here: https://uefi.org/specs/UEFI/2.10/02_Overview.html#calling-conventions Changes to tests modeled on 8240e7aa101815e2009c7d03b33dd2566d843e73. https://github.com/rust-lang/rust/issues/65815
2022-11-06LLVM 16: Update RISCV data layoutTim Neumann-6/+6
2022-11-05Cleanup Apple target specificationsBlackHoleFox-109/+108
2022-11-05Merge apple_base and apple_sdk_base into one moduleBlackHoleFox-136/+134
2022-11-05Remove linuxkernel targetsAlex Gaynor-55/+5
These are not used by the actual Rust-for-Linux project, so they're mostly just confusing.
2022-11-03Auto merge of #103455 - BlackHoleFox:apple-sim-abi-consistency, r=davidtwcobors-9/+38
Fixed consistency of Apple simulator target's ABI Currently there's a few Apple device simulator targets that are inconsistent since some set `target_abi = "sim"` (the correct thing to do) while a bunch of others don't set anything (`""`). Due to this its very hard to reliability check if some Rust code is running inside a simulator. This changes all of them to do the same thing and set `sim` as their `target_abi`. The new way to identity a simulator during compilation is as simple as `cfg(all(target_vendor="apple", target_abi = "sim"))` or even `cfg(target_abi = "sim")` being less pedantic about it. The issues with the current form (and inspiration for this) are also summarized in `@thomcc's` [Tweet](https://twitter.com/at_tcsc/status/1576685244702691328).
2022-10-30Rollup merge of #102689 - ayrtonm:master, r=cjgillotMichael Howell-0/+38
Add a tier 3 target for the Sony PlayStation 1 This adds a tier 3 target, `mipsel-sony-psx`, for the Sony PlayStation 1. I've tested it pretty thoroughly with [this SDK](https://github.com/ayrtonm/psx-sdk-rs) I wrote for it. From the [tier 3 target policy](https://doc.rust-lang.org/rustc/target-tier-policy.html#tier-3-target-policy) (I've omitted the subpoints for brevity, but read over everything) > A tier 3 target must have a designated developer or developers (the "target maintainers") on record to be CCed when issues arise regarding the target. (The mechanism to track and CC such developers may evolve over time.) I'd be the designated developer > Targets must use naming consistent with any existing targets; for instance, a target for the same CPU or OS as an existing Rust target should use the same name for that CPU or OS. Targets should normally use the same names and naming conventions as used elsewhere in the broader ecosystem beyond Rust (such as in other toolchains), unless they have a very good reason to diverge. Changing the name of a target can be highly disruptive, especially once the target reaches a higher tier, so getting the name right is important even for a tier 3 target. The target name follows the conventions of the existing PSP target (`mipsel-sony-psp`) and uses `psx` following the convention of the broader [PlayStation homebrew community](https://psx-spx.consoledev.net/). > Tier 3 targets may have unusual requirements to build or use, but must not create legal issues or impose onerous legal terms for the Rust project or for Rust developers or users. No legal issues with this target. > Neither this policy nor any decisions made regarding targets shall create any binding agreement or estoppel by any party. If any member of an approving Rust team serves as one of the maintainers of a target, or has any legal or employment requirement (explicit or implicit) that might affect their decisions regarding a target, they must recuse themselves from any approval decisions regarding the target's tier status, though they may otherwise participate in discussions. :+1: > Tier 3 targets should attempt to implement as much of the standard libraries as possible and appropriate (core for most targets, alloc for targets that can support dynamic memory allocation, std for targets with an operating system or equivalent layer of system-provided functionality), but may leave some code unimplemented (either unavailable or stubbed out as appropriate), whether because the target makes it impossible to implement or challenging to implement. The authors of pull requests are not obligated to avoid calling any portions of the standard library on the basis of a tier 3 target not implementing those portions. The psx supports `core` and `alloc`, but will likely not support `std` anytime soon. > The target must provide documentation for the Rust community explaining how to build for the target, using cross-compilation if possible. If the target supports running binaries, or running tests (even if they do not pass), the documentation must explain how to run such binaries or tests for the target, using emulation if possible or dedicated hardware if necessary. This target has an SDK and a `cargo-psx` tool for formatting binaries as psx executables. Documentation and examples are provided in the [psx-sdk-rs README](https://github.com/ayrtonm/psx-sdk-rs#psx-sdk-rs), the SDK and cargo tool are both available through crates.io and docs.rs has [SDK documentation](https://docs.rs/psx/latest/psx/). > Tier 3 targets must not impose burden on the authors of pull requests, or other developers in the community, to maintain the target. In particular, do not post comments (automated or manual) on a PR that derail or suggest a block on the PR based on a tier 3 target. Do not send automated messages or notifications (via any medium, including via `@)` to a PR author or others involved with a PR regarding a tier 3 target, unless they have opted into such messages. :+1: > Patches adding or updating tier 3 targets must not break any existing tier 2 or tier 1 target, and must not knowingly break another tier 3 target without approval of either the compiler team or the maintainers of the other tier 3 target. No problem
2022-10-23Enable varargs support for calling conventions other than C or cdeclSoveu-0/+22
This patch makes it possible to use varargs for calling conventions, which are either based on C (like efiapi) or C is based on them (for example sysv64 and win64).
2022-10-23Fix x86_64-apple-watchos-sim target to use the correct target_abiBlackHoleFox-2/+4
2022-10-23Fix x86_64-apple-tvos target to use the correct target_abiBlackHoleFox-3/+7
2022-10-23Fix x86_64-apple-ios target to use the correct target_abiBlackHoleFox-7/+30
2022-10-19Split is_stable from rustc_target::spec::abi::is_enabled.Mara Bos-159/+109
2022-10-14more dupe word typosRageking8-1/+1
2022-10-13Rollup merge of #102836 - petrochenkov:jsonspec, r=eholkYuki Okushi-5/+9
rustc_target: Fix json target specs using LLD linker flavors in link args Fixes https://github.com/rust-lang/rust/pull/101988#issuecomment-1272407248 (a regression introduced by https://github.com/rust-lang/rust/pull/101988).
2022-10-12Use `tidy-alphabetical` in the compilerNilstrieb-1/+2
2022-10-10Add Sony PlayStation 1 tier 3 targetAyrton-0/+38
2022-10-09rustc_target: Fix json target specs using LLD linker flavors in link argsVadim Petrochenkov-5/+9
2022-10-06rustc_target: Refactor internal linker flavorsVadim Petrochenkov-363/+487
In accordance with the design from https://github.com/rust-lang/rust/pull/96827#issuecomment-1208441595
2022-10-05change might_permit_raw_init to fully detect LLVM UB, but not more than thatRalf Jung-69/+1
2022-10-03Auto merge of #102503 - cuviper:x86-stack-probes, r=nagisabors-64/+36
Enable inline stack probes on X86 with LLVM 16 The known problems with x86 inline-asm stack probes have been solved on LLVM main (16), so this flips the switch. Anyone using bleeding-edge LLVM with rustc can start testing this, as I have done locally. We'll get more direct rust-ci when LLVM 16 branches and we start our upgrade, and we can always patch or disable it then if we find new problems. The previous attempt was #77885, reverted in #84708.
2022-09-29Enable inline stack probes on X86 with LLVM 16Josh Stone-64/+36
2022-09-29Adjust the s390x data layout for LLVM 16Josh Stone-8/+8
LLVM [D131158] changed the SystemZ data layout to always set 64-bit vector alignment, which used to be conditional on the "vector" feature. [D131158]: https://reviews.llvm.org/D131158
2022-09-26Enable inline stack probes on PowerPC and SystemZJosh Stone-18/+36
2022-09-26remove cfg(bootstrap)Pietro Albini-1/+0
2022-09-23Auto merge of #102165 - matthiaskrgr:rollup-n5oquhe, r=matthiaskrgrbors-5/+1
Rollup of 8 pull requests Successful merges: - #100734 (Split out async_fn_in_trait into a separate feature) - #101664 (Note if mismatched types have a similar name) - #101815 (Migrated the rustc_passes annotation without effect diagnostic infrastructure) - #102042 (Distribute rust-docs-json via rustup.) - #102066 (rustdoc: remove unnecessary `max-width` on headers) - #102095 (Deduplicate two functions that would soon have been three) - #102104 (Set 'exec-env:RUST_BACKTRACE=0' in const-eval-select tests) - #102112 (Allow full relro on powerpc64-unknown-linux-gnu) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-09-23Rollup merge of #102112 - cuviper:powerpc64-full-relro, r=eholkMatthias Krüger-5/+1
Allow full relro on powerpc64-unknown-linux-gnu This was previously limited to partial relro, citing issues on RHEL6, but that's no longer a supported platform since #95026. We have long been enabling full relro in RHEL7's own Rust builds for ppc64, without trouble, so it should be fine to drop this workaround.
2022-09-22Improve the help message for an invalid calling conventionkhyperia-0/+188
2022-09-22Rollup merge of #101598 - chriswailes:sanitizers, r=nagisa,eholkDylan DPC-2/+10
Update rustc's information on Android's sanitizers This patch updates sanitizer support definitions for Android inside the compiler. It also adjusts the logic to make sure no pre-built sanitizer runtime libraries are emitted as these are instead provided dynamically on Android targets.
2022-09-21Allow full relro on powerpc64-unknown-linux-gnuJosh Stone-5/+1
This was previously limited to partial relro, citing issues on RHEL6, but that's no longer a supported platform since #95026. We have long been enabling full relro in RHEL7's own Rust builds for ppc64, without trouble, so it should be fine to drop this workaround.
2022-09-21Auto merge of #101329 - QuinnPainter:armv5te-targets, r=nagisabors-0/+84
Add armv5te-none-eabi and thumbv5te-none-eabi targets Creates two new Tier 3 targets, `armv5te-none-eabi` and `thumbv5te-none-eabi`. They are for the same target architecture (armv5te), but one defaults to the A32 instruction set and the other defaults to T32. Based on the existing `armv4t-none-eabi` and `thumbv4t-none-eabi` targets. My particular use case for these targets is Nintendo DS homebrew, but they should be usable for any armv5te system. Going through the Tier 3 target policy: > A tier 3 target must have a designated developer or developers (the "target maintainers") on record to be CCed when issues arise regarding the target. (The mechanism to track and CC such developers may evolve over time.) That will be me. > Targets must use naming consistent with any existing targets. Naming is consistent with previous targets. >> Target names should not introduce undue confusion or ambiguity unless absolutely necessary to maintain ecosystem compatibility. No ambiguity here. > Tier 3 targets may have unusual requirements to build or use, but must not create legal issues or impose onerous legal terms for the Rust project or for Rust developers or users. Doesn't create any legal issues. >> The target must not introduce license incompatibilities. This doesn't introduce any new licenses. >> Anything added to the Rust repository must be under the standard Rust license (MIT OR Apache-2.0). Yep. >> The target must not cause the Rust tools or libraries built for any other host (even when supporting cross-compilation to the target) to depend on any new dependency less permissive than the Rust licensing policy. This applies whether the dependency is a Rust crate that would require adding new license exceptions (as specified by the tidy tool in the rust-lang/rust repository), or whether the dependency is a native library or binary. In other words, the introduction of the target must not cause a user installing or running a version of Rust or the Rust tools to be subject to any new license requirements. No new license requirements. >> Compiling, linking, and emitting functional binaries, libraries, or other code for the target (whether hosted on the target itself or cross-compiling from another target) must not depend on proprietary (non-FOSS) libraries. Everything this uses is FOSS, no proprietary required. > Neither this policy nor any decisions made regarding targets shall create any binding agreement or estoppel by any party. If any member of an approving Rust team serves as one of the maintainers of a target, or has any legal or employment requirement (explicit or implicit) that might affect their decisions regarding a target, they must recuse themselves from any approval decisions regarding the target's tier status, though they may otherwise participate in discussions. OK. >> This requirement does not prevent part or all of this policy from being cited in an explicit contract or work agreement (e.g. to implement or maintain support for a target). This requirement exists to ensure that a developer or team responsible for reviewing and approving a target does not face any legal threats or obligations that would prevent them from freely exercising their judgment in such approval, even if such judgment involves subjective matters or goes beyond the letter of these requirements. OK. > Tier 3 targets should attempt to implement as much of the standard libraries as possible and appropriate (core for most targets, alloc for targets that can support dynamic memory allocation, std for targets with an operating system or equivalent layer of system-provided functionality), but may leave some code unimplemented (either unavailable or stubbed out as appropriate), whether because the target makes it impossible to implement or challenging to implement. The authors of pull requests are not obligated to avoid calling any portions of the standard library on the basis of a tier 3 target not implementing those portions. This is a bare-metal target with only support for `core` (and `alloc`, if the user provides an allocator). > The target must provide documentation for the Rust community explaining how to build for the target, using cross-compilation if possible. If the target supports running binaries, or running tests (even if they do not pass), the documentation must explain how to run such binaries or tests for the target, using emulation if possible or dedicated hardware if necessary. Documentation has been added. > Tier 3 targets must not impose burden on the authors of pull requests, or other developers in the community, to maintain the target. In particular, do not post comments (automated or manual) on a PR that derail or suggest a block on the PR based on a tier 3 target. Do not send automated messages or notifications (via any medium, including via `@)` to a PR author or others involved with a PR regarding a tier 3 target, unless they have opted into such messages. OK. > Backlinks such as those generated by the issue/PR tracker when linking to an issue or PR are not considered a violation of this policy, within reason. However, such messages (even on a separate repository) must not generate notifications to anyone involved with a PR who has not requested such notifications. OK. > Patches adding or updating tier 3 targets must not break any existing tier 2 or tier 1 target, and must not knowingly break another tier 3 target without approval of either the compiler team or the maintainers of the other tier 3 target. This doesn't break any other targets. >> In particular, this may come up when working on closely related targets, such as variations of the same architecture with different features. Avoid introducing unconditional uses of features that another variation of the target may not have; use conditional compilation or runtime detection, as appropriate, to let each target run code supported by that target. No unnecessary unconditional features here.
2022-09-20Update rustc's information on Android's sanitizersChris Wailes-2/+10
This patch updates sanitizier support definitions for Android inside the compiler. It also adjusts the logic to make sure no pre-built sanitizer runtime libraries are emitted as these are instead provided dynamically on Android targets.