Commit Graph

12 Commits

Author SHA1 Message Date
Jorge Aparicio 6136069609 change max_atomic_width type from u64 to Option<u64>
to better express the idea that omitting this field defaults this value
to target_pointer_width
2016-10-03 23:45:40 -05:00
Doug Goldstein eafecbf868 librustc_back: convert fn target() to return Result
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-27 10:28:40 -07:00
Amanieu d'Antras 04835ea5ec Add #[cfg(target_has_atomic)] to get atomic support for the current target 2016-05-09 13:31:47 +01:00
Eduard Burtescu 0776399eac Make data-layout mandatory in target specs. 2016-04-19 16:08:45 +03:00
Sebastian Wicki af68cdfea1 rustc: Add target_vendor for target triples
This adds a new target property, `target_vendor` which can be used as a
matcher for conditional compilation. The vendor is part of the autoconf
target triple: <arch><sub>-<vendor>-<os>-<env>

The default value for `target_vendor` is "unknown".

Matching against the `target_vendor` with `#[cfg]` is currently feature
gated as `cfg_target_vendor`.
2015-09-24 01:44:55 +02:00
Alex Crichton 958d563825 trans: Clean up handling the LLVM data layout
Turns out for OSX our data layout was subtly wrong and the LLVM update must have
exposed this. Instead of fixing this I've removed all data layouts from the
compiler to just use the defaults that LLVM provides for all targets. All data
layouts (and a number of dead modules) are removed from the compiler here.
Custom target specifications can still provide a custom data layout, but it is
now an optional key as the default will be used if one isn't specified.
2015-07-16 20:25:52 -07:00
Alex Crichton ba2380d7b3 rustc: Add target_env for triples by default
This adds a new `#[cfg]` matcher against the `target_env` property of the
destination target triple. For example all windows triples today end with `-gnu`
but we will also hopefully support non-`gnu` targets for Windows, at which point
we'll need to differentiate between the two. This new `target_env` matches is
provided and filled in with the target's environment name.

Currently the only non-empty value of this name is `gnu`, but `musl` will be
shortly added for the linux triples.
2015-04-27 09:22:05 -07:00
Björn Steinbrink bca25aeeb4 Use more specific target CPUs on Darwin
Macs don't come with anything older than a Yonah (32bit) or Core2 (64bit),
so we can default to those targets. Clang does the same.
2015-01-26 09:58:55 +01:00
Nick Cameron dd3e89aaf2 Rename `target_word_size` to `target_pointer_width`
Closes #20421

[breaking-change]
2015-01-08 09:07:55 +13:00
Valerii Hiora b94bb8766e Fixes invalid LLVM data layout for aggregate data types
According to http://llvm.org/docs/LangRef.html#data-layout correct syntax
for data layout is `a:<abi>:<pref>` so it looks like  `a0:<abi>:<pref>` is
either a typo or outdated syntax (as it goes back pretty deep in time)
2014-12-28 08:31:23 +02:00
Corey Richardson 4a6f4c9606 Same fix for mac32 2014-11-04 05:07:47 -05:00
Corey Richardson 6b130e3dd9 Implement flexible target specification
Removes all target-specific knowledge from rustc. Some targets have changed
during this, but none of these should be very visible outside of
cross-compilation. The changes make our targets more consistent.

iX86-unknown-linux-gnu is now only available as i686-unknown-linux-gnu. We
used to accept any value of X greater than 1. i686 was released in 1995, and
should encompass the bare minimum of what Rust supports on x86 CPUs.

The only two windows targets are now i686-pc-windows-gnu and
x86_64-pc-windows-gnu.

The iOS target has been renamed from arm-apple-ios to arm-apple-darwin.

A complete list of the targets we accept now:

arm-apple-darwin
arm-linux-androideabi
arm-unknown-linux-gnueabi
arm-unknown-linux-gnueabihf

i686-apple-darwin
i686-pc-windows-gnu
i686-unknown-freebsd
i686-unknown-linux-gnu

mips-unknown-linux-gnu
mipsel-unknown-linux-gnu

x86_64-apple-darwin
x86_64-unknown-freebsd
x86_64-unknown-linux-gnu
x86_64-pc-windows-gnu

Closes #16093

[breaking-change]
2014-11-04 05:07:47 -05:00