File tree Expand file tree Collapse file tree 2 files changed +21
-2
lines changed
branches/try2/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 @@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
5
5
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8
- refs/heads/try2: b00147a99b289b11a210d9fc841b8aca3e59ce0e
8
+ refs/heads/try2: b5f19795adda1bb2daca891e97bca8c7638916e2
9
9
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
10
10
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
11
11
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
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