about summary refs log tree commit diff
path: root/compiler/rustc_target/src
AgeCommit message (Collapse)AuthorLines
2024-02-19Fix ld platform_version argument on Mac CatalystMads Marquart-29/+13
2024-02-19Make LLVM target contain correct deployment target info on Mac CatalystMads Marquart-16/+23
2024-02-19Remove MACOSX_DEPLOYMENT_TARGET env var when linking Mac CatalystMads Marquart-10/+4
Mac Catalyst uses IPHONEOS_DEPLOYMENT_TARGET to specify the deployment target, so it makes no sense to remove that variable.
2024-02-19target: Revert default to the medium code model on LoongArch targetsWANG Rui-4/+3
This reverts commit 35dad14dfb63d77cf4a2077f1e8e9cff5a02a92b. Fixes #121289
2024-02-17Rollup merge of #121210 - madsmtm:fix-target-abi-i386-apple-ios, ↵Matthias Krüger-10/+15
r=workingjubilee Fix `cfg(target_abi = "sim")` on `i386-apple-ios` Since https://github.com/rust-lang/rust/issues/80970 is stabilizing, I went and had a look, and found that the result was wrong on `i386-apple-ios`. r? rust-lang/macos
2024-02-17Fix commentMads Marquart-2/+6
2024-02-17Fix `cfg(target_abi = "sim")` on i386-apple-iosMads Marquart-8/+9
i386-apple-ios is also a simulator target
2024-02-15Update aarch64 target feature docs to match LLVMAdam Gemmell-4/+4
2024-02-14Allow targets to override default codegen backendMaybe Waffle-0/+9
2024-02-13Added sahf feature to windows targetsCKingX-5/+5
2024-02-13Prefer `min_exhaustive_patterns` in compilerNadrieril-1/+2
2024-02-12Add lahfsahf and prfchw target featureChris Denton-0/+2
2024-02-10Remove unnecessary `min_specialization` after bootstrapZalathar-1/+1
These crates all needed specialization for `newtype_index!`, which will no longer be necessary when the current nightly eventually becomes the next bootstrap compiler.
2024-02-09Possibly removed merge policyChiragroop-3/+6
2024-02-09Update x86_64_uwp_windows_gnu.rsCKingX-1/+2
Updated x86_64-uwp-windows-gnu to use CMPXCHG16B and SSE3
2024-02-09Update x86_64_pc_windows_msvc.rsCKingX-1/+1
As CMPXCHG16B is supported, I updated the max atomic width to 128-bits from 64-bits
2024-02-09Update x86_64_pc_windows_msvc.rsCKingX-1/+1
Fixed a bug where adding CMPXCHG16B would fail due to different names in Rustc and LLVM
2024-02-09Rollup merge of #120693 - nnethercote:invert-diagnostic-lints, r=davidtwcoMatthias Krüger-2/+0
Invert diagnostic lints. That is, change `diagnostic_outside_of_impl` and `untranslatable_diagnostic` from `allow` to `deny`, because more than half of the compiler has been converted to use translated diagnostics. This commit removes more `deny` attributes than it adds `allow` attributes, which proves that this change is warranted. r? ````@davidtwco````
2024-02-08As Windows 10 requires certain features like CMPXCHG16B and a few others and ↵CKingX-0/+1
Rust plans to set Windows 10 as the minimum supported OS for target x86_64-pc-windows-msvc, I have added the cmpxchg16b and sse3 feature (as CPUs that meet the Windows 10 64-bit requirement also support SSE3. See https://walbourn.github.io/directxmath-sse3-and-ssse3/ )
2024-02-07Rollup merge of #119162 - heiher:direct-access-external-data, r=petrochenkovGuillaume Boisseau-0/+12
Add unstable `-Z direct-access-external-data` cmdline flag for `rustc` The new flag has been described in the Major Change Proposal at https://github.com/rust-lang/compiler-team/issues/707 Fixes #118053
2024-02-07Rollup merge of #110482 - chrisnc:armv8r-target, r=wesleywiserGuillaume Boisseau-0/+36
Add armv8r-none-eabihf target for the Cortex-R52.
2024-02-06Invert diagnostic lints.Nicholas Nethercote-2/+0
That is, change `diagnostic_outside_of_impl` and `untranslatable_diagnostic` from `allow` to `deny`, because more than half of the compiler has be converted to use translated diagnostics. This commit removes more `deny` attributes than it adds `allow` attributes, which proves that this change is warranted.
2024-02-05Rollup merge of #120661 - xen0n:loong-medium-cmodel, r=heiher,NilstriebMatthias Krüger-3/+4
target: default to the medium code model on LoongArch targets The Rust LoongArch targets have been using the default LLVM code model so far, which is "small" in LLVM-speak and "normal" in LoongArch-speak. As [described][1] in the "Code Model" section of LoongArch ELF psABI spec v20231219, one can only make function calls as far as ±128MiB with the "normal" code model; this is insufficient for very large software containing Rust components that needs to be linked into the big text section, such as Chromium. Because: * we do not want to ask users to recompile std if they are to build such software, * objects compiled with larger code models can be linked with those with smaller code models without problems, and * the "medium" code model is comparable to the "small"/"normal" one performance-wise (same data access pattern; each function call becomes 2-insn long and indirect, but this may be relaxed back into the direct 1-insn form in a future LLVM version), but is able to perform function calls within ±128GiB, it is better to just switch the targets to the "medium" code model, which is also "medium" in LLVM-speak. [1]: https://github.com/loongson/la-abi-specs/blob/v2.30/laelf.adoc#code-models
2024-02-05Rollup merge of #120518 - kxxt:riscv-split-debug-info, r=compiler-errorsMatthias Krüger-5/+20
riscv only supports split_debuginfo=off for now Disable packed/unpacked options for riscv linux/android. Other riscv targets already only have the off option. The packed/unpacked options might be supported in the future. See upstream issue for more details: https://github.com/llvm/llvm-project/issues/56642 Fixes #110224
2024-02-05target: default to the medium code model on LoongArch targetsWANG Xuerui-3/+4
The Rust LoongArch targets have been using the default LLVM code model so far, which is "small" in LLVM-speak and "normal" in LoongArch-speak. As described in the "Code Model" section of LoongArch ELF psABI spec v20231219 [1], one can only make function calls as far as ±128MiB with the "normal" code model; this is insufficient for very large software containing Rust components that needs to be linked into the big text section, such as Chromium. Because: * we do not want to ask users to recompile std if they are to build such software, * objects compiled with larger code models can be linked with those with smaller code models without problems, and * the "medium" code model is comparable to the "small"/"normal" one performance-wise (same data access pattern; each function call becomes 2-insn long and indirect, but this may be relaxed back into the direct 1-insn form in a future LLVM version), but is able to perform function calls within ±128GiB, it is better to just switch the targets to the "medium" code model, which is also "medium" in LLVM-speak. [1]: https://github.com/loongson/la-abi-specs/blob/v2.30/laelf.adoc#code-models
2024-02-04Add an `armv8r-none-eabihf` target to support the Cortex-R52.Chris Copeland-0/+36
2024-02-03Rollup merge of #119543 - usamoi:avx512fp16, r=oli-obkMatthias Krüger-0/+1
add avx512fp16 to x86 target features std_detect avx512fp16: https://github.com/rust-lang/stdarch/pull/1508
2024-01-31Rollup merge of #120495 - clubby789:remove-amdgpu-kernel, r=oli-obkNadrieril-25/+14
Remove the `abi_amdgpu_kernel` feature The tracking issue (#51575) has been closed for 3 years, with no activity for 5.
2024-01-31riscv only supports split_debuginfo=off for nowkxxt-5/+20
Disable packed/unpacked options for riscv linux/android. Other riscv targets already only have the off option. The packed/unpacked options might be supported in the future. See upstream issue for more details: https://github.com/llvm/llvm-project/issues/56642 Fixes #110224
2024-01-30Remove the `abi_amdgpu_kernel` featureclubby789-25/+14
2024-01-28Revert "Add the wasm32-wasi-preview2 target"León Orell Valerian Liehr-67/+1
This reverts commit 31ecf341250a889ac1154b2cbe3f0b97f9d008c1. Co-authored-by: Ryan Levick <me@ryanlevick.com>
2024-01-26i586_unknown_netbsd: use inline stack probesErik Desjardins-1/+1
This is one of the last two targets still using "call" stack probes.
2024-01-25Remove unused featuresclubby789-2/+0
2024-01-25Rollup merge of #120278 - djkoloski:remove_fatal_warnings_wasm, r=oli-obkMatthias Krüger-7/+1
Remove --fatal-warnings on wasm targets These were added with good intentions, but a recent change in LLVM 18 emits a warning while examining .rmeta sections in .rlib files. Since this flag is a nice-to-have and users can update their LLVM linker independently of rustc's LLVM version, we can just omit the flag. See [this comment on wasm targets' uses of `--fatal-warnings`](https://github.com/llvm/llvm-project/pull/78658#issuecomment-1906651390).
2024-01-24Rollup merge of #119616 - rylev:wasm32-wasi-preview2, r=petrochenkov,m-ou-seLeón Orell Valerian Liehr-1/+67
Add a new `wasm32-wasi-preview2` target This is the initial implementation of the MCP https://github.com/rust-lang/compiler-team/issues/694 creating a new tier 3 target `wasm32-wasi-preview2`. That MCP has been seconded and will most likely be approved in a little over a week from now. For more information on the need for this target, please read the [MCP](https://github.com/rust-lang/compiler-team/issues/694). There is one aspect of this PR that will become insta-stable once these changes reach a stable compiler: * A new `target_family` named `wasi` is introduced. This target family incorporates all wasi targets including `wasm32-wasi` and its derivative `wasm32-wasi-preview1-threads`. The difference between `target_family = wasi` and `target_os = wasi` will become much clearer when `wasm32-wasi` is renamed to `wasm32-wasi-preview1` and the `target_os` becomes `wasm32-wasi-preview1`. You can read about this target rename in [this MCP](https://github.com/rust-lang/compiler-team/issues/695) which has also been seconded and will hopefully be officially approved soon. Additional technical details include: * Both `std::sys::wasi_preview2` and `std::os::wasi_preview2` have been created and mostly use `#[path]` annotations on their submodules to reach into the existing `wasi` (soon to be `wasi_preview1`) modules. Over time the differences between `wasi_preview1` and `wasi_preview2` will grow and most like all `#[path]` based module aliases will fall away. * Building `wasi-preview2` relies on a [`wasi-sdk`](https://github.com/WebAssembly/wasi-sdk) in the same way that `wasi-preview1` does (one must include a `wasi-root` path in the `Config.toml` pointing to sysroot included in the wasi-sdk). The target should build against [wasi-sdk v21](https://github.com/WebAssembly/wasi-sdk/releases/tag/wasi-sdk-21) without modifications. However, the wasi-sdk itself is growing [preview2 support](https://github.com/WebAssembly/wasi-sdk/pull/370) so this might shift rapidly. We will be following along quickly to make sure that building the target remains possible as the wasi-sdk changes. * This requires a [patch to libc](https://github.com/rylev/rust-libc/tree/wasm32-wasi-preview2) that we'll need to land in conjunction with this change. Until that patch lands the target won't actually build.
2024-01-23Rollup merge of #120188 - devnexen:update_bsd_compiler_base_specs, r=wesleywiserLeón Orell Valerian Liehr-0/+3
compiler: update freebsd and netbsd base specs. both support thread local.
2024-01-23Remove --fatal-warnings on wasm targetsDavid Koloski-7/+1
These were added with good intentions, but a recent change in LLVM 18 emits a warning while examining .rmeta sections in .rlib files. Since this flag is a nice-to-have and users can update their LLVM linker independently of rustc's LLVM version, we can just omit the flag.
2024-01-23Add the wasm32-wasi-preview2 targetRyan Levick-1/+67
Signed-off-by: Ryan Levick <me@ryanlevick.com>
2024-01-22rustc: implement support for `riscv32im_risc0_zkvm_elf`Erik Kaneda-0/+37
This also adds changes in the rust test suite in order to get a few of them to pass. Co-authored-by: Frank Laub <flaub@risc0.com> Co-authored-by: Urgau <3616612+Urgau@users.noreply.github.com>
2024-01-22compiler: update freebsd and netbsd base specs.David Carlier-0/+3
both support thread local.
2024-01-19Update more data layoutsNikita Popov-7/+7
2024-01-19LLVM 18 x86 data layout updateMatthew Maurer-80/+80
With https://reviews.llvm.org/D86310 LLVM now has i128 aligned to 16-bytes on x86 based platforms. This will be in LLVM-18. This patch updates all our spec targets to be 16-byte aligned, and removes the alignment when speaking to older LLVM. This results in Rust overaligning things relative to LLVM on older LLVMs. This alignment change was discussed in rust-lang/compiler-team#683 See #54341 for additional information about why this is happening and where this will be useful in the future. This *does not* stabilize `i128`/`u128` for FFI.
2024-01-17Rollup merge of #119855 - rellerreller:freebsd-static, r=wesleywiserMatthias Krüger-0/+1
Enable Static Builds for FreeBSD Enable crt-static for FreeBSD to enable statically compiled binaries.
2024-01-17target: fix powerpc64-unknown-linux-musl datalayoutDavid Wood-1/+1
In LLVM 17, PowerPC targets started including function pointer alignments in data layouts, and in Rust's update to that version (#114048), we added the function pointer alignments. `powerpc64-unknown-linux-musl` had `Fi64` set but this seems incorrect, and the code in LLVM would always have computed `Fn32` because it is a MUSL target. Signed-off-by: David Wood <david@davidtw.co>
2024-01-17tests: add sanity-check assembly test for every targetDavid Wood-7/+0
Adds a basic assembly test checking that each target can produce assembly and update the target tier policy to require this. Signed-off-by: David Wood <david@davidtw.co>
2024-01-16Add unstable `-Z direct-access-external-data` cmdline flag for `rustc`WANG Rui-0/+12
The new flag has been described in the Major Change Proposal at https://github.com/rust-lang/compiler-team/issues/707
2024-01-13Auto merge of #119927 - matthiaskrgr:rollup-885ws57, r=matthiaskrgrbors-5/+10
Rollup of 6 pull requests Successful merges: - #119587 (Varargs support for system ABI) - #119891 (rename `reported_signature_mismatch` to reflect its use) - #119894 (Allow `~const` on associated type bounds again) - #119896 (Taint `_` placeholder types in trait impl method signatures) - #119898 (Remove unused `ErrorReporting` variant from overflow handling) - #119902 (fix typo in `fn()` docs) r? `@ghost` `@rustbot` modify labels: rollup
2024-01-13Rollup merge of #119587 - beepster4096:system_varargs, r=petrochenkovMatthias Krüger-5/+10
Varargs support for system ABI This PR allows functions with the `system` ABI to be variadic (under the `extended_varargs_abi_support` feature tracked in #100189). On x86 windows, the `system` ABI is equivalent to `C` for variadic functions. On other platforms, `system` is already equivalent to `C`. Fixes #110505
2024-01-12allow system abi to be variadicbeepster4096-5/+10
2024-01-13add avx512fp16 to x86 target featuresusamoi-0/+1