about summary refs log tree commit diff
path: root/src/librustc_back/target
AgeCommit message (Collapse)AuthorLines
2016-12-15Fix typoJeremy Soller-2/+1
2016-12-15Add redox targetJeremy Soller-0/+78
2016-12-04OpenBSD under x86 has particular ABI for returning a struct.Sébastien Marie-0/+7
It is like OSX or Windows: small structs are returned as integers.
2016-11-30Add i686-unknown-openbsd target.Sébastien Marie-0/+33
2016-11-16rustc: Implement #[link(cfg(..))] and crt-staticAlex Crichton-1/+9
This commit is an implementation of [RFC 1721] which adds a new target feature to the compiler, `crt-static`, which can be used to select how the C runtime for a target is linked. Most targets dynamically linke the C runtime by default with the notable exception of some of the musl targets. [RFC 1721]: https://github.com/rust-lang/rfcs/blob/master/text/1721-crt-static.md This commit first adds the new target-feature, `crt-static`. If enabled, then the `cfg(target_feature = "crt-static")` will be available. Targets like musl will have this enabled by default. This feature can be controlled through the standard target-feature interface, `-C target-feature=+crt-static` or `-C target-feature=-crt-static`. Next this adds an gated and unstable `#[link(cfg(..))]` feature to enable the `crt-static` semantics we want with libc. The exact behavior of this attribute is a little squishy, but it's intended to be a forever-unstable implementation detail of the liblibc crate. Specifically the `#[link(cfg(..))]` annotation means that the `#[link]` directive is only active in a compilation unit if that `cfg` value is satisfied. For example when compiling an rlib, these directives are just encoded and ignored for dylibs, and all staticlibs are continued to be put into the rlib as usual. When placing that rlib into a staticlib, executable, or dylib, however, the `cfg` is evaluated *as if it were defined in the final artifact* and the library is decided to be linked or not. Essentially, what'll happen is: * On MSVC with `-C target-feature=-crt-static`, the `msvcrt.lib` library will be linked to. * On MSVC with `-C target-feature=+crt-static`, the `libcmt.lib` library will be linked to. * On musl with `-C target-feature=-crt-static`, the object files in liblibc.rlib are removed and `-lc` is passed instead. * On musl with `-C target-feature=+crt-static`, the object files in liblibc.rlib are used and `-lc` is not passed. This commit does **not** include an update to the liblibc module to implement these changes. I plan to do that just after the 1.14.0 beta release is cut to ensure we get ample time to test this feature. cc #37406
2016-11-12use write::run_assemblerJorge Aparicio-6/+7
2016-11-12use msp430-as to emit object files from the assembly that LLVM emitsJorge Aparicio-0/+7
2016-11-12Rollup merge of #37615 - atilag:armv5te-support, r=alexcrichtonEduard-Mihai Burtescu-0/+35
Add support for ARMv5TE architecture
2016-11-10Set max_atomic_width to 0 because there's no atomic instructions on ARMv5Juan Gomez-1/+2
2016-11-06use arm abi blacklist for aarch64 fuchsiaTim Neumann-2/+5
2016-11-06Add support for ARMv5TE architectureJuan Gomez-0/+34
2016-10-31Changed most vec! invocations to use square bracesiirelu-21/+21
Most of the Rust community agrees that the vec! macro is clearer when called using square brackets [] instead of regular brackets (). Most of these ocurrences are from before macros allowed using different types of brackets. There is one left unchanged in a pretty-print test, as the pretty printer still wants it to have regular brackets.
2016-10-30Auto merge of #37392 - alexcrichton:more-disable-jemalloc, r=brsonbors-0/+45
Disable jemalloc on aarch64/powerpc Sounds like jemalloc is broken on systems which differ in page size than the host it was compiled on (unless an option was passed). This unfortunately reduces the portability of binaries created and can often make Rust segfault by default. For now let's patch over this by disabling jemalloc until we can figure out a better solution. Closes #36994 Closes #37320 cc jemalloc/jemalloc#467
2016-10-29Auto merge of #37387 - raphlinus:fuchsia_aarch64, r=alexcrichtonbors-0/+29
Support for aarch64 architecture on Fuchsia This patch adds support for the aarch64-unknown-fuchsia target. Also updates src/liblibc submodule to include required libc change.
2016-10-27Disable jemalloc on aarch64/powerpcAlex Crichton-0/+45
Sounds like jemalloc is broken on systems which differ in page size than the host it was compiled on (unless an option was passed). This unfortunately reduces the portability of binaries created and can often make Rust segfault by default. For now let's patch over this by disabling jemalloc until we can figure out a better solution. Closes #36994 Closes #37320 cc jemalloc/jemalloc#467
2016-10-25Auto merge of #36421 - TimNN:check-abis, r=alexcrichtonbors-15/+91
check target abi support This PR checks for each extern function / block whether the ABI / calling convention used is supported by the current target. This was achieved by adding an `abi_blacklist` field to the target specifications, listing the calling conventions unsupported for that target.
2016-10-24Support for aarch64 architecture on FuchsiaRaph Levien-0/+29
This patch adds support for the aarch64-unknown-fuchsia target. Also updates src/liblibc submodule to include required libc change.
2016-10-24check target abi supportTim Neumann-15/+91
2016-10-22Fix tidy warningRaph Levien-1/+1
Prefer FIXME to TODO
2016-10-22Add Fuchsia supportRaph Levien-0/+72
Adds support for the x86_64-unknown-fuchsia target, which covers the Fuchsia operating system.
2016-10-04Auto merge of #36933 - alexcrichton:less-neon-again, r=eddybbors-1/+1
rustc: Try again to disable NEON on armv7 linux This is a follow-up to #35814 which apparently didn't disable it hard enough. It looks like LLVM's default armv7 target enables NEON so we'd otherwise have to pass `-neon`, but we're already enabling armv7 with `+v7` supposedly, so let's try just telling LLVM that the armv7 target is arm and then enable features selectively. Closes #36913
2016-10-04rustc: Try again to disable NEON on armv7 linuxAlex Crichton-1/+1
This is a follow-up to #35814 which apparently didn't disable it hard enough. It looks like LLVM's default armv7 target enables NEON so we'd otherwise have to pass `-neon`, but we're already enabling armv7 with `+v7` supposedly, so let's try just telling LLVM that the armv7 target is arm and then enable features selectively. Closes #36913
2016-10-03change max_atomic_width type from u64 to Option<u64>Jorge Aparicio-73/+68
to better express the idea that omitting this field defaults this value to target_pointer_width
2016-10-03fix: "abort" -> PanicStrategyJorge Aparicio-2/+3
2016-10-03add a reference about the stated FP factsJorge Aparicio-0/+3
2016-10-03add +d16 and +fp-only-sp to thumbv7em-none-eabihf and documentationJorge Aparicio-2/+66
2016-10-02set panic-strategy to abortJorge Aparicio-0/+1
2016-10-02set relocation-model to staticJorge Aparicio-0/+1
2016-10-02add Thumbs to the compilerJorge Aparicio-2/+158
this commit adds 4 new target definitions to the compiler for easier cross compilation to ARM Cortex-M devices. - `thumbv6m-none-eabi` - For the Cortex-M0, Cortex-M0+ and Cortex-M1 - This architecture doesn't have hardware support (instructions) for atomics. Hence, the `Atomic*` structs are not available for this target. - `thumbv7m-none-eabi` - For the Cortex-M3 - `thumbv7em-none-eabi` - For the FPU-less variants of the Cortex-M4 and Cortex-M7 - On this target, all the floating point operations will be lowered software routines (intrinsics) - `thumbv7em-none-eabihf` - For the variants of the Cortex-M4 and Cortex-M7 that do have a FPU. - On this target, all the floating point operations will be lowered to hardware instructions No binary releases of standard crates, like `core`, are planned for these targets because Cargo, in the future, will compile e.g. the `core` crate on the fly as part of the `cargo build` process. In the meantime, you'll have to compile the `core` crate yourself. [Xargo] is the easiest way to do that as in handles the compilation of `core` automatically and can be used just like Cargo: `xargo build --target thumbv6m-none-eabi` is all that's needed. [Xargo]: https://crates.io/crates/xargo
2016-10-01Rollup merge of #36865 - kallisti5:master, r=brsonManish Goregaokar-2/+2
Haiku: Fix target triplet delimiter
2016-09-30Call emcc with ERROR_ON_UNDEFINED_SYMBOLSBrian Anderson-1/+3
2016-09-30Preliminary wasm32 supportBrian Anderson-1/+43
2016-09-30Haiku: Fix target triplet delimiterAlex von Gluck IV-2/+2
2016-09-28Rollup merge of #36794 - japaric:target-panic, r=alexcrichtonJonathan Turner-0/+21
add a panic-strategy field to the target specification Now a target can define its panic strategy in its specification. If a user doesn't specify a panic strategy via the command line, i.e. '-C panic', then the compiler will use the panic strategy defined by the target specification. Custom targets can pick their panic strategy via the "panic-strategy" field of their target specification JSON file. If omitted in the specification, the strategy defaults to "unwind". closes #36647 --- I checked that compiling an executable for a custom target with "panic-strategy" set to "abort" doesn't need the "eh_personality" lang item and also that standard crates compiled for that custom target didn't contained undefined symbols to _Unwind_Resume. But this needs an actual unit test, any suggestion on how to test this? Most of the noise in the diff is due to moving `PanicStrategy` from the `rustc` to the `rustc_back` crate. r? @alexcrichton cc @phil-opp
2016-09-28update mips64* data-layoutTim Neumann-2/+2
2016-09-27add a panic-strategy field to the target specificationJorge Aparicio-0/+21
Now a target can define its panic strategy in its specification. If a user doesn't specify a panic strategy via the command line, i.e. '-C panic', then the compiler will use the panic strategy defined by the target specification. Custom targets can pick their panic strategy via the "panic-strategy" field of their target specification JSON file. If omitted in the specification, the strategy defaults to "unwind". closes #36647
2016-09-25Haiku: Adjust haiku target to match new librustc_back designAlexander von Gluck IV-26/+44
2016-09-25Add support for the Haiku operating system on x86 and x86_64 machinesNiels Sascha Reedijk-0/+69
* Hand rebased from Niels original work on 1.9.0
2016-09-13Auto merge of #36041 - ahmedcharles:try, r=nrcbors-17/+17
Replace try! with ?.
2016-09-12crate-ify compiler-rt into compiler-builtinsJorge Aparicio-8/+0
libcompiler-rt.a is dead, long live libcompiler-builtins.rlib This commit moves the logic that used to build libcompiler-rt.a into a compiler-builtins crate on top of the core crate and below the std crate. This new crate still compiles the compiler-rt instrinsics using gcc-rs but produces an .rlib instead of a static library. Also, with this commit rustc no longer passes -lcompiler-rt to the linker. This effectively makes the "no-compiler-rt" field of target specifications a no-op. Users of `no_std` will have to explicitly add the compiler-builtins crate to their crate dependency graph *if* they need the compiler-rt intrinsics. Users of the `std` have to do nothing extra as the std crate depends on compiler-builtins. Finally, this a step towards lazy compilation of std with Cargo as the compiler-rt intrinsics can now be built by Cargo instead of having to be supplied by the user by some other method. closes #34400
2016-09-11Use question_mark feature in librustc_back.Ahmed Charles-17/+17
2016-09-09Add s390x supportUlrich Weigand-2/+6
This adds support for building the Rust compiler and standard library for s390x-linux, allowing a full cross-bootstrap sequence to complete. This includes: - Makefile/configure changes to allow native s390x builds - Full Rust compiler support for the s390x C ABI (only the non-vector ABI is supported at this point) - Port of the standard library to s390x - Update the liblibc submodule to a version including s390x support - Testsuite fixes to allow clean "make check" on s390x Caveats: - Resets base cpu to "z10" to bring support in sync with the default behaviour of other compilers on the platforms. (Usually, upstream supports all older processors; a distribution build may then chose to require a more recent base version.) (Also, using zEC12 causes failures in the valgrind tests since valgrind doesn't fully support this CPU yet.) - z13 vector ABI is not yet supported. To ensure compatible code generation, the -vector feature is passed to LLVM. Note that this means that even when compiling for z13, no vector instructions will be used. In the future, support for the vector ABI should be added (this will require common code support for different ABIs that need different data_layout strings on the same platform). - Two test cases are (temporarily) ignored on s390x to allow passing the test suite. The underlying issues still need to be fixed: * debuginfo/simd.rs fails because of incorrect debug information. This seems to be a LLVM bug (also seen with C code). * run-pass/union/union-basic.rs simply seems to be incorrect for all big-endian platforms. Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2016-09-02Auto merge of #36024 - japaric:mips64, r=alexcrichtonbors-0/+64
add mips64-gnu and mips64el-gnu targets With this commit one can build no_core (and probably no_std as well) Rust programs for these targets. It's not yet possible to cross compile std for these targets because rust-lang/libc doesn't know about the mips64 architecture. These targets have been tested by cross compiling the "smallest hello" program (see code below) and then running it under QEMU. ``` rust extern { fn puts(_: *const u8); } fn start(_: isize, _: *const *const u8) -> isize { unsafe { let msg = b"Hello, world!\0"; puts(msg as *const _ as *const u8); } 0 } trait Copy {} trait Sized {} ``` cc #36015 r? @alexcrichton cc @brson The cabi stuff is likely wrong. I just copied cabi_mips source and changed some `4`s to `8`s and `32`s to `64`s. It was enough to get libc's `puts` to work but I'd like someone familiar with this module to check it.
2016-08-28fix data-layoutsJorge Aparicio-2/+2
2016-08-26initial support for s390xJorge Aparicio-0/+31
A new target, `s390x-unknown-linux-gnu`, has been added to the compiler and can be used to build no_core/no_std Rust programs. Known limitations: - librustc_trans/cabi_s390x.rs is missing. This means no support for `extern "C" fn`. - No support for this arch in libc. This means std can be cross compiled for this target.
2016-08-26add mips64-gnu and mips64el-gnu targetsJorge Aparicio-0/+64
With this commit one can build no_core (and probably no_std as well) Rust programs for these targets. It's not yet possible to cross compile std for these targets because rust-lang/libc doesn't know about the mips64 architecture. These targets have been tested by cross compiling the "smallest hello" program (see code below) and then running it under QEMU. ``` rust #![feature(start)] #![feature(lang_items)] #![feature(no_core)] #![no_core] #[link(name = "c")] extern { fn puts(_: *const u8); } #[start] fn start(_: isize, _: *const *const u8) -> isize { unsafe { let msg = b"Hello, world!\0"; puts(msg as *const _ as *const u8); } 0 } #[lang = "copy"] trait Copy {} #[lang = "sized"] trait Sized {} ```
2016-08-19rustc: Don't enable NEON by default on armv7 LinuxAlex Crichton-2/+3
One of the primary platforms for the `armv7-unknown-linux-gnueabihf` target, Linux distributions, do not enable NEON extensions by default. This PR disables that feature by defualt but enables the `d16` feature which enables VFP3D16 that distributions do enable. Closes #35590
2016-08-16add mips-uclibc targetsJorge Aparicio-0/+63
These targets cover OpenWRT 15.05 devices, which use the soft float ABI and the uclibc library. None of the other built-in mips targets covered those devices (mips-gnu is hard float and glibc-based, mips-musl is musl-based). With this commit one can now build std for these devices using these commands: ``` $ configure --enable-rustbuild --target=mips-unknown-linux-uclibc $ make ``` cc #35673
2016-08-08Print Rust target name, not LLVM target name, for `--print target-list`Seo Sanghyeon-1/+1
2016-08-01Auto merge of #35163 - sanxiyn:rollup, r=sanxiynbors-0/+3
Rollup of 8 pull requests - Successful merges: #34802, #35033, #35085, #35114, #35134, #35140, #35141, #35157 - Failed merges: