diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2024-08-30 14:47:43 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-30 14:47:43 -0700 |
| commit | e4e91a1314abd78a0f06df718459e42e3c9fb62a (patch) | |
| tree | 0ea10dc19eb14e62fefc329e1ead6110e7c0d5bd /src/codegen/llvm.zig | |
| parent | 5d08b7f0548c61b918504a7b02573127c49c6f97 (diff) | |
| parent | a2e691d589ac1d234ee624fdf8fa931d89a719b1 (diff) | |
| download | zig-e4e91a1314abd78a0f06df718459e42e3c9fb62a.tar.gz zig-e4e91a1314abd78a0f06df718459e42e3c9fb62a.zip | |
Merge pull request #21224 from alexrp/mips-gnu-fixes
Fix MIPS PIC level and work around an LLVM bug for `mips(el)-linux-gnueabi(hf)`
Diffstat (limited to 'src/codegen/llvm.zig')
| -rw-r--r-- | src/codegen/llvm.zig | 9 |
1 files changed, 7 insertions, 2 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, |
