Skip to content

Commit

Permalink
Add target_endian crate cfg. Closes #4367
Browse files Browse the repository at this point in the history
  • Loading branch information
z0w0 committed Feb 16, 2013
1 parent 9ad8a1f commit 0e83102
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/librustc/driver/driver.rs
Expand Up @@ -88,17 +88,20 @@ pub fn default_configuration(sess: Session, +argv0: ~str, input: input) ->

let mk = attr::mk_name_value_item_str;

let (arch,wordsz) = match sess.targ_cfg.arch {
session::arch_x86 => (~"x86",~"32"),
session::arch_x86_64 => (~"x86_64",~"64"),
session::arch_arm => (~"arm",~"32")
// ARM is bi-endian, however using NDK seems to default
// to little-endian unless a flag is provided.
let (end,arch,wordsz) = match sess.targ_cfg.arch {
session::arch_x86 => (~"little",~"x86",~"32"),
session::arch_x86_64 => (~"little",~"x86_64",~"64"),
session::arch_arm => (~"little",~"arm",~"32")
};

return ~[ // Target bindings.
attr::mk_word_item(str::from_slice(os::FAMILY)),
mk(~"target_os", tos),
mk(~"target_family", str::from_slice(os::FAMILY)),
mk(~"target_arch", arch),
mk(~"target_endian", end),
mk(~"target_word_size", wordsz),
mk(~"target_libc", libc),
// Build bindings.
Expand Down

5 comments on commit 0e83102

@bors
Copy link
Contributor

@bors bors commented on 0e83102 Feb 16, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on 0e83102 Feb 16, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging z0w0/rust/endianattr = 0e83102 into auto

@bors
Copy link
Contributor

@bors bors commented on 0e83102 Feb 16, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

z0w0/rust/endianattr = 0e83102 merged ok, testing candidate = 945ac42

@bors
Copy link
Contributor

@bors bors commented on 0e83102 Feb 16, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on 0e83102 Feb 16, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding incoming to auto = 945ac42

Please sign in to comment.