about summary refs log tree commit diff
path: root/compiler/rustc_target/src
AgeCommit message (Collapse)AuthorLines
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.
2022-07-20Add ShadowCallStack SupportIvan Lozano-0/+5
Adds support for the LLVM ShadowCallStack sanitizer.
2022-07-20Remove unused StableMap and StableSet types from rustc_data_structuresMichael Woerister-4/+4
2022-07-17Auto merge of #99033 - 5225225:interpreter-validity-checks, r=oli-obkbors-23/+15
Use constant eval to do strict mem::uninit/zeroed validity checks I'm not sure about the code organisation here, I just dumped the check in rustc_const_eval at the root. Not hard to move it elsewhere, in any case. Also, this means cranelift codegen intrinsics lose the strict checks, since they don't seem to depend on rustc_const_eval, and I didn't see a point in keeping around two copies. I also left comments in the is_zero_valid methods about "uhhh help how do i do this", those apply to both methods equally. Also rustc_codegen_ssa now depends on rustc_const_eval... is this okay? Pinging `@RalfJung` since you were the one who mentioned this to me, so I'm assuming you're interested. Haven't had a chance to run full tests on this since it's really warm, and it's 1AM, I'll check out any failures/comments in the morning :)
2022-07-14Use constant eval to do strict validity checks5225225-23/+15
2022-07-14Rename aarch64-nintendo-switch to aarch64-nintendo-switch-freestandingleo60228-2/+2
2022-07-14Remove obsolete crt0 references in linker scriptleo60228-6/+1
2022-07-14Remove unneeded options from Nintendo Switch targetjam1garner-23/+13
2022-07-14Add linker script for switchleo60228-0/+86
2022-07-14Remove unnecessary linker argsleo60228-8/+2
2022-07-14Add Nintendo Switch tier 3 targetjam1garner-0/+41
2022-07-14tidy demands this whitespace go awayLokathor-1/+1
2022-07-13conform to the tidy expectationsLokathor-1/+1
2022-07-13add missing imports.Lokathor-1/+1
2022-07-13Update thumbv4t_none_eabi.rsLokathor-1/+8
2022-07-13word-wrap the comments.Lokathor-2/+10
2022-07-11rustc_target: Flip the default for `TargetOptions::executables` to trueVadim Petrochenkov-52/+3
Also change `executables` to true for linux-kernel and windows-uwp-gnu targets
2022-07-09Rollup merge of #99043 - compiler-errors:derive-nit, r=cjgillotDylan DPC-48/+8
Collapse some weirdly-wrapping derives self-explanatory
2022-07-08Implement support for DWARF version 5.Patrick Walton-13/+13
DWARF version 5 brings a number of improvements over version 4. Quoting from the announcement [1]: > Version 5 incorporates improvements in many areas: better data compression, > separation of debugging data from executable files, improved description of > macros and source files, faster searching for symbols, improved debugging > optimized code, as well as numerous improvements in functionality and > performance. On platforms where DWARF version 5 is supported (Linux, primarily), this commit adds support for it behind a new `-Z dwarf-version=5` flag. [1]: https://dwarfstd.org/Public_Review.php