aboutsummaryrefslogtreecommitdiff
path: root/src/zig_llvm.cpp
diff options
context:
space:
mode:
authorAlex Rønne Petersen <alex@alexrp.com>2024-08-28 03:02:04 +0200
committerAlex Rønne Petersen <alex@alexrp.com>2024-08-28 06:18:06 +0200
commit7d9edff11d4c0dd6793bfd4bb2d7e3c2d32c88cd (patch)
tree82c547eab6f1cd93cef5905e88c14b0438cc5a12 /src/zig_llvm.cpp
parent93cb44c80582dd02b63b02e7bb7e54d7ad8a4ebc (diff)
downloadzig-7d9edff11d4c0dd6793bfd4bb2d7e3c2d32c88cd.tar.gz
zig-7d9edff11d4c0dd6793bfd4bb2d7e3c2d32c88cd.zip
llvm: Set PIC level 1 for MIPS.
For hysterical raisins, MIPS always uses 1, regardless of `-fpic` vs `-fPIC`.
Diffstat (limited to 'src/zig_llvm.cpp')
-rw-r--r--src/zig_llvm.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/zig_llvm.cpp b/src/zig_llvm.cpp
index 6fa6f028dc..b6b6d05f57 100644
--- a/src/zig_llvm.cpp
+++ b/src/zig_llvm.cpp
@@ -81,7 +81,7 @@ static const bool assertions_on = false;
LLVMTargetMachineRef ZigLLVMCreateTargetMachine(LLVMTargetRef T, const char *Triple,
const char *CPU, const char *Features, LLVMCodeGenOptLevel Level, LLVMRelocMode Reloc,
- LLVMCodeModel CodeModel, bool function_sections, bool data_sections, ZigLLVMABIType float_abi,
+ LLVMCodeModel CodeModel, bool function_sections, bool data_sections, ZigLLVMABIType float_abi,
const char *abi_name)
{
std::optional<Reloc::Model> RM;
@@ -430,12 +430,12 @@ void ZigLLVMParseCommandLineOptions(size_t argc, const char *const *argv) {
cl::ParseCommandLineOptions(argc, argv);
}
-void ZigLLVMSetModulePICLevel(LLVMModuleRef module) {
- unwrap(module)->setPICLevel(PICLevel::Level::BigPIC);
+void ZigLLVMSetModulePICLevel(LLVMModuleRef module, bool big) {
+ unwrap(module)->setPICLevel(big ? PICLevel::Level::BigPIC : PICLevel::Level::SmallPIC);
}
-void ZigLLVMSetModulePIELevel(LLVMModuleRef module) {
- unwrap(module)->setPIELevel(PIELevel::Level::Large);
+void ZigLLVMSetModulePIELevel(LLVMModuleRef module, bool large) {
+ unwrap(module)->setPIELevel(large ? PIELevel::Level::Large : PIELevel::Level::Small);
}
void ZigLLVMSetModuleCodeModel(LLVMModuleRef module, LLVMCodeModel code_model) {