File tree Expand file tree Collapse file tree 2 files changed +21
-2
lines changed
branches/auto/src/librustc/back Expand file tree Collapse file tree 2 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
13
13
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
14
14
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
15
15
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16
- refs/heads/auto: b00147a99b289b11a210d9fc841b8aca3e59ce0e
16
+ refs/heads/auto: b5f19795adda1bb2daca891e97bca8c7638916e2
17
17
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
18
18
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
19
19
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336
Original file line number Diff line number Diff line change @@ -98,13 +98,32 @@ pub mod write {
98
98
use lib;
99
99
use syntax:: abi;
100
100
use util:: common:: time;
101
+ use syntax:: abi;
101
102
102
103
use std:: c_str:: ToCStr ;
103
104
use std:: libc:: { c_uint, c_int} ;
104
105
use std:: path:: Path ;
105
106
use std:: run;
106
107
use std:: str;
107
108
109
+ // On android, we by default compile for armv7 processors. This enables
110
+ // things like double word CAS instructions (rather than emulating them)
111
+ // which are *far* more efficient. This is obviously undesirable in some
112
+ // cases, so if any sort of target feature is specified we don't append v7
113
+ // to the feature list.
114
+ fn target_feature < ' a > ( sess : & ' a Session ) -> & ' a str {
115
+ match sess. targ_cfg . os {
116
+ abi:: OsAndroid => {
117
+ if "" == sess. opts . target_feature {
118
+ "+v7"
119
+ } else {
120
+ sess. opts . target_feature . as_slice ( )
121
+ }
122
+ }
123
+ _ => sess. opts . target_feature . as_slice ( )
124
+ }
125
+ }
126
+
108
127
pub fn run_passes ( sess : Session ,
109
128
trans : & CrateTranslation ,
110
129
output_type : OutputType ,
@@ -136,7 +155,7 @@ pub mod write {
136
155
137
156
let tm = sess. targ_cfg . target_strs . target_triple . with_c_str ( |T | {
138
157
sess. opts . target_cpu . with_c_str ( |CPU | {
139
- sess . opts . target_feature . with_c_str ( |Features | {
158
+ target_feature ( & sess ) . with_c_str ( |Features | {
140
159
llvm:: LLVMRustCreateTargetMachine (
141
160
T , CPU , Features ,
142
161
lib:: llvm:: CodeModelDefault ,
You can’t perform that action at this time.
0 commit comments