summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2009-06-03 21:13:54 +0000
committerEvan Cheng <evan.cheng@apple.com>2009-06-03 21:13:54 +0000
commit424f8f339a0c70f58ce90254c0e04f637ab4da40 (patch)
tree3c673ac8ebfe76f2f0eb17dbef1e7ae5168693fd /lib
parent006a03482880a5b614dfbb8601e0ae92593a595c (diff)
downloadllvm-424f8f339a0c70f58ce90254c0e04f637ab4da40.tar.gz
llvm-424f8f339a0c70f58ce90254c0e04f637ab4da40.tar.bz2
llvm-424f8f339a0c70f58ce90254c0e04f637ab4da40.tar.xz
For Darwin / x86_64, override -relocation-model=static to pic if the output is assembly since Darwin assembler does not really support -static codeine.
I view this as a temporary workaround until the assembler / linker changes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72806 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Target/X86/X86TargetMachine.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Target/X86/X86TargetMachine.cpp b/lib/Target/X86/X86TargetMachine.cpp
index 8264462506..c2353c183c 100644
--- a/lib/Target/X86/X86TargetMachine.cpp
+++ b/lib/Target/X86/X86TargetMachine.cpp
@@ -213,6 +213,13 @@ bool X86TargetMachine::addAssemblyEmitter(PassManagerBase &PM,
CodeGenOpt::Level OptLevel,
bool Verbose,
raw_ostream &Out) {
+ // FIXME: Move this somewhere else!
+ // On Darwin, override 64-bit static relocation to pic_ since the
+ // assembler doesn't support it.
+ if (DefRelocModel == Reloc::Static &&
+ Subtarget.isTargetDarwin() && Subtarget.is64Bit())
+ setRelocationModel(Reloc::PIC_);
+
assert(AsmPrinterCtor && "AsmPrinter was not linked in");
if (AsmPrinterCtor)
PM.add(AsmPrinterCtor(Out, *this, OptLevel, Verbose));