[llvm] r283151 - TargetMachine: Make the win32-macho workaround more specific.

Matthias Braun via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 3 15:12:37 PDT 2016


Author: matze
Date: Mon Oct  3 17:12:37 2016
New Revision: 283151

URL: http://llvm.org/viewvc/llvm-project?rev=283151&view=rev
Log:
TargetMachine: Make the win32-macho workaround more specific.

This is to avoid problems with win32 + ELF which surprisingly happens a
lot in practice: If a user just specifies -march on the commandline the
object format changes along with the architecture to ELF in many
instances while the OS stays with the default/host OS.

Modified:
    llvm/trunk/lib/Target/TargetMachine.cpp

Modified: llvm/trunk/lib/Target/TargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetMachine.cpp?rev=283151&r1=283150&r2=283151&view=diff
==============================================================================
--- llvm/trunk/lib/Target/TargetMachine.cpp (original)
+++ llvm/trunk/lib/Target/TargetMachine.cpp Mon Oct  3 17:12:37 2016
@@ -131,7 +131,7 @@ bool TargetMachine::shouldAssumeDSOLocal
   // Make an exception for windows OS in the triple: Some firmwares builds use
   // *-win32-macho triples. This (accidentally?) produced windows relocations
   // without GOT tables in older clang versions; Keep this behaviour.
-  if (TT.isOSBinFormatCOFF() || TT.isOSWindows())
+  if (TT.isOSBinFormatCOFF() || (TT.isOSWindows() && TT.isOSBinFormatMachO()))
     return true;
 
   if (GV && (GV->hasLocalLinkage() || !GV->hasDefaultVisibility()))




More information about the llvm-commits mailing list