about summary refs log tree commit diff
path: root/compiler/rustc_target
AgeCommit message (Collapse)AuthorLines
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`).
2022-07-31reorder fields in Laout debug outputRalf Jung-6/+7
2022-07-30Rollup merge of #99227 - Lokathor:fix-thumbv4t-none-eabi-frame-pointer, ↵Yuki Okushi-3/+21
r=davidtwco Fix thumbv4t-none-eabi frame pointer setting The `thumb_base` profile has changed since I last remember seeing it, and now it sets the frame pointer to "always keep", which is not desired for this target. Hooking a debugger to the running program is not really done, it's preferable to have the register available for actual program use, so the default "may omit" is now set. I thought that the target was already using "may omit" when I checked on it last month, because I forgot that the target was previously based on `thumb_base` rather than `Default::default()`. I only noticed the issue just now when creating the `armv4t-none-eabi` target (https://github.com/rust-lang/rust/pull/99226), though this PR is not in any way conditional on that one.
2022-07-28once again tidy was unhappyLokathor-1/+3
2022-07-28Update thumbv4t_none_eabi.rsLokathor-2/+3
2022-07-27Initial (incomplete) implementation of transmutability trait.Jack Wrenn-1/+2
This initial implementation handles transmutations between types with specified layouts, except when references are involved. Co-authored-by: Igor null <m1el.2027@gmail.com>
2022-07-26Fix vectorcallDaniel Paoliello-5/+7
2022-07-24Revert "Mark atomics as unsupported on thumbv6m"Amanieu d'Antras-2/+1
This reverts commit 75146102197c7f35e6c38cb402b2bc1065858c54.
2022-07-23Auto merge of #99652 - GuillaumeGomez:rollup-38v0x7y, r=GuillaumeGomezbors-1/+2
Rollup of 6 pull requests Successful merges: - #99298 (Make `ui-fulldeps/gated-plugins` and `ui-fulldeps/multiple-plugins` tests stage 2 only) - #99396 (Add some additional double-adjustment regression tests) - #99449 (Do not resolve associated const when there is no provided value) - #99595 (Mark atomics as unsupported on thumbv6m) - #99627 (Lock stdout once when listing tests) - #99638 (Remove Clean trait implementation for hir::Ty and middle::Ty) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-07-23Rollup merge of #99595 - nikic:thumbv6m-atomics, r=nagisaGuillaume Gomez-1/+2
Mark atomics as unsupported on thumbv6m The thumbv6m target does not support atomics. Historically, LLVM had a bug where atomic load/stores for this target were emitted as plain load/stores rather than as libatomic calls. This was fixed in https://reviews.llvm.org/D120026, which will be part of LLVM 15. As we require that "atomic support" does not use libatomic, we need to indicate that this target does not have native atomics.
2022-07-23Auto merge of #98208 - ivanloz:master, r=nagisabors-0/+5
Add support for LLVM ShadowCallStack. LLVMs ShadowCallStack provides backward edge control flow integrity protection by using a separate shadow stack to store and retrieve a function's return address. LLVM currently only supports this for AArch64 targets. The x18 register is used to hold the pointer to the shadow stack, and therefore this only works on ABIs which reserve x18. Further details are available in the [LLVM ShadowCallStack](https://clang.llvm.org/docs/ShadowCallStack.html) docs. # Usage `-Zsanitizer=shadow-call-stack` # Comments/Caveats * Currently only enabled for the aarch64-linux-android target * Requires the platform to define a runtime to initialize the shadow stack, see the [LLVM docs](https://clang.llvm.org/docs/ShadowCallStack.html) for more detail.
2022-07-22do not mark interior mutable shared refs as dereferenceableRalf Jung-3/+7
2022-07-22rename PointerKind::Shared → SharedMutable to indicate this is NOT the ↵Ralf Jung-1/+1
usual shared reference
2022-07-22Mark atomics as unsupported on thumbv6mNikita Popov-1/+2
The thumbv6m target does not support atomics. Historically, LLVM had a bug where atomic load/stores for this target were emitted as plain load/stores rather than as libatomic calls. This was fixed in https://reviews.llvm.org/D120026, which will be part of LLVM 15. As we require that "atomic support" does not use libatomic, we need to indicate that this target does not have native atomics.