Hack out the PIC mode on Win64 targets. This needs to be investigated later.
authorAnton Korobeynikov <asl@math.spbu.ru>
Sun, 23 Mar 2008 13:41:18 +0000 (13:41 +0000)
committerAnton Korobeynikov <asl@math.spbu.ru>
Sun, 23 Mar 2008 13:41:18 +0000 (13:41 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48703 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86TargetMachine.cpp

index 2d0424bf44c5bde2834aa7c7d60f9619fc577a1f..98d1fb46f910afb6ed4113509dfd3a07833345f1 100644 (file)
@@ -119,8 +119,10 @@ X86TargetMachine::X86TargetMachine(const Module &M, const std::string &FS,
               Subtarget.getStackAlignment(), Subtarget.is64Bit() ? -8 : -4),
     InstrInfo(*this), JITInfo(*this), TLInfo(*this) {
   DefRelocModel = getRelocationModel();
+  // FIXME: Correctly select PIC model for Win64 stuff
   if (getRelocationModel() == Reloc::Default) {
-    if (Subtarget.isTargetDarwin() || Subtarget.isTargetCygMing())
+    if (Subtarget.isTargetDarwin() ||
+        (Subtarget.isTargetCygMing() && !Subtarget.isTargetWin64()))
       setRelocationModel(Reloc::DynamicNoPIC);
     else
       setRelocationModel(Reloc::Static);