summary refs log tree commit diff
path: root/src/librustc_back
AgeCommit message (Collapse)AuthorLines
2016-11-06use arm abi blacklist for aarch64 fuchsiaTim Neumann-2/+5
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-30Replace all uses of SHA-256 with BLAKE2b.Michael Woerister-682/+1
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-12Stabilise `?`Nick Cameron-1/+1
cc [`?` tracking issue](https://github.com/rust-lang/rust/issues/31436)
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/+49
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/+49
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-20rustc_metadata: go only through rustc_serialize in astencode.Eduard Burtescu-260/+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:
2016-08-02Rollup merge of #35033 - jakllsch:remaining_cpu_x86-64, r=alexcrichtonSeo Sanghyeon-0/+3
Use "x86-64" as the target CPU for NetBSD and Bitrig on amd64. Using "generic" disables a number of features that are present on all x86_64 cpus, the "x86-64" target cpu is the common denominator for that arch. Refs #20777
2016-08-01Auto merge of #34743 - badboy:llvm-upgrade, r=eddybbors-2/+2
LLVM upgrade As discussed in https://internals.rust-lang.org/t/need-help-with-emscripten-port/3154/46 I'm trying to update the used LLVM checkout in Rust. I basically took @shepmaster's code and applied it on top (though I did the commits manually, the [original commits have better descriptions](https://github.com/rust-lang/rust/compare/master...avr-rust:avr-support). With these changes I was able to build rustc. `make check` throws one last error on `run-pass/issue-28950.rs`. Output: https://gist.github.com/badboy/bcdd3bbde260860b6159aa49070a9052 I took the metadata changes as is and they seem to work, though it now uses the module in another step. I'm not sure if this is the best and correct way. Things to do: * [x] ~~Make `run-pass/issue-28950.rs` pass~~ unrelated * [x] Find out how the `PositionIndependentExecutable` setting is now used * [x] Is the `llvm::legacy` still the right way to do these things? cc @brson @alexcrichton
2016-08-01trans: Avoid weak linkage for closures when linking with MinGW.Michael Woerister-0/+11
2016-07-30return TargetResultJorge Aparicio-12/+12
2016-07-30rustc_back/target: remove musl_baseJorge Aparicio-76/+3
it's the same as linux_musl_base
2016-07-30arm-musl: set max_atomic_widthJorge Aparicio-0/+3
2016-07-30arm-musl targets now use cfg(env = "musl")Jorge Aparicio-3/+3