Teach llvm-lto to respect the given RelocModel.

Patch by Nick Tomlinson!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206177 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
James Molloy
2014-04-14 13:54:16 +00:00
parent f86c5472c0
commit 555f97f2bc
3 changed files with 21 additions and 3 deletions

View File

@ -83,7 +83,20 @@ int main(int argc, char **argv) {
LTOCodeGenerator CodeGen;
CodeGen.setCodePICModel(LTO_CODEGEN_PIC_MODEL_DYNAMIC);
switch (RelocModel) {
case Reloc::Static:
CodeGen.setCodePICModel(LTO_CODEGEN_PIC_MODEL_STATIC);
break;
case Reloc::PIC_:
CodeGen.setCodePICModel(LTO_CODEGEN_PIC_MODEL_DYNAMIC);
break;
case Reloc::DynamicNoPIC:
CodeGen.setCodePICModel(LTO_CODEGEN_PIC_MODEL_DYNAMIC_NO_PIC);
break;
default:
CodeGen.setCodePICModel(LTO_CODEGEN_PIC_MODEL_DEFAULT);
}
CodeGen.setDebugInfo(LTO_DEBUG_MODEL_DWARF);
CodeGen.setTargetOptions(Options);