aboutsummaryrefslogtreecommitdiff
path: root/src/codegen
diff options
context:
space:
mode:
Diffstat (limited to 'src/codegen')
-rw-r--r--src/codegen/llvm.zig9
-rw-r--r--src/codegen/llvm/bindings.zig5
2 files changed, 10 insertions, 4 deletions
diff --git a/src/codegen/llvm.zig b/src/codegen/llvm.zig
index 00ce2ca226..dc8996afda 100644
--- a/src/codegen/llvm.zig
+++ b/src/codegen/llvm.zig
@@ -1276,8 +1276,11 @@ pub const Object = struct {
);
errdefer target_machine.dispose();
- if (pic) module.setModulePICLevel();
- if (comp.config.pie) module.setModulePIELevel();
+ const large_pic = target_util.usesLargePIC(comp.root_mod.resolved_target.result);
+
+ if (pic) module.setModulePICLevel(large_pic);
+ if (comp.config.pie) module.setModulePIELevel(large_pic);
+
if (code_model != .Default) module.setModuleCodeModel(code_model);
if (comp.llvm_opt_bisect_limit >= 0) {
@@ -1294,6 +1297,8 @@ pub const Object = struct {
.tsan = options.sanitize_thread,
.sancov = options.fuzz,
.lto = options.lto,
+ // https://github.com/ziglang/zig/issues/21215
+ .allow_fast_isel = !comp.root_mod.resolved_target.result.cpu.arch.isMIPS(),
.asm_filename = null,
.bin_filename = options.bin_path,
.llvm_ir_filename = options.post_ir_path,
diff --git a/src/codegen/llvm/bindings.zig b/src/codegen/llvm/bindings.zig
index bb294f27d9..d21fc69ff3 100644
--- a/src/codegen/llvm/bindings.zig
+++ b/src/codegen/llvm/bindings.zig
@@ -53,10 +53,10 @@ pub const Module = opaque {
extern fn LLVMDisposeModule(*Module) void;
pub const setModulePICLevel = ZigLLVMSetModulePICLevel;
- extern fn ZigLLVMSetModulePICLevel(module: *Module) void;
+ extern fn ZigLLVMSetModulePICLevel(module: *Module, big: bool) void;
pub const setModulePIELevel = ZigLLVMSetModulePIELevel;
- extern fn ZigLLVMSetModulePIELevel(module: *Module) void;
+ extern fn ZigLLVMSetModulePIELevel(module: *Module, large: bool) void;
pub const setModuleCodeModel = ZigLLVMSetModuleCodeModel;
extern fn ZigLLVMSetModuleCodeModel(module: *Module, code_model: CodeModel) void;
@@ -91,6 +91,7 @@ pub const TargetMachine = opaque {
tsan: bool,
sancov: bool,
lto: bool,
+ allow_fast_isel: bool,
asm_filename: ?[*:0]const u8,
bin_filename: ?[*:0]const u8,
llvm_ir_filename: ?[*:0]const u8,