Produce PIC code and use -S in the Makefile.

This commit is contained in:
Rafael Ávila de Espíndola
2011-04-15 19:29:13 -04:00
parent cc6a9c8876
commit 099e094765
2 changed files with 25 additions and 46 deletions

View File

@@ -46,6 +46,7 @@ extern "C" void LLVMRustWriteAssembly(LLVMPassManagerRef PMR, LLVMModuleRef M,
const char *triple, const char *path) {
InitializeAllTargets();
InitializeAllAsmPrinters();
TargetMachine::setRelocationModel(Reloc::PIC_);
std::string Err;
const Target *TheTarget = TargetRegistry::lookupTarget(triple, Err);
std::string FeaturesStr;