about summary refs log tree commit diff
path: root/compiler/rustc_target/src
AgeCommit message (Collapse)AuthorLines
2020-10-04Support static linking with glibc and target-feature=+crt-staticJosh Triplett-2/+2
With this change, it's possible to build on a linux-gnu target and pass RUSTFLAGS='-C target-feature=+crt-static' or the equivalent via a `.cargo/config.toml` file, and get a statically linked executable. This requires libc 0.2.79, which adds support for static linking with glibc. Add `crt_static_respected` to the `linux_base` target spec. Update `android_base` and `linux_musl_base` accordingly. Avoid enabling crt_static_respected on Android platforms, since that hasn't been tested.
2020-10-04Removes reg aliases since there are many ABIs: o32/n32/n64Lzu Tao-32/+32
2020-10-04Add asm! support for mips64Lzu Tao-7/+12
2020-10-04mips32: Add f64 hard-float supportLzu Tao-1/+1
co-authored-by: Amanieu <amanieu@gmail.com>
2020-10-02Returns values up to 2*usize by valueJonas Schievink-12/+0
2020-10-01Rollup merge of #77202 - ehuss:defer-apple-sdkroot, r=petrochenkovDylan DPC-128/+20
Defer Apple SDKROOT detection to link time. This defers the detection of the SDKROOT for Apple iOS/tvOS targets to link time, instead of when the `Target` is defined. This allows commands that don't need to link to work (like `rustdoc` or `rustc --print=target-list`). This also makes `--print=target-list` a bit faster. This also removes the note in the platform support documentation about these targets being missing. When I wrote it, I misunderstood how the SDKROOT stuff worked. Notes: * This means that JSON spec targets can't explicitly override these flags. I think that is probably fine, as I believe the value is generally required, and can be set with the SDKROOT environment variable. * This changes `x86_64-apple-tvos` to use `appletvsimulator`. I think the original code was wrong (it was using `iphonesimulator`). Also, `x86_64-apple-tvos` seems broken in general, and I cannot build it locally. The `data_layout` does not appear to be correct (it is a copy of the arm64 layout instead of the x86_64 layout). I have not tried building Apple's LLVM to see if that helps, but I suspect it is just wrong (I'm uncertain since I don't know how the tvOS simulator works with its bitcode-only requirements). * I'm tempted to remove the use of `Result` for built-in target definitions, since I don't think they should be fallible. This was added in https://github.com/rust-lang/rust/pull/34980, but that only relates to JSON definitions. I think the built-in targets shouldn't fail. I can do this now, or not. Fixes #36156 Fixes #76584
2020-09-27Rollup merge of #76839 - lzutao:mips-asm, r=AmanieuJonas Schievink-0/+157
Add asm! support for MIPS For now, I only add support for mips32. mips64 may come in future PRs if I could learn more about the target.
2020-09-27Auto merge of #71274 - RalfJung:raw-init-check-aggregate, r=petrochenkovbors-4/+19
might_permit_raw_init: also check aggregate fields This is the next step for https://github.com/rust-lang/rust/issues/66151: when doing `mem::zeroed`/`mem::uninitialized`, also recursively check fields of aggregates (except for arrays) for whether they permit zero/uninit initialization.
2020-09-27Add MIPS asm! supportLzu Tao-0/+157
This patch also: * Add soft-float supports: only f32 * zero-extend i8/i16 to i32 because MIPS only supports register-length arithmetic. * Update table in asm! chapter in unstable book.
2020-09-27Auto merge of #76986 - jonas-schievink:ret-in-reg, r=nagisabors-0/+12
Return values up to 128 bits in registers This fixes https://github.com/rust-lang/rust/issues/26494#issuecomment-619506345 by making Rust's default ABI pass return values up to 128 bits in size in registers, just like the System V ABI. The result is that these methods from the comment linked above now generate the same code, making the Rust ABI as efficient as the `"C"` ABI: ```rust pub struct Stats { x: u32, y: u32, z: u32, } pub extern "C" fn sum_c(a: &Stats, b: &Stats) -> Stats { return Stats {x: a.x + b.x, y: a.y + b.y, z: a.z + b.z }; } pub fn sum_rust(a: &Stats, b: &Stats) -> Stats { return Stats {x: a.x + b.x, y: a.y + b.y, z: a.z + b.z }; } ``` ```asm sum_rust: movl (%rsi), %eax addl (%rdi), %eax movl 4(%rsi), %ecx addl 4(%rdi), %ecx movl 8(%rsi), %edx addl 8(%rdi), %edx shlq $32, %rcx orq %rcx, %rax retq ```
2020-09-27Rollup merge of #77208 - mati865:late-link-args-order, r=petrochenkovJonas Schievink-6/+1
Late link args order MSYS2 changed how winpthreads is built and as the result it now depends on more mingw-w64 libraries. This PR affects only MinGW targets since nobody else is using `late_link_args_{dynamic,static}`. Now the order is similar to how it used to be before https://github.com/rust-lang/rust/pull/67502.
2020-09-26Return values up to 128 bits in registersJonas Schievink-0/+12
2020-09-26might_permit_raw_init: also check aggregate fieldsRalf Jung-4/+19
2020-09-25Defer Apple SDKROOT detection to link time.Eric Huss-128/+20
2020-09-25Link dynamic and static late_link_args before generic onesMateusz Mikuła-6/+1
2020-09-25Rollup merge of #77121 - duckymirror:html-root-url, r=jyn514Jonas Schievink-1/+1
Updated html_root_url for compiler crates Closes #77103 r? @jyn514
2020-09-23/nightly/nightly-rustcErik Hofmayer-1/+1
2020-09-23Updated html_root_url for compiler cratesErik Hofmayer-1/+1
2020-09-21fix typo in docs and commentsyuk1ty-1/+1
2020-09-14librustc_target: Address commentsAlistair Francis-1/+1
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
2020-09-14librustc_target: Initial support for riscv32gc_unknown_linux_gnuAlistair Francis-0/+26
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
2020-09-09remove redundant clonesMatthias Krüger-1/+1
(clippy::redundant_clone)
2020-09-07Rollup merge of #76364 - fusion-engineering-forks:avr-no-atomic, ↵Dylan DPC-0/+2
r=jonas-schievink Disable atomics on avr target. `max_atomic_width` was missing in the spec, which means it fell back to the pointer width of 16 bits. Fixes #76363.
2020-09-05Disable atomics on avr target.Mara Bos-0/+2
`max_atomic_width` was missing in the spec, which means it fell back to the pointer width of 16 bits.
2020-09-03Disable use of `--eh-frame-hdr` on wasm32.Dan Gohman-0/+1
2020-08-31Enable ASLR for windows-gnuMateusz Mikuła-2/+12
2020-08-30mv compiler to compiler/mark-0/+13300