]> git.lizzy.rs Git - rust.git/commitdiff
Add support for ARM thumb architecture
authorBen Harris <mail@bharr.is>
Tue, 21 Jan 2014 06:47:14 +0000 (14:47 +0800)
committerBen Harris <mail@bharr.is>
Tue, 21 Jan 2014 10:27:49 +0000 (18:27 +0800)
src/librustc/back/arm.rs
src/librustc/driver/driver.rs

index c155f4bd15b899371e84b39e042badc1eccdc433..92a0c90cd9ded2b56aa1c39bfced27141d8762bb 100644 (file)
 use syntax::abi;
 
 pub fn get_target_strs(target_triple: ~str, target_os: abi::Os) -> target_strs::t {
+    let cc_args = if target_triple.contains("thumb") {
+        ~[~"-mthumb"]
+    } else {
+        ~[~"-marm"]
+    };
     return target_strs::t {
         module_asm: ~"",
 
@@ -63,6 +68,6 @@ pub fn get_target_strs(target_triple: ~str, target_os: abi::Os) -> target_strs::
 
         target_triple: target_triple,
 
-        cc_args: ~[~"-marm"],
+        cc_args: cc_args,
     };
 }
index 9555a706f0874b3c7588c0be8fdb4b052165107c..2606981a8521e380ad4169478167367be136b0ae 100644 (file)
@@ -661,6 +661,7 @@ pub fn get_arch(triple: &str) -> Option<abi::Architecture> {
 
     ("arm",    abi::Arm),
     ("xscale", abi::Arm),
+    ("thumb",  abi::Arm),
 
     ("mips",   abi::Mips)];