about summary refs log tree commit diff
path: root/compiler/rustc_target/src/spec
AgeCommit message (Collapse)AuthorLines
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-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-01-31Rollup merge of #120495 - clubby789:remove-amdgpu-kernel, r=oli-obkNadrieril-22/+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-22/+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-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-3/+8
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-3/+8
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-3/+8
2024-01-12update paths in commentsjoboet-1/+1
2024-01-11Enable Static Builds for FreeBSDNathan Reller-0/+1
Enable crt-static for FreeBSD to enable statically compiled binaries.
2024-01-09Remove more needless leb128 coding for enum variantsMark Rousskov-7/+10
This removes emit_enum_variant and the emit_usize calls that resulted in. In libcore this eliminates 17% of leb128, taking us from 8964488 to 7383842 leb128's serialized.
2024-01-08GNU/Hurd: unconditionally use inline stack probesErik Desjardins-1/+1
LLVM 11 has been unsupported since 45591408b18e7f93fcf8c09210c9a5a102d84b37, so this doesn't need to be conditional on the LLVM version.
2024-01-08Add riscv32imafc-esp-espidf target for the ESP32-P4.Scott Mabin-0/+32
2024-01-06compiler: update Fuchsia sanitizer support.David Carlier-1/+2
2024-01-04Rollup merge of #118521 - dpaoliello:asan, r=wesleywiserMatthias Krüger-2/+4
Enable address sanitizer for MSVC targets using INFERASANLIBS linker flag This enables address sanitizer for x86_64-pc-windows-msvc and i686-pc-windows-msvc targets when linked with the MSVC linker (link.exe) by leveraging the `/INFERASANLIBS` option to automatically find and link in Microsoft's address sanitizer runtime: <https://learn.microsoft.com/en-us/cpp/sanitizers/asan-runtime?view=msvc-170> Implements https://github.com/rust-lang/compiler-team/issues/702 Fixes #89339 (for MSVC targets using the MSVC linker only) Supercedes #89369 Successful x86_64-msvc build showing the sanitizer tests working: https://github.com/rust-lang/rust/actions/runs/7228346880/job/19697628258?pr=118521
2024-01-03Enable address sanitizer for MSVC targets using INFERASANLIBS linker flagDaniel Paoliello-2/+4
2024-01-03Rollup merge of #119544 - roblabla:new-win7-targets, r=NilstriebLeón Orell Valerian Liehr-0/+1
Fix: Properly set vendor in i686-win7-windows-msvc target In #118150 , setting the `vendor` field of the `i686-win7-windows-msvc` target was forgotten, preventing us from easily checking the target using `cfg(target_vendor)`. With this PR, we set the target vendor to "win7".
2024-01-03Fix: Properly set vendor in i686-win7-windows-msvc targetroblabla-0/+1
2023-12-30Update to bitflags 2 in the compilerNilstrieb-49/+6
This involves lots of breaking changes. There are two big changes that force changes. The first is that the bitflag types now don't automatically implement normal derive traits, so we need to derive them manually. Additionally, bitflags now have a hidden inner type by default, which breaks our custom derives. The bitflags docs recommend using the impl form in these cases, which I did.
2023-12-23Rollup merge of #112936 - Toasterson:illumos-aarch64-target, r=jackh726Matthias Krüger-0/+20
Add illumos aarch64 target for rust. This adds the newly being developed illumos aarch64 target to the rust compiler. `@rmustacc` `@citrus-it` `@richlowe` As promissed before my hiatus :)
2023-12-22Rollup merge of #117601 - androm3da:hexagon_unknown_none_elf, r=petrochenkovMatthias Krüger-1/+30
Add support for hexagon-unknown-none-elf as target Still TODO: document usage details for new target
2023-12-21Removing unneeded cpu defintion and add features analogous to netbsd/freebsdTill Wegmueller-1/+1
Signed-off-by: Till Wegmueller <toasterson@gmail.com>
2023-12-21Add support for hexagon-unknown-none-elf as targetBrian Cain-1/+30
Signed-off-by: Brian Cain <bcain@quicinc.com>
2023-12-21Fix name error in aarch64_apple_watchos tier 3 targetLeo Howell-1/+1
2023-12-19Use LLVM features for arm64e_apple_ios targetArtyom Tetyukhin-1/+1
We need to use LLVM features here. Otherwise we get warnings such as '+paca' is not a recognized feature for this target (ignoring feature)
2023-12-19Remove legacy bitcode defaultsArtyom Tetyukhin-9/+4
2023-12-18Add new tier 3 aarch64-apple-watchos targetleohowell-0/+20
2023-12-14Auto merge of #118417 - anforowicz:default-hidden-visibility, r=TaKO8Kibors-1/+5
Add unstable `-Zdefault-hidden-visibility` cmdline flag for `rustc`. The new flag has been described in the Major Change Proposal at https://github.com/rust-lang/compiler-team/issues/656
2023-12-14Auto merge of #118491 - cuviper:aarch64-stack-probes, r=wesleywiserbors-58/+69
Enable stack probes on aarch64 for LLVM 18 I tested this on `aarch64-unknown-linux-gnu` with LLVM main (~18). cc #77071, to be closed once we upgrade our LLVM submodule.
2023-12-13Add unstable `-Zdefault-hidden-visibility` cmdline flag for `rustc`.Lukasz Anforowicz-1/+5
The new flag has been described in the Major Change Proposal at https://github.com/rust-lang/compiler-team/issues/656