]> granicus.if.org Git - llvm/commitdiff
TargetMachine: Make the win32-macho workaround more specific.
authorMatthias Braun <matze@braunis.de>
Mon, 3 Oct 2016 22:12:37 +0000 (22:12 +0000)
committerMatthias Braun <matze@braunis.de>
Mon, 3 Oct 2016 22:12:37 +0000 (22:12 +0000)
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283151 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/TargetMachine.cpp

index d7b34f84afc60291e4c799fa14221c464b4132ff..f58535d876786cfe5ec098a0967daa804ea08e4c 100644 (file)
@@ -131,7 +131,7 @@ bool TargetMachine::shouldAssumeDSOLocal(const Module &M,
   // 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()))