@@ -88,17 +88,20 @@ pub fn default_configuration(sess: Session, +argv0: ~str, input: input) ->
88
88
89
89
let mk = attr:: mk_name_value_item_str;
90
90
91
- let ( arch, wordsz) = match sess. targ_cfg . arch {
92
- session:: arch_x86 => ( ~"x86", ~"32 ") ,
93
- session:: arch_x86_64 => ( ~"x86_64", ~"64 ") ,
94
- session:: arch_arm => ( ~"arm", ~"32 ")
91
+ // ARM is bi-endian, however using NDK seems to default
92
+ // to little-endian unless a flag is provided.
93
+ let ( end, arch, wordsz) = match sess. targ_cfg . arch {
94
+ session:: arch_x86 => ( ~"little", ~"x86", ~"32 ") ,
95
+ session:: arch_x86_64 => ( ~"little", ~"x86_64", ~"64 ") ,
96
+ session:: arch_arm => ( ~"little", ~"arm", ~"32 ")
95
97
} ;
96
98
97
99
return ~[ // Target bindings.
98
100
attr:: mk_word_item ( str:: from_slice ( os:: FAMILY ) ) ,
99
101
mk ( ~"target_os", tos) ,
100
102
mk ( ~"target_family", str:: from_slice ( os:: FAMILY ) ) ,
101
103
mk ( ~"target_arch", arch) ,
104
+ mk ( ~"target_endian", end) ,
102
105
mk ( ~"target_word_size", wordsz) ,
103
106
mk ( ~"target_libc", libc) ,
104
107
// Build bindings.
0 commit comments