Closed WonderJ13 closed 5 years ago
I have a similar problem. Is there any solution available yet? I assume that I need to involve lld
rather than ld
, although bfc
doesn't seem to provide a way to do that.
--- a/src/llvm.rs
+++ b/src/llvm.rs
@@ -845,7 +845,7 @@ impl TargetMachine {
cpu.as_ptr() as *const _,
features.as_ptr() as *const _,
LLVMCodeGenOptLevel::LLVMCodeGenLevelAggressive,
- LLVMRelocMode::LLVMRelocDefault,
+ LLVMRelocMode::LLVMRelocPIC,
LLVMCodeModel::LLVMCodeModelDefault);
}
should fix this
Sorry for the delay on this, and thanks @bitwave for the pointer as to what needed fixing! This should be correct now :)
I'm running the integration tests, and the linker fails for each file. Here's the message I'm getting.
/usr/bin/ld: /tmp/.tmpjUJ2R4: relocation R_X86_64_32 against symbol 'known_outputs' can not be used when making a PIE object; recompile with -fPIC /usr/bin/ld: final link failed: nonrepresentable section on output clang-6.0: error: linker command failed with exit code 1 (use -v to see invocation)
I hope this is enough information. I don't know if I can fix this myself.