]> git.lizzy.rs Git - rust.git/commitdiff
Expand comments in thumbv7a-pc-windows-msvc target spec
authorJordan Rhee <jordanrh@microsoft.com>
Wed, 12 Sep 2018 18:28:02 +0000 (11:28 -0700)
committerJordan Rhee <jordanrh@microsoft.com>
Wed, 12 Sep 2018 18:28:02 +0000 (11:28 -0700)
src/librustc_target/spec/thumbv7a_pc_windows_msvc.rs

index a699e15d417b92578bc6aa60210bb7eca30ea36a..dab10ca241ebcfc0c41c28919176838de418e599 100644 (file)
@@ -14,9 +14,17 @@ pub fn target() -> TargetResult {
     let mut base = super::windows_msvc_base::opts();
 
     // Prevent error LNK2013: BRANCH24(T) fixup overflow
+    // The LBR optimization tries to eliminate branch islands,
+    // but if the displacement is larger than can fit
+    // in the instruction, this error will occur. The linker
+    // should be smart enough to insert branch islands only
+    // where necessary, but this is not the observed behavior.
+    // Disabling the LBR optimization works around the issue.
     base.pre_link_args.get_mut(&LinkerFlavor::Msvc).unwrap().push(
         "/OPT:NOLBR".to_string());
 
+    // FIXME(jordanrh): use PanicStrategy::Unwind when SEH is
+    // implemented for windows/arm in LLVM
     base.panic_strategy = PanicStrategy::Abort;
 
     Ok(Target {