@@ -166,26 +166,31 @@ options:
166
166
}
167
167
168
168
fn get_os ( str triple ) -> session:: os {
169
- if ( _str:: find ( triple, "win32" ) > 0 ||
170
- _str:: find ( triple, "mingw32" ) > 0 ) {
169
+ if ( _str:: find ( triple, "win32" ) >= 0 ||
170
+ _str:: find ( triple, "mingw32" ) >= 0 ) {
171
171
ret session:: os_win32;
172
- } else if ( _str:: find ( triple, "darwin" ) > 0 ) { ret session:: os_macos; }
173
- else if ( _str:: find ( triple, "linux" ) > 0 ) { ret session:: os_linux; }
172
+ } else if ( _str:: find ( triple, "darwin" ) >= 0 ) { ret session:: os_macos; }
173
+ else if ( _str:: find ( triple, "linux" ) >= 0 ) { ret session:: os_linux; }
174
+ else { log_err "Unknown operating system!" ; fail; }
174
175
}
175
176
176
177
fn get_arch ( str triple ) -> session:: arch {
177
- if ( _str:: find ( triple, "i386" ) > 0 ||
178
- _str:: find ( triple, "i486" ) > 0 ||
179
- _str:: find ( triple, "i586" ) > 0 ||
180
- _str:: find ( triple, "i686" ) > 0 ||
181
- _str:: find ( triple, "i786" ) > 0 ) {
178
+ if ( _str:: find ( triple, "i386" ) >= 0 ||
179
+ _str:: find ( triple, "i486" ) >= 0 ||
180
+ _str:: find ( triple, "i586" ) >= 0 ||
181
+ _str:: find ( triple, "i686" ) >= 0 ||
182
+ _str:: find ( triple, "i786" ) >= 0 ) {
182
183
ret session:: arch_x86;
183
- } else if ( _str:: find ( triple, "x86_64" ) > 0 ) {
184
+ } else if ( _str:: find ( triple, "x86_64" ) >= 0 ) {
184
185
ret session:: arch_x64;
185
- } else if ( _str:: find ( triple, "arm" ) > 0 ||
186
- _str:: find ( triple, "xscale" ) > 0 ) {
186
+ } else if ( _str:: find ( triple, "arm" ) >= 0 ||
187
+ _str:: find ( triple, "xscale" ) >= 0 ) {
187
188
ret session:: arch_arm;
188
189
}
190
+ else {
191
+ log_err ( "Unknown architecture! " + triple) ;
192
+ fail;
193
+ }
189
194
}
190
195
191
196
fn get_default_sysroot ( str binary ) -> str {
0 commit comments