llvm: Set PIC level 1 for MIPS.
For hysterical raisins, MIPS always uses 1, regardless of `-fpic` vs `-fPIC`.
This commit is contained in:
@@ -1259,8 +1259,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) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user