Add -reloc-mode:<string>

This commit is contained in:
gingerBill
2022-02-20 14:48:12 +00:00
parent 0fa487f468
commit 3e5c60f746
3 changed files with 49 additions and 0 deletions
+14
View File
@@ -1308,6 +1308,20 @@ void lb_generate_code(lbGenerator *gen) {
reloc_mode = LLVMRelocPIC;
}
switch (build_context.reloc_mode) {
case RelocMode_Default:
break;
case RelocMode_Static:
reloc_mode = LLVMRelocStatic;
break;
case RelocMode_PIC:
reloc_mode = LLVMRelocPIC;
break;
case RelocMode_DynamicNoPIC:
reloc_mode = LLVMRelocDynamicNoPic;
break;
}
for_array(i, gen->modules.entries) {
target_machines[i] = LLVMCreateTargetMachine(
target, target_triple, llvm_cpu,