about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/librustc/back/arm.rs7
-rw-r--r--src/librustc/driver/driver.rs1
2 files changed, 7 insertions, 1 deletions
diff --git a/src/librustc/back/arm.rs b/src/librustc/back/arm.rs
index c155f4bd15b..92a0c90cd9d 100644
--- a/src/librustc/back/arm.rs
+++ b/src/librustc/back/arm.rs
@@ -14,6 +14,11 @@ use metadata::loader::meta_section_name;
 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,
     };
 }
diff --git a/src/librustc/driver/driver.rs b/src/librustc/driver/driver.rs
index dcab4376cd1..9cc12caa478 100644
--- a/src/librustc/driver/driver.rs
+++ b/src/librustc/driver/driver.rs
@@ -661,6 +661,7 @@ static architecture_abis : &'static [(&'static str, abi::Architecture)] = &'stat
 
     ("arm",    abi::Arm),
     ("xscale", abi::Arm),
+    ("thumb",  abi::Arm),
 
     ("mips",   abi::Mips)];