about summary refs log tree commit diff
path: root/compiler/rustc_target/src
AgeCommit message (Collapse)AuthorLines
2022-09-07Change name of "dataful" variant to "untagged"Michael Benfield-2/+2
This is in anticipation of a new enum layout, in which the niche optimization may be applied even when multiple variants have data.
2022-09-02fix tidyQuinn Painter-3/+1
2022-09-02Add {thumb,arm}v5te-none-eabi targetsQuinn Painter-0/+93
2022-09-01rustc_target: Refactor internal linker flavors slightlyVadim Petrochenkov-78/+66
Remove one unstable user-facing linker flavor (l4-bender)
2022-09-01rustc_target: Add a compatibility layer to separate internal and user-facing ↵Vadim Petrochenkov-53/+143
linker flavors
2022-09-01Auto merge of #100707 - dzvon:fix-typo, r=davidtwcobors-2/+2
Fix a bunch of typo This PR will fix some typos detected by [typos]. I only picked the ones I was sure were spelling errors to fix, mostly in the comments. [typos]: https://github.com/crate-ci/typos
2022-09-01Auto merge of #100537 - petrochenkov:piccheck, r=oli-obkbors-52/+83
rustc_target: Add some more target spec sanity checking
2022-08-31Fix a bunch of typoDezhi Wu-2/+2
This PR will fix some typos detected by [typos]. I only picked the ones I was sure were spelling errors to fix, mostly in the comments. [typos]: https://github.com/crate-ci/typos
2022-08-31Rollup merge of #101025 - semarie:openbsd-archs, r=petrochenkovMatthias Krüger-1/+38
Add tier-3 support for powerpc64 and riscv64 openbsd # powerpc64 - MCP for [powerpc64-unknown-openbsd tier-3 support](https://github.com/rust-lang/compiler-team/issues/551) - only need to add spec definition in rustc_target # riscv64 - MCP for [riscv64-unknown-openbsd tier-3 support](https://github.com/rust-lang/compiler-team/issues/552) - add spec definition in rustc_target - follow freebsd about avoiding linking with `libatomic`
2022-08-31Rollup merge of #101088 - nicholasbishop:bishop-uefi-pdb, r=davidtwcoYuki Okushi-3/+3
Set DebuginfoKind::Pdb in msvc_base This PDB setting was added to `windows_msvc_base` in https://github.com/rust-lang/rust/pull/98051. It's also needed for the UEFI targets, and since `uefi_msvc_base` and `windows_msvc_base` are the only things that inherit from `msvc_base`, just move the PDB setting up to `mscv_base` to cover both. Fixes https://github.com/rust-lang/rust/issues/101071
2022-08-28add riscv64gc-unknown-openbsd support (target riscv64-unknown-openbsd on ↵Sébastien Marie-0/+19
OpenBSD) - add platform-support documentation - add riscv64gc-unknown-openbsd spec - do not try to link with -latomic on openbsd
2022-08-28add powerpc64-unknown-openbsd supportSébastien Marie-0/+18
2022-08-27Set DebuginfoKind::Pdb in msvc_baseNicholas Bishop-3/+3
This PDB setting was added to `windows_msvc_base` in https://github.com/rust-lang/rust/pull/98051. It's also needed for the UEFI targets, and since `uefi_msvc_base` and `windows_msvc_base` are the only things that inherit from `msvc_base`, just move the PDB setting up to `mscv_base` to cover both. Fixes https://github.com/rust-lang/rust/issues/101071
2022-08-27Auto merge of #100999 - nnethercote:shrink-FnAbi, r=bjorn3bors-47/+50
Shrink `FnAbi` Because they can take up a lot of memory in debug and release builds. r? `@bjorn3`
2022-08-27rustc_target: Use `Cow` and link args helpers in `apple_base`Vadim Petrochenkov-23/+20
2022-08-27rustc_target: Do not specify some target options redundantlyVadim Petrochenkov-12/+3
These values are already inherited
2022-08-27rustc_target: Add some more target spec sanity checkingVadim Petrochenkov-17/+60
2022-08-26Auto merge of #98051 - davidtwco:split-dwarf-stabilization, r=wesleywiserbors-9/+123
session: stabilize split debuginfo on linux Stabilize the `-Csplit-debuginfo` flag... - ...on Linux for all values of the flag. Split DWARF has been implemented for a few months, hasn't had any bug reports and has had some promising benchmarking for incremental debug build performance. - ..on other platforms for the default value. It doesn't make any sense that `-Csplit-debuginfo=packed` is unstable on Windows MSVC when that's the default behaviour, but keep the other values unstable.
2022-08-26openbsd: rustc_target: reorder spec by nameSébastien Marie-1/+1
2022-08-26Move `ArgAbi::pad_i32` into `PassMode::Cast`.Nicholas Nethercote-22/+15
Because it's only needed for that variant. This shrinks the types and clarifies the logic.
2022-08-26Turn `ArgAbi::pad` into a `bool`.Nicholas Nethercote-8/+8
Because it's only ever set to `None` or `Some(Reg::i32())`.
2022-08-26Change `FnAbi::args` to a boxed slice.Nicholas Nethercote-25/+25
2022-08-26Change `FnAbi::fixed_count` to a `u32`.Nicholas Nethercote-3/+3
2022-08-26Box `CastTarget` within `PassMode`.Nicholas Nethercote-5/+5
Because `PassMode::Cast` is by far the largest variant, but is relatively rare. This requires making `PassMode` not impl `Copy`, and `Clone` is no longer necessary. This causes lots of sigil adjusting, but nothing very notable.
2022-08-26Add size assertions for `FnAbi` and `ArgAbi`.Nicholas Nethercote-0/+10
2022-08-23Rollup merge of #100641 - corwinkuiper:add-armv4t-target, r=oli-obkMatthias Krüger-0/+1
Add the armv4t-none-eabi target to the supported_targets This target was added in #100244 but forgot to add it to the macro in the `mod.rs` file. ``@Lokathor``
2022-08-22rustdoc doesn't like bare urlsWesley Wiser-1/+1
2022-08-20Rollup merge of #100636 - cutsoy:revert-77716, r=davidtwcoMatthias Krüger-1/+0
Revert "Revert "Allow dynamic linking for iOS/tvOS targets."" This reverts commit 16e10bf81ee73f61cf813acef3d5dbbce4f66da2 (PR #77716). The original original PR enabled `cdylib` builds for iOS. However this caused problems because: > This new feature in Rust 1.46 added a lot of headache for iOS builds with cdylib targets. cdylib target is near impossible to build if you are using any crate with native dependencies (ex. openssl, libsodium, zmq). You can't just find .so files for all architectures to perform correct linking. Usual workflow is the following: > > 1. You build staticlib and rely that native dependencies will be linked as frameworks later > 2. You setup right cocoapods in ObjectiveC/Swift wrapper. > > As cargo doesn't support platform-dependent crate types https://github.com/rust-lang/rust/pull/4881 as a result a lot of projects now broken on Rust 1.46 However, this will be soon a thing of the past since 1.64 brings us the long awaited much anticipated `--crate-type` flag. > I see that this got merged recently: https://github.com/rust-lang/cargo/issues/10083. The --crate-type flag will get stabilized in 1.64. In 1.64, you could still get a successful iOS staticlib with cargo build --crate-type=statclib even if the crate has cdylib targets too. If I'm not mistaken, this solves the problem too so this PR could be reverted in 1.64 with relatively little headache. So summing up, I think this PR can be reverted in 1.64. 🤞
2022-08-18Add diagnostic translation lints to crates that don't emit them5225225-0/+2
2022-08-18session: stabilize split debuginfo on linuxDavid Wood-9/+123
Stabilize the `-Csplit-debuginfo` flag... - ...on Linux for all values of the flag. Split DWARF has been implemented for a few months, hasn't had any bug reports and has had some promising benchmarking for incremental debug build performance. - ..on other platforms for the default value. It doesn't make any sense that `-Csplit-debuginfo=packed` is unstable on Windows MSVC when that's the default behaviour, but keep the other values unstable. Signed-off-by: David Wood <david.wood@huawei.com>
2022-08-17Rollup merge of #100621 - taiki-e:armv4t-atomics-32, r=cuviperMatthias Krüger-2/+6
Pass +atomics-32 feature for {arm,thumb}v4t-none-eabi Similar to https://github.com/rust-lang/rust/commit/89582e8193e0da64a54c4ffae7f9fa64ed9fe2af, but for ARMv4t. Pre-v6 ARM target does not have atomic CAS, except for Linux and Android where atomic CAS is provided by compiler-builtins. So, there is a similar issue as thumbv6m. I have confirmed that enabling the `atomics-32` target feature fixes the problem in the project affected by this issue. (https://github.com/taiki-e/portable-atomic/pull/28#discussion_r946604136) Closes #100619 r? ``@nikic`` cc ``@Lokathor``
2022-08-16add the armv4t-none-eabi targetCorwin-0/+1
2022-08-16Revert "Revert "Allow dynamic linking for iOS/tvOS targets.""Tim van Elsloo-1/+0
This reverts commit 16e10bf81ee73f61cf813acef3d5dbbce4f66da2. # Conflicts: # compiler/rustc_target/src/spec/apple_sdk_base.rs
2022-08-16Support 128-bit atomics on all aarch64 targetsTaiki Endo-5/+5
2022-08-16Pass +atomics-32 feature for {arm,thumb}v4t-none-eabiTaiki Endo-2/+6
2022-08-12rustc_target: Update some old naming around self contained linkingVadim Petrochenkov-62/+64
The "fallback" naming pre-dates introduction of `-Clink-self-contained`
2022-08-12Auto merge of #99464 - nikic:llvm-15, r=cuviperbors-1/+3
Update to LLVM 15 For preliminary testing. Some LLVM 15 compatibility fixes were applied separately in #99512. Release timeline: * LLVM 15 branched on Jul 26. * The final LLVM 15.0.0 release is scheduled for Sep 6. * Current nightly (1.65.0) is scheduled for Nov 3. Changes in this PR (apart from the LLVM update): * Pass `--set llvm.allow-old-toolchain` for many Docker images. LLVM 16 will require GCC >= 7.1, while LLVM 15 still allows older compilers with an option. Specify the option for builders still using GCC 5.4. #95026 updated some of the used toolchains, but not all. * Use the `+atomics-32` target feature for thumbv6m. * Explicitly link libatomic when cross-compiling LLVM to 32-bit target. * Explicitly disable zstd support, to avoid libzstd.so dependency. New LLVM patches ([commits](https://github.com/rust-lang/llvm-project/commits/rustc/15.0-2022-08-09)): * [rust-only] Fix ICE with GCC 5.4 (https://github.com/nikic/llvm-project/commit/15be58d7f0342b1da5af219bac8bd71d01da6dff) * [rust-only] Fix build with GCC 5.4 (https://github.com/nikic/llvm-project/commit/774edc10fa45229c2aa678f1bef8b4812dc0f76a) * ~~[rust-only] Fix build with GCC 5.2 (https://github.com/nikic/llvm-project/commit/1a6069a7bb35ace1e40d566035cbf7ed2fa3b1f7)~~ * ~~[rust-only] Fix ICE with GCC 5.2 (https://github.com/nikic/llvm-project/commit/493081f2909206e0ed55af68a4058a76c0ad7a64)~~ * ~~[rust-only] Fix build with GCC 5.2 (https://github.com/nikic/llvm-project/commit/0fc5979d738c3a1f9510fe2d62417f7d2af37817)~~ * [backported] Addition of `+atomics` target feature (https://github.com/llvm/llvm-project/commit/57bdd9892d0eba5bdd25fc44799235be7b9f5153). * [backported] Revert compiler-rt change that broke powerpc (https://github.com/llvm/llvm-project/commit/9c68b43915fc1c9c0a07e935163ae8d638d7241b) * [awaiting backport] Fix RelLookupTableConverter on gnux32 (https://github.com/nikic/llvm-project/commit/639388a05f25772fb23eea5b1045e7df83bcfaa7 / https://github.com/llvm/llvm-project/issues/57021) Tested images: dist-x86_64-linux, armhf-gnu, arm-android, dist-s390x-linux, dist-x86_64-illumos, dist-x86_64-freebsd, wasm32, dist-x86_64-musl, dist-various-1, dist-riscv64-linux, dist-mips-linux, dist-mipsel-linux, dist-powerpc-linux, dist-aarch64-linux, dist-x86_64-apple, x86_64-msvc-1, x86_64-msvc-2, dist-various-2, dist-arm-linux Tested up to the usual ipv6 error: test-various, i686-gnu, x86_64-gnu-nopt r? `@ghost`
2022-08-11Rollup merge of #99500 - tmandry:fuchsia-flags, r=petrochenkovMatthias Krüger-0/+5
Fix flags when using clang as linker for Fuchsia Don't add C runtime or set dynamic linker when linking with clang for Fuchsia. Clang already does this for us.
2022-08-11Rollup merge of #99421 - Bryanskiy:android-crt-static, r=petrochenkovMatthias Krüger-1/+1
add crt-static for android
2022-08-10Fix flags when using clang as linker for FuchsiaTyler Mandry-0/+5
Don't add C runtime or set dynamic linker when linking with clang for Fuchsia. Clang already does this for us.
2022-08-10add crt-static for androidBryanskiy-1/+1
2022-08-10Rollup merge of #100317 - kjetilkjeka:remove-nvptx32-logic, r=eddybMichael Goulet-35/+0
Remove logic related to deprecated nvptx-nvidia-cuda (32-bit) target As described in the MCP https://github.com/rust-lang/compiler-team/issues/496#issuecomment-1196328748 r? ``@eddyb``
2022-08-09Remove logic related to deprecated nvptx-nvidia-cuda (32-bit) targetKjetil Kjeka-35/+0
2022-08-09Pass +atomics-32 feature for thumbv6m targetNikita Popov-1/+3
https://reviews.llvm.org/D120026 changed atomics on thumbv6m to use libatomic, to ensure that atomic load/store are compatible with atomic RMW/CAS. However, Rust wants to expose only load/store without libcalls. https://reviews.llvm.org/D130480 added support for this behind the +atomics-32 target feature, so enable that feature.
2022-08-09Add support for link-flavor rust-lld for macOSMary-55/+59
Also refactor iOS, watchOS and tvOS common code.
2022-08-07Create armv4t_none_eabi.rsLokathor-0/+54
2022-08-03Rollup merge of #98771 - Thog:rust-lld-apple-target, r=petrochenkovMatthias Krüger-8/+91
Add support for link-flavor rust-lld for iOS, tvOS and watchOS This adds support for rust-lld for Apple *OS targets. This was tested against targets ``aarch64-apple-ios`` and ``aarch64-apple-ios-sim`` with [a simple test program](https://github.com/Thog/rust-lld-apple-target_test). It currently doesn't work with targets ``armv7-apple-ios`` and ``armv7s-apple-ios`` because of ``symbols.o`` not being generated with the correct CPU subtype. This will require changes in the ``object`` crate to expose an API. As ``ld64.lld`` requires ``-platform_version`` with the minimal version supported and an sdk version, I made ``rustc_target::apple_base`` public to get access to ``*os_deployment_target`` helper functions and also added ``tvos_deployment_target`` as it was missing.
2022-08-03Add support for link-flavor rust-lld for iOS, tvOS and watchOSmary-8/+91
This adds support for rust-lld for Apple *OS targets. This was tested against targets "aarch64-apple-ios" and "aarch64-apple-ios-sim". For targets "armv7-apple-ios" and "armv7s-apple-ios", it doesn't link because of "symbols.o" not being generated with the correct CPU subtype (changes in the "object" crate needs to be done to support it).
2022-08-02Auto merge of #92268 - jswrenn:transmute, r=oli-obkbors-1/+2
Initial implementation of transmutability trait. *T'was the night before Christmas and all through the codebase, not a miri was stirring — no hint of `unsafe`!* This PR provides an initial, **incomplete** implementation of *[MCP 411: Lang Item for Transmutability](https://github.com/rust-lang/compiler-team/issues/411)*. The `core::mem::BikeshedIntrinsicFrom` trait provided by this PR is implemented on-the-fly by the compiler for types `Src` and `Dst` when the bits of all possible values of type `Src` are safely reinterpretable as a value of type `Dst`. What this PR provides is: - [x] [support for transmutations involving primitives](https://github.com/jswrenn/rust/tree/transmute/src/test/ui/transmutability/primitives) - [x] [support for transmutations involving arrays](https://github.com/jswrenn/rust/tree/transmute/src/test/ui/transmutability/arrays) - [x] [support for transmutations involving structs](https://github.com/jswrenn/rust/tree/transmute/src/test/ui/transmutability/structs) - [x] [support for transmutations involving enums](https://github.com/jswrenn/rust/tree/transmute/src/test/ui/transmutability/enums) - [x] [support for transmutations involving unions](https://github.com/jswrenn/rust/tree/transmute/src/test/ui/transmutability/unions) - [x] [support for weaker validity checks](https://github.com/jswrenn/rust/blob/transmute/src/test/ui/transmutability/unions/should_permit_intersecting_if_validity_is_assumed.rs) (i.e., `Assume::VALIDITY`) - [x] visibility checking What isn't yet implemented: - [ ] transmutability options passed using the `Assume` struct - [ ] [support for references](https://github.com/jswrenn/rust/blob/transmute/src/test/ui/transmutability/references.rs) - [ ] smarter error messages These features will be implemented in future PRs.
2022-08-01Auto merge of #99476 - dpaoliello:rawdylibvectorcall, r=michaelwoeristerbors-5/+7
Add tests for raw-dylib with vectorcall, and fix vectorcall code generation * Adds tests for using `raw-dylib` (#58713) with `vectorcall`. * Fixed code generation for `vectorcall` (parameters have to be marked with `InReg`, just like `fastcall`). * Enabled running the `raw-dylib` `fastcall` tests when using MSVC (since I had to add support in the test for running MSVC-only tests since GCC doesn't support `vectorcall`).