about summary refs log tree commit diff
path: root/compiler/rustc_target
AgeCommit message (Collapse)AuthorLines
2022-02-28Auto merge of #94216 - psumbera:sparc64-abi-fix2, r=nagisabors-100/+176
more complete sparc64 ABI fix for aggregates with floating point members Previous fix didn't handle nested structures at all.
2022-02-23riscv32imc_esp_espidf: set max_atomic_width to 64Scott Mabin-2/+2
2022-02-21Add testsAmanieu d'Antras-2/+2
2022-02-21Take CodegenFnAttrs into account when validating asm! register operandsAmanieu d'Antras-120/+94
Checking of asm! register operands now properly takes function attributes such as #[target_feature] and #[instruction_set] into account.
2022-02-21On ARM, use relocation_model to detect whether r9 should be reservedAmanieu d'Antras-44/+58
The previous approach of checking for the reserve-r9 target feature didn't actually work because LLVM only sets this feature very late when initializing the per-function subtarget.
2022-02-21Simplify gating of BPF w registers behind the alu32 target featureAmanieu d'Antras-26/+12
This is already handled by supported_types().
2022-02-21formatting fixesPetr Sumbera-8/+2
2022-02-21more complete sparc64 ABI fix for aggregates with floating point membersPetr Sumbera-101/+183
Previous fix didn't handle nested structures at all.
2022-02-20Rollup merge of #94146 - est31:let_else, r=cjgillotMatthias Krüger-6/+4
Adopt let else in more places Continuation of #89933, #91018, #91481, #93046, #93590, #94011. I have extended my clippy lint to also recognize tuple passing and match statements. The diff caused by fixing it is way above 1 thousand lines. Thus, I split it up into multiple pull requests to make reviewing easier. This is the biggest of these PRs and handles the changes outside of rustdoc, rustc_typeck, rustc_const_eval, rustc_trait_selection, which were handled in PRs #94139, #94142, #94143, #94144.
2022-02-19Adopt let else in more placesest31-6/+4
2022-02-18Rollup merge of #93877 - Amanieu:asm_fixes, r=nagisaMatthias Krüger-41/+91
asm: Allow the use of r8-r14 as clobbers on Thumb1 Previously these were entirely disallowed, except for r11 which was allowed by accident. cc `@hudson-ayers`
2022-02-18Rollup merge of #93814 - Itus-Shield:mips64-openwrt, r=bjorn3Matthias Krüger-1/+1
mips64-openwrt-linux-musl: correct soft-foat MIPS64 targets under OpenWrt require soft-float fpu support. Rust-lang requires soft-float defined in tuple definition and isn't over-ridden by toolchain compile-time CFLAGS/LDFLAGS Set explicit soft-float for tuple. Signed-off-by: Donald Hoskins <grommish@gmail.com>
2022-02-18Rollup merge of #91675 - ivanloz:memtagsan, r=nagisaMatthias Krüger-1/+8
Add MemTagSanitizer Support Add support for the LLVM [MemTagSanitizer](https://llvm.org/docs/MemTagSanitizer.html). On hardware which supports it (see caveats below), the MemTagSanitizer can catch bugs similar to AddressSanitizer and HardwareAddressSanitizer, but with lower overhead. On a tag mismatch, a SIGSEGV is signaled with code SEGV_MTESERR / SEGV_MTEAERR. # Usage `-Zsanitizer=memtag -C target-feature="+mte"` # Comments/Caveats * MemTagSanitizer is only supported on AArch64 targets with hardware support * Requires `-C target-feature="+mte"` * LLVM MemTagSanitizer currently only performs stack tagging. # TODO * Tests * Example
2022-02-18asm: Allow the use of r8-r14 as clobbers on Thumb1Amanieu d'Antras-41/+91
Previously these were entirely disallowed, except for r11 which was allowed by accident.
2022-02-17Auto merge of #93577 - nikic:llvm-14, r=nagisabors-5/+6
Upgrade to LLVM 14 LLVM patch state: * [x] https://github.com/llvm/llvm-project/commit/a55727f334b39600bfc71144b11b42aae6b94e0b Backported. * [x] https://github.com/rust-lang/llvm-project/commit/c3c82dc12402dd41441180c0c6cf7aed7e330c53 Backported as https://github.com/llvm/llvm-project/commit/917c47b3bf0dfc45a2a5ba12c1397d647ecf4017. * [x] https://github.com/rust-lang/llvm-project/commit/6e8f9ab632d12271355d10d34c9835a7ba14e4b9 No plan to upstream. * [x] https://github.com/llvm/llvm-project/commit/319f4b2d52e31b000db75a0a2484b5f2ab90534a Backported. * [x] https://github.com/rust-lang/llvm-project/commit/8b2c25d321f877161f85218479e2d1317d770e18 No plan to upstream. * [x] https://github.com/rust-lang/llvm-project/commit/75fef2efd427362c8f16b2d09e6ebf44069e3919 No plan to upstream. * [ ] https://github.com/rust-lang/llvm-project/commit/adef757547de5a570d9f6a00d3e6ac16c666ab79 Upstreamed as https://github.com/llvm/llvm-project/commit/2d2ef384b2f6e723edb793d08f52e7f4dc94ba3a. Needs backport. * [x] https://github.com/rust-lang/llvm-project/commit/4b7c1b4910e9fa9e04f23f06be078e168ef4c0ee No plan to upstream. * [x] https://github.com/rust-lang/llvm-project/commit/3f5ab0c061adb723f25b94243828b6b5407720c8 No plan to upstream. * [x] https://github.com/rust-lang/llvm-project/commit/514d05500e0e15e358f05f5c4cec78a805858f8e No plan to upstream. * [ ] https://github.com/rust-lang/llvm-project/commit/54c586958564582b3341d1838a5de86541e5fecf Under review at https://reviews.llvm.org/D119695 and https://reviews.llvm.org/D119856. Release timeline: * LLVM 14.0.0 final planned for Mar 15. * Rust 1.60.0 planned for Apr 7. Compile-time: * https://perf.rust-lang.org/compare.html?start=250384edc5d78533e993f38c60d64e42b21684b2&end=b87df8d2c7c5d9ac448c585de10927ab2ee1b864 * A slight improvement on average, though no big changes either way. * There are some larger max-rss improvements. r? `@ghost`
2022-02-16Update data layout for wasm32 targetsNikita Popov-3/+4
New address spaces were added in https://reviews.llvm.org/D111154.
2022-02-16Update data layout for 32-bit msvc targetsNikita Popov-2/+2
https://reviews.llvm.org/D115942 changed the alignment of f80.
2022-02-16MemTagSanitizer SupportIvan Lozano-1/+8
Adds support for the LLVM MemTagSanitizer.
2022-02-15Inline Target::derefTomasz Miąsko-0/+2
2022-02-13rustc_target: Remove compiler-rt linking hack on AndroidVadim Petrochenkov-7/+1
2022-02-13Auto merge of #93670 - erikdesjardins:noundef, r=nikicbors-1/+6
Apply noundef attribute to &T, &mut T, Box<T>, bool This doesn't handle `char` because it's a bit awkward to distinguish it from `u32` at this point in codegen. Note that this _does not_ change whether or not it is UB for `&`, `&mut`, or `Box` to point to undef. It only applies to the pointer itself, not the pointed-to memory. Fixes (partially) #74378. r? `@nikic` cc `@RalfJung`
2022-02-10Auto merge of #93854 - matthiaskrgr:rollup-bh2a85j, r=matthiaskrgrbors-0/+18
Rollup of 7 pull requests Successful merges: - #92670 (add kernel target for RustyHermit) - #93756 (Support custom options for LLVM build) - #93802 (fix oversight in the `min_const_generics` checks) - #93808 (Remove first headings indent) - #93824 (Stabilize cfg_target_has_atomic) - #93830 (Refactor sidebar printing code) - #93843 (kmc-solid: Fix wait queue manipulation errors in the `Condvar` implementation) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-02-09Make FnAbiError Copy.Camille GILLOT-3/+7
2022-02-09mips64-openwrt-linux-musl: correct soft-foatDonald Hoskins-1/+1
MIPS64 targets under OpenWrt require soft-float fpu support. Rust-lang requires soft-float defined in tuple definition and isn't over-ridden by toolchain compile-time CFLAGS/LDFLAGS Set explicit soft-float for tuple. Signed-off-by: Donald Hoskins <grommish@gmail.com>
2022-02-08rename file to use the correct naming conventionStefan Lankes-0/+0
2022-02-08add missing targert for library operating system RustyHermitStefan Lankes-0/+1
2022-02-08add kernel target for RustyHermitStefan Lankes-0/+17
Currently, we are thinking to use *-unknown-none targets instead to define for every platform our own one (see hermitcore/rusty-hermit#197). However, the current target aarch64-unknown-none-softfloat doesn't support dynamic relocation. Our kernel uses this feature and consequently we define a new target aarch64-unknown-hermitkernel to support it.
2022-02-08Auto merge of #93561 - Amanieu:more-unwind-abi, r=nagisabors-57/+71
Add more *-unwind ABI variants The following *-unwind ABIs are now supported: - "C-unwind" - "cdecl-unwind" - "stdcall-unwind" - "fastcall-unwind" - "vectorcall-unwind" - "thiscall-unwind" - "aapcs-unwind" - "win64-unwind" - "sysv64-unwind" - "system-unwind" cc `@rust-lang/wg-ffi-unwind`
2022-02-07Rollup merge of #93680 - Mark-Simulacrum:drop-json-reader, r=bjorn3Mara Bos-2/+2
Drop json::from_reader Just a small cleanup -- this was essentially unused; the one use site is better suited to reading from &str regardless.
2022-02-06Rollup merge of #92383 - lancethepants:armv7-unknown-linux-uclibceabi, r=nagisaMatthias Krüger-0/+24
Add new target armv7-unknown-linux-uclibceabi (softfloat) This adds the new target `armv7-unknown-linux-uclibceabi (softfloat)`. It is of course similar to `armv7-unknown-linux-uclibceabihf (hardfloat)` which was just recently added to rust except that it is `softfloat`. My interest lies in the Broadcom BCM4707/4708/BCM4709 family, notably found in some Netgear and Asus consumer routers. The armv7 Cortex-A9 cpus found in these devices do not have an fpu or NEON support. With this patch I've been able to bootstrap rustc, std and host tools `(extended = true)` to run on the target device for native compilation, allowing the target to be used as a development platform. With the recent addition of `armv7-unknown-linux-uclibceabihf (hardfloat)` it looks like many of the edge cases of using the uclibc c-library are getting worked out nicely. I've been able to compile some complex projects. Some patching still needed in some crates, but getting there for sure. I think `armv7-unknown-linux-uclibceabi` is ready to be a tier 3 target. I use a cross-toolchain from my project to bootstrap rust. https://github.com/lancethepants/tomatoware The goal of this project is to create a native development environment with support for various languages.
2022-02-06Rollup merge of #92300 - Itus-Shield:mips64-openwrt, r=nagisaMatthias Krüger-0/+28
mips64-openwrt-linux-musl: Add Tier 3 target Tier 3 tuple for Mips64 OpenWrt toolchain. This add first-time support for OpenWrt. Future Tier3 targets will be added as I test them. Signed-off-by: Donald Hoskins <grommish@gmail.com>
2022-02-05Drop json::from_readerMark Rousskov-2/+2
Performing UTF-8 decode outside the JSON module makes more sense in almost all cases.
2022-02-05Apply noundef attribute to &T, &mut T, Box<T>, boolErik Desjardins-1/+6
This doesn't handle `char` because it's a bit awkward to distinguish it from u32 at this point in codegen. Note that for some types (like `&Struct` and `&mut Struct`), we already apply `dereferenceable`, which implies `noundef`, so the IR does not change.
2022-02-04Add new target armv7-unknown-linux-uclibceabi (softfloat)lancethepants-0/+24
2022-02-02Add more *-unwind ABI variantsAmanieu d'Antras-57/+71
The following *-unwind ABIs are now supported: - "C-unwind" - "cdecl-unwind" - "stdcall-unwind" - "fastcall-unwind" - "vectorcall-unwind" - "thiscall-unwind" - "aapcs-unwind" - "win64-unwind" - "sysv64-unwind" - "system-unwind"
2022-02-01Rollup merge of #92021 - woodenarrow:br_single_fp_element, r=Mark-SimulacrumMatthias Krüger-40/+22
Eliminate duplicate codes of is_single_fp_element There are duplicate codes of is_single_fp_element function. Merge these codes to TyAndLayout impl block. ![image](https://user-images.githubusercontent.com/95843988/146707753-ba9ffc41-5888-4a53-80cf-f4fe3bcbac54.png)
2022-02-01Rollup merge of #86374 - bossmc:enable-static-pie-for-gnu, r=nagisaMatthias Krüger-0/+1
Enable combining `+crt-static` and `relocation-model=pic` on `x86_64-unknown-linux-gnu` Modern `gcc` versions support `-static-pie`, and `rustc` will already fall-back to `-static` if the local `gcc` is too old (and hence this change is optimistic rather than absolute). This brings the `-musl` and `-gnu` targets to feature compatibility (albeit with different default settings). Of note a `-static` or `-static-pie` binary based on glibc that uses NSS-backed functions (`gethostbyname` or `getpwuid` etc.) need to have access to the `libnss_X.so.2` libraries and any of their dynamic dependencies. I wasn't sure about the `# only`/`# ignore` changes (I've not got a `gnux32` toolchain to test with hence not also enabling `-static-pie` there).
2022-01-31[mips64-openwrt-musl] Tier 3 tuple for Mips64 OpenWrtDonald Hoskins-0/+28
This incorporates rust-lang into the OpenWrt build system for Mips64 targets. Signed-off-by: Donald Hoskins <grommish@gmail.com>
2022-01-31Rollup merge of #90277 - pierwill:fix-70258-inference-terms, r=jackh726Matthias Krüger-1/+1
Improve terminology around "after typeck" Closes #70258.
2022-01-22Add preliminary support for inline assembly for msp430.William D. Jones-0/+106
2022-01-21adapt L4Bender implementationBenjamin Lamowski-9/+8
- Fix style errors. - L4-bender does not yet support dynamic linking. - Stack unwinding is not yet supported for x86_64-unknown-l4re-uclibc. For now, just abort on panics. - Use GNU-style linker options where possible. As suggested by review: - Use standard GNU-style ld syntax for relro flags. - Use standard GNU-style optimization flags and logic. - Use standard GNU-style ld syntax for --subsystem. - Don't read environment variables in L4Bender linker. Thanks to CARGO_ENCODED_RUSTFLAGS introduced in #9601, l4-bender's arguments can now be passed from the L4Re build system without resorting to custom parsing of environment variables.
2022-01-21Add L4Bender as linker variantSebastian Humenda-16/+11
2022-01-17Pass target_features set instead of has_feature closurebjorn3-54/+59
This avoids unnecessary monomorphizations in codegen backends
2022-01-17Use Symbol for target features in asm handlingbjorn3-49/+62
This saves a couple of Symbol::intern calls
2022-01-16Rollup merge of #92581 - Meziu:armv6k-3ds-target, r=nagisaMatthias Krüger-0/+1
ARMv6K Horizon - Enable default libraries Due to the nature of the external gcc linker, default libraries are required, even for `no_std` programs.
2022-01-09eplace usages of vec![].into_iter with [].into_iterLucas Kent-8/+6
2022-01-06sess/cg: re-introduce split dwarf kindDavid Wood-1/+1
In #79570, `-Z split-dwarf-kind={none,single,split}` was replaced by `-C split-debuginfo={off,packed,unpacked}`. `-C split-debuginfo`'s packed and unpacked aren't exact parallels to single and split, respectively. On Unix, `-C split-debuginfo=packed` will put debuginfo into object files and package debuginfo into a DWARF package file (`.dwp`) and `-C split-debuginfo=unpacked` will put debuginfo into dwarf object files and won't package it. In the initial implementation of Split DWARF, split mode wrote sections which did not require relocation into a DWARF object (`.dwo`) file which was ignored by the linker and then packaged those DWARF objects into DWARF packages (`.dwp`). In single mode, sections which did not require relocation were written into object files but ignored by the linker and were not packaged. However, both split and single modes could be packaged or not, the primary difference in behaviour was where the debuginfo sections that did not require link-time relocation were written (in a DWARF object or the object file). This commit re-introduces a `-Z split-dwarf-kind` flag, which can be used to pick between split and single modes when `-C split-debuginfo` is used to enable Split DWARF (either packed or unpacked). Signed-off-by: David Wood <david.wood@huawei.com>
2022-01-05Enable default librariesAndrea Ciliberti-0/+1
2021-12-19Auto merge of #92099 - matthiaskrgr:rollup-4gwv67m, r=matthiaskrgrbors-26/+20
Rollup of 7 pull requests Successful merges: - #91141 (Revert "Temporarily rename int_roundings functions to avoid conflicts") - #91984 (Remove `in_band_lifetimes` from `rustc_middle`) - #92028 (Sync portable-simd to fix libcore build for AVX-512 enabled targets) - #92042 (Enable `#[thread_local]` for all windows-msvc targets) - #92071 (Update example code for Vec::splice to change the length) - #92077 (rustdoc: Remove unused `collapsed` field) - #92081 (rustdoc: Remove unnecessary `need_backline` function) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-12-19Auto merge of #91957 - nnethercote:rm-SymbolStr, r=oli-obkbors-14/+14
Remove `SymbolStr` This was originally proposed in https://github.com/rust-lang/rust/pull/74554#discussion_r466203544. As well as removing the icky `SymbolStr` type, it allows the removal of a lot of `&` and `*` occurrences. Best reviewed one commit at a time. r? `@oli-obk`