summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/X86/X86TargetMachine.cpp
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
commitad6f3ff2c088657efa64b977535b18aef5ec7d7a (patch)
treef2e4b19668fd9886e26b9f4a273b6483af4cc29b /llvm/lib/Target/X86/X86TargetMachine.cpp
parentc29260128787637f7dfe29ad5c3e6acbb60356eb (diff)
downloadbcm5719-llvm-ad6f3ff2c088657efa64b977535b18aef5ec7d7a.tar.gz
bcm5719-llvm-ad6f3ff2c088657efa64b977535b18aef5ec7d7a.zip
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. llvm-svn: 72806
Diffstat (limited to 'llvm/lib/Target/X86/X86TargetMachine.cpp')
-rw-r--r--llvm/lib/Target/X86/X86TargetMachine.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/X86TargetMachine.cpp b/llvm/lib/Target/X86/X86TargetMachine.cpp
index 8264462506a..c2353c183c3 100644
--- a/llvm/lib/Target/X86/X86TargetMachine.cpp
+++ b/llvm/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));
OpenPOWER on IntegriCloud