summary refs log tree commit diff
path: root/src/librustc_back
AgeCommit message (Collapse)AuthorLines
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
2016-07-30Add ARM MUSL targets.Timon Van Overveldt-0/+176
The targets are: - `arm-unknown-linux-musleabi` - `arm-unknown-linux-musleabihf` - `armv7-unknown-linux-musleabihf` These mirror the existing `gnueabi` targets. All of these targets produce fully static binaries, similar to the x86 MUSL targets. For now these targets can only be used with `--rustbuild` builds, as https://github.com/rust-lang/compiler-rt/pull/22 only made the necessary compiler-rt changes in the CMake configs, not the plain GNU Make configs. I've tested these targets GCC 5.3.0 compiled again musl-1.1.12 (downloaded from http://musl.codu.org/). An example `./configure` invocation is: ``` ./configure \ --enable-rustbuild --target=arm-unknown-linux-musleabi \ --musl-root="$MUSL_ROOT" ``` where `MUSL_ROOT` points to the `arm-linux-musleabi` prefix. Usually that path will be of the form `/foobar/arm-linux-musleabi/arm-linux-musleabi`. Usually the cross-compile toolchain will live under `/foobar/arm-linux-musleabi/bin`. That path should either by added to your `PATH` variable, or you should add a section to your `config.toml` as follows: ``` [target.arm-unknown-linux-musleabi] cc = "/foobar/arm-linux-musleabi/bin/arm-linux-musleabi-gcc" cxx = "/foobar/arm-linux-musleabi/bin/arm-linux-musleabi-g++" ``` As a prerequisite you'll also have to put a cross-compiled static `libunwind.a` library in `$MUSL_ROOT/lib`. This is similar to [how the x86_64 MUSL targets are built] (https://doc.rust-lang.org/book/advanced-linking.html).
2016-07-29rustc: Fix data-layout for AArch64 targetsAlex Crichton-2/+2
Also relax the assertion whenever we have a custom LLVM root as LLVM may disagree about exact specifics.
2016-07-28Auto merge of #34980 - cardoe:expose-target-options, r=alexcrichtonbors-217/+367
Convert built-in targets to JSON Convert the built-in targets to JSON to ensure that the JSON parser is always fully featured. This follows on #32988 and #32847. The PR includes a number of extra commits that are just intermediate changes necessary for bisectibility and the ability to prove correctness of the change.
2016-07-28Auto merge of #34967 - TimNN:mipsel-musl-soft-float, r=alexcrichtonbors-1/+1
switch mipsel-musl to soft float Closes #34922. r? @alexcrichton
2016-07-28Merge remote-tracking branch 'upstream/master' into remaining_cpu_x86-64Jonathan A. Kollasch-13/+11
2016-07-27librustc_back: filter targets for only valid onesJonathan Creekmore-1/+9
Since we can know which targets are instantiable on a particular host, it does not make sense to list invalid targets in the target print code. Filter the list of targets to only include the targets that can be instantiated.
2016-07-27librustc_back: json tests for builtin targetsJonathan Creekmore-2/+28
Expand the supported_targets!() macro to also generate a set of JSON encode/decode tests to verify that the parser will encode and decode all of the fields needed for all of the builtin targets. Additionally, add PartialEq to Target and TargetOptions in support of the tests.
2016-07-27librustc_back: convert fn target() to return ResultDoug Goldstein-202/+212
Change all the target generation functions to return a Result<Target, String> so that targets that are unable to be instantiated can be expressed as an Err instead of a panic!(). This should improve #33497 as well.
2016-07-27librustc_back: add ToJson trait to TargetDoug Goldstein-2/+96
Target's can already be built up from JSON files as well as built into librustc_back so this adds the ability to convert any Target back into JSON. Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
2016-07-27librustc_back: expose all target options via JSONDoug Goldstein-10/+22
Not all TargetOptions are exposed via the JSON interface to create different targets. This exposes all the missing items and reorders them to match the structure so that it is easier in the future to identify missing items. Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
2016-07-27Auto merge of #33363 - japaric:target, r=japaricbors-13/+11
fix built-in target detection previously the logic was accepting wrong triples (like `x86_64_unknown-linux-musl`) as valid ones (like `x86_64-unknown-linux-musl`) if they contained an underscore instead of a dash. fixes #33329 --- r? @brson I wanted to use a compile-fail test at first. But, you can't pass an extra `--target` flag to `rustc` for those because they already call `rustc --target $HOST` so you get a `error: Option 'target' given more than once.`. The run-make test used here works fine though.
2016-07-25Use "x86-64" as the target CPU for NetBSD and Bitrig on amd64.Jonathan A. Kollasch-0/+3
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-07-21switch mipsel-musl to soft floatTim Neumann-1/+1
2016-07-18rustc: Remove soft-float from MIPS targetsAlex Crichton-1/+1
Right now two MIPS targets in the compiler, `mips-unknown-linux-{gnu,musl}` both generate object files using the soft-float ABI through LLVM by default. This is also expressed as the `-C soft-float` codegen option and otherwise isn't used for any other target in the compiler. This option was added quite some time ago (back in #9617), and nowadays it's more appropriate to be done through a codegen option. This is motivated by #34743 which necessitated an upgrade in the CMake installation on our bots which necessitated an upgrade in the Ubuntu version which invalidated the MIPS compilers we were using. The new MIPS compilers (coming from Debian I believe) all have hard float enabled by default and soft float support not built in. This meant that we couldn't upgrade the bots until #34841 landed because otherwise we would fail to compile C code as the `-msoft-float` option wouldn't work. Unfortunately, though, this means that once we upgrade the bots the C code we're compiling will be compiled for hard float and the Rust code will be compiled for soft float, a bad mismatch! This PR remedies the situation such that Rust will compile with hard float as well. If this lands it will likely produce broken nightlies for a day or two while we get around to upgrading the bots because the current C toolchain only produces soft-float binaries, and now rust will be hard-float. Hopefully, though, the upgrade can go smoothly!
2016-05-25Auto merge of #33699 - alexcrichton:stabilize-1.10, r=aturonbors-4/+7
std: Stabilize APIs for the 1.10 release This commit applies the FCP decisions made by the libs team for the 1.10 cycle, including both new stabilizations and deprecations. Specifically, the list of APIs is: Stabilized: * `os::windows::fs::OpenOptionsExt::access_mode` * `os::windows::fs::OpenOptionsExt::share_mode` * `os::windows::fs::OpenOptionsExt::custom_flags` * `os::windows::fs::OpenOptionsExt::attributes` * `os::windows::fs::OpenOptionsExt::security_qos_flags` * `os::unix::fs::OpenOptionsExt::custom_flags` * `sync::Weak::new` * `Default for sync::Weak` * `panic::set_hook` * `panic::take_hook` * `panic::PanicInfo` * `panic::PanicInfo::payload` * `panic::PanicInfo::location` * `panic::Location` * `panic::Location::file` * `panic::Location::line` * `ffi::CStr::from_bytes_with_nul` * `ffi::CStr::from_bytes_with_nul_unchecked` * `ffi::FromBytesWithNulError` * `fs::Metadata::modified` * `fs::Metadata::accessed` * `fs::Metadata::created` * `sync::atomic::Atomic{Usize,Isize,Bool,Ptr}::compare_exchange` * `sync::atomic::Atomic{Usize,Isize,Bool,Ptr}::compare_exchange_weak` * `collections::{btree,hash}_map::{Occupied,Vacant,}Entry::key` * `os::unix::net::{UnixStream, UnixListener, UnixDatagram, SocketAddr}` * `SocketAddr::is_unnamed` * `SocketAddr::as_pathname` * `UnixStream::connect` * `UnixStream::pair` * `UnixStream::try_clone` * `UnixStream::local_addr` * `UnixStream::peer_addr` * `UnixStream::set_read_timeout` * `UnixStream::set_write_timeout` * `UnixStream::read_timeout` * `UnixStream::write_Timeout` * `UnixStream::set_nonblocking` * `UnixStream::take_error` * `UnixStream::shutdown` * Read/Write/RawFd impls for `UnixStream` * `UnixListener::bind` * `UnixListener::accept` * `UnixListener::try_clone` * `UnixListener::local_addr` * `UnixListener::set_nonblocking` * `UnixListener::take_error` * `UnixListener::incoming` * RawFd impls for `UnixListener` * `UnixDatagram::bind` * `UnixDatagram::unbound` * `UnixDatagram::pair` * `UnixDatagram::connect` * `UnixDatagram::try_clone` * `UnixDatagram::local_addr` * `UnixDatagram::peer_addr` * `UnixDatagram::recv_from` * `UnixDatagram::recv` * `UnixDatagram::send_to` * `UnixDatagram::send` * `UnixDatagram::set_read_timeout` * `UnixDatagram::set_write_timeout` * `UnixDatagram::read_timeout` * `UnixDatagram::write_timeout` * `UnixDatagram::set_nonblocking` * `UnixDatagram::take_error` * `UnixDatagram::shutdown` * RawFd impls for `UnixDatagram` * `{BTree,Hash}Map::values_mut` * `<[_]>::binary_search_by_key` Deprecated: * `StaticCondvar` - this, and all other static synchronization primitives below, are usable today through the lazy-static crate on stable Rust today. Additionally, we'd like the non-static versions to be directly usable in a static context one day, so they're unlikely to be the final forms of the APIs in any case. * `CONDVAR_INIT` * `StaticMutex` * `MUTEX_INIT` * `StaticRwLock` * `RWLOCK_INIT` * `iter::Peekable::is_empty` Closes #27717 Closes #27720 Closes #30014 Closes #30425 Closes #30449 Closes #31190 Closes #31399 Closes #31767 Closes #32111 Closes #32281 Closes #32312 Closes #32551 Closes #33018
2016-05-24std: Stabilize APIs for the 1.10 releaseAlex Crichton-4/+7
This commit applies the FCP decisions made by the libs team for the 1.10 cycle, including both new stabilizations and deprecations. Specifically, the list of APIs is: Stabilized: * `os::windows::fs::OpenOptionsExt::access_mode` * `os::windows::fs::OpenOptionsExt::share_mode` * `os::windows::fs::OpenOptionsExt::custom_flags` * `os::windows::fs::OpenOptionsExt::attributes` * `os::windows::fs::OpenOptionsExt::security_qos_flags` * `os::unix::fs::OpenOptionsExt::custom_flags` * `sync::Weak::new` * `Default for sync::Weak` * `panic::set_hook` * `panic::take_hook` * `panic::PanicInfo` * `panic::PanicInfo::payload` * `panic::PanicInfo::location` * `panic::Location` * `panic::Location::file` * `panic::Location::line` * `ffi::CStr::from_bytes_with_nul` * `ffi::CStr::from_bytes_with_nul_unchecked` * `ffi::FromBytesWithNulError` * `fs::Metadata::modified` * `fs::Metadata::accessed` * `fs::Metadata::created` * `sync::atomic::Atomic{Usize,Isize,Bool,Ptr}::compare_exchange` * `sync::atomic::Atomic{Usize,Isize,Bool,Ptr}::compare_exchange_weak` * `collections::{btree,hash}_map::{Occupied,Vacant,}Entry::key` * `os::unix::net::{UnixStream, UnixListener, UnixDatagram, SocketAddr}` * `SocketAddr::is_unnamed` * `SocketAddr::as_pathname` * `UnixStream::connect` * `UnixStream::pair` * `UnixStream::try_clone` * `UnixStream::local_addr` * `UnixStream::peer_addr` * `UnixStream::set_read_timeout` * `UnixStream::set_write_timeout` * `UnixStream::read_timeout` * `UnixStream::write_Timeout` * `UnixStream::set_nonblocking` * `UnixStream::take_error` * `UnixStream::shutdown` * Read/Write/RawFd impls for `UnixStream` * `UnixListener::bind` * `UnixListener::accept` * `UnixListener::try_clone` * `UnixListener::local_addr` * `UnixListener::set_nonblocking` * `UnixListener::take_error` * `UnixListener::incoming` * RawFd impls for `UnixListener` * `UnixDatagram::bind` * `UnixDatagram::unbound` * `UnixDatagram::pair` * `UnixDatagram::connect` * `UnixDatagram::try_clone` * `UnixDatagram::local_addr` * `UnixDatagram::peer_addr` * `UnixDatagram::recv_from` * `UnixDatagram::recv` * `UnixDatagram::send_to` * `UnixDatagram::send` * `UnixDatagram::set_read_timeout` * `UnixDatagram::set_write_timeout` * `UnixDatagram::read_timeout` * `UnixDatagram::write_timeout` * `UnixDatagram::set_nonblocking` * `UnixDatagram::take_error` * `UnixDatagram::shutdown` * RawFd impls for `UnixDatagram` * `{BTree,Hash}Map::values_mut` * `<[_]>::binary_search_by_key` Deprecated: * `StaticCondvar` - this, and all other static synchronization primitives below, are usable today through the lazy-static crate on stable Rust today. Additionally, we'd like the non-static versions to be directly usable in a static context one day, so they're unlikely to be the final forms of the APIs in any case. * `CONDVAR_INIT` * `StaticMutex` * `MUTEX_INIT` * `StaticRwLock` * `RWLOCK_INIT` * `iter::Peekable::is_empty` Closes #27717 Closes #27720 cc #27784 (but encode methods still exist) Closes #30014 Closes #30425 Closes #30449 Closes #31190 Closes #31399 Closes #31767 Closes #32111 Closes #32281 Closes #32312 Closes #32551 Closes #33018
2016-05-21Improve internal documentation and code styleTicki-22/+19
Fix some code layout, remove some unnecessary returns, fix typos, punctuation, and comment consistency.
2016-05-16Auto merge of #33651 - Nercury:update-i686-android-target-to-match-abi, ↵bors-1/+5
r=alexcrichton Update i686-linux-android features to match android x86 ABI. Based on [android's official x86 ABI info](http://developer.android.com/ndk/guides/abis.html#x86), the x86 baseline CPU can be safely updated to `pentiumpro`, with the addition of `MMX`, `SSE`, `SSE2`, `SSE3`, `SSSE3` features. r? @alexcrichton
2016-05-15Update i686-linux-android features to match android ABI.Nerijus Arlauskas-1/+5
2016-05-14Add all possible features (NEON, FP) to aarch64 android target.Nerijus Arlauskas-0/+3
2016-05-14Add missing "max_atomic_width" to new armv7 android target.Nerijus Arlauskas-0/+1
2016-05-14Remove "gnu" from "target_env" because it does not matter for android.Nerijus Arlauskas-3/+3
2016-05-09Add #[cfg(target_has_atomic)] to get atomic support for the current targetAmanieu d'Antras-8/+68
2016-05-08Auto merge of #33414 - Nercury:master, r=alexcrichtonbors-0/+29
Add armv7-linux-androideabi target This PR adds `armv7-linux-androideabi` target that matches `armeabi-v7a` Android ABI, ~~downscales `arm-linux-androideabi` target to match `armeabi` Android ABI~~ (TBD later if needed). This should allow us to get the best performance from every [Android ABI level](http://developer.android.com/ndk/guides/abis.html). Currently existing target `arm-linux-androideabi` started gaining features out of the supported range of [android `armeabi`](http://developer.android.com/ndk/guides/abis.html). While android compiler does not use a different target for later supported `armv7` architecture, it has distinct ABI name `armeabi-v7a`. We decided to add rust target `armv7-linux-androideabi` to match it. Note that `NEON`, `VFPv3-D32`, and `ThumbEE` instruction sets are not added, because not all android devices are guaranteed to support all or some of these, and [their availability should be checked at runtime](http://developer.android.com/ndk/guides/abis.html#v7a). ~~This reduces performance of existing `arm-linux-androideabi` and may make it _much_ slower (we are talking more than order of magnitude in some random ad-hoc fp benchmark that I did).~~ Part of #33278.
2016-05-08Auto merge of #33091 - sanxiyn:unused-trait-import-3, r=nrcbors-2/+2
Warn unused trait imports, rebased Rebase of #30021. Fix #25730.
2016-05-08Auto merge of #33403 - alexcrichton:consistent-env, r=brsonbors-3/+3
rustc: Change target_env for ARM targets to `gnu` Right now they're `gnueabihf` and `gnueabi`, but when adding new platforms like musl on ARM it's unfortunate to have to test for all three (`musl`, `musleabi`, and `musleabihf`). This PR switches everything currently to `gnu`, and the new musl targets can also use `musl` when they land. Closes #33244
2016-05-07Rollup merge of #33430 - phil-opp:patch-1, r=alexcrichtonSteve Klabnik-1/+1
[Doc] Default cpu is "generic" (and not "default") See [line 305](https://github.com/phil-opp/rust/blob/a22ca2872ef6782306012e6817dc4b8b778c43e9/src/librustc_back/target/mod.rs#L305).
2016-05-07Auto merge of #33359 - tamird:consolidate-musl, r=alexcrichtonbors-73/+74
rustc_back: use a common musl base extracted from #33327. cc #33189. r? @alexcrichton
2016-05-07Add armv7-linux-androideabi target.Nerijus Arlauskas-0/+29
2016-05-05[Doc] Default cpu is "generic" (and not "default")Philipp Oppermann-1/+1
2016-05-04refactor: if -> matchJorge Aparicio-12/+11
2016-05-04rustc: Change target_env for ARM targets to `gnu`Alex Crichton-3/+3
Right now they're `gnueabihf` and `gnueabi`, but when adding new platforms like musl on ARM it's unfortunate to have to test for all three (`musl`, `musleabi`, and `musleabihf`). This PR switches everything currently to `gnu`, and the new musl targets can also use `musl` when they land. Closes #33244
2016-05-03fix breaking changesAriel Ben-Yehuda-1/+1
2016-05-03Fix more testsSeo Sanghyeon-2/+2
2016-05-02fix built-in target detectionJorge Aparicio-2/+1
previously the logic was accepting wrong triples (like `x86_64_unknown-linux-musl`) as valid ones (like `x86_64-unknown-linux-musl`) if they contained an underscore instead of a dash. fixes #33329
2016-05-02rustc_back: use a common musl baseTamir Duberstein-73/+74
2016-04-25Auto merge of #33115 - mbrubeck:vfp3-d16, r=nrcbors-1/+1
Enable vfp3-d16 for ARMv7 Android target Android's [armeabi-v7a ABI][1] guarantees at least VFPv3-d16 hardware FPU support, so Rust should include this in the default features for the `arm-linux-androideabi` target. [1]: https://developer.android.com/ndk/guides/abis.html
2016-04-24librustc_back: fix typoTamir Duberstein-1/+1
2016-04-24librustc_back: remove explicit linkerTamir Duberstein-7/+0
"cc" is already the default.
2016-04-20Enable vfp3-d16 for ARMv7 Android targetMatt Brubeck-1/+1
Android's [armeabi-v7a ABI][1] guarantees at least VFPv3-d16 hardware FPU support, so Rust should include this in the default features for the arm-linux-androideabi target. [1]: https://developer.android.com/ndk/guides/abis.html
2016-04-19Make data-layout mandatory in target specs.Eduard Burtescu-9/+53