about summary refs log tree commit diff
path: root/compiler/rustc_target/src/spec
AgeCommit message (Collapse)AuthorLines
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-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-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-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-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-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-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-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-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-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-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
2022-07-06fix issue 97463 using change suggested by nbdd0121.Felix S. Klock II-0/+2
parameterized on target details to decide value-extension policy on calls, in order to address how Apple's aarch64 ABI differs from that on Linux and Windows. Updated to incorporate review feedback: adjust comment on new enum specifying param extension policy. Updated to incorporate review feedback: shorten enum names and those of its variants to make it less unwieldy. placate tidy.
2022-06-25rustc_target: Some more tests and fixes for linker argumentsVadim Petrochenkov-44/+131
2022-06-25rustc_target: Add convenience functions for adding linker argumentsVadim Petrochenkov-420/+348
They ensure that lld and non-lld linker flavors get the same set of arguments
2022-06-24Set relocation_model to Pic on emscripten targetHood Chatham-1/+2
2022-06-24Rollup merge of #98214 - petrochenkov:islike, r=compiler-errorsYuki Okushi-14/+5
rustc_target: Remove some redundant target properties `is_like_emscripten` is equivalent to `os == "emscripten"`, so it's removed. `is_like_fuchsia` is equivalent to `os == "fuchsia"`, so it's removed. `is_like_osx` also falls into the same category and is equivalent to `vendor == "apple"`, but it's commonly used so I kept it as is for now. `is_like_(solaris,windows,wasm)` are combinations of different operating systems or architectures (see compiler/rustc_target/src/spec/tests/tests_impl.rs) so they are also kept as is. I think `is_like_wasm` (and maybe `is_like_osx`) are sufficiently closed sets, so we can remove these fields as well and replace them with methods like `fn is_like_wasm() { arch == "wasm32" || arch == "wasm64" }`. On other hand, `is_like_solaris` and `is_like_windows` are sufficiently open and I can imagine custom targets introducing other values for `os`. This is kind of a gray area.
2022-06-22Set no_default_libraries: false in wasm32_emscripten targetHood Chatham-0/+1
2022-06-21Re-enable atomic loads and stores for all RISC-V targetsSimon Sapin-3/+3
This roughly reverts PR https://github.com/rust-lang/rust/pull/66548 Atomic "CAS" are still disabled for targets without the *“A” Standard Extension for Atomic Instructions*. However this extension only adds instructions for operations more complex than simple loads and stores, which are always atomic when aligned. In the [Unprivileged Spec v. 20191213](https://riscv.org/technical/specifications/) section 2.6 *Load and Store Instructions* of chapter 2 *RV32I Base Integer Instruction Set* (emphasis mine): > Even when misaligned loads and stores complete successfully, > these accesses might run extremely slowly depending on the implementation > (e.g., when implemented via an invisible trap). Further-more, whereas > **naturally aligned loads and stores are guaranteed to execute atomically**, > misaligned loads and stores might not, and hence require > additional synchronization to ensure atomicity. Unfortunately PR https://github.com/rust-lang/rust/pull/66548 did not provide much details on the bug that motivated it, but https://github.com/rust-lang/rust/issues/66240 and https://github.com/rust-lang/rust/issues/85736 appear related and happen with targets that do have the A extension.