mirror of
https://github.com/ziglang/zig.git
synced 2026-02-21 16:54:52 +00:00
LLVM: set module PIC, PIE, and CodeModel
Some simple code from stage1 ported over to stage2.
This commit is contained in:
parent
defda6202a
commit
ea7142c43f
@ -340,6 +340,10 @@ pub const Object = struct {
|
||||
|
||||
llvm_module.setModuleDataLayout(target_data);
|
||||
|
||||
if (options.pic) llvm_module.setModulePICLevel();
|
||||
if (options.pie) llvm_module.setModulePIELevel();
|
||||
if (code_model != .Default) llvm_module.setModuleCodeModel(code_model);
|
||||
|
||||
return Object{
|
||||
.gpa = gpa,
|
||||
.module = options.module.?,
|
||||
|
||||
@ -310,6 +310,15 @@ pub const Module = opaque {
|
||||
pub const setModuleDataLayout = LLVMSetModuleDataLayout;
|
||||
extern fn LLVMSetModuleDataLayout(*const Module, *const TargetData) void;
|
||||
|
||||
pub const setModulePICLevel = ZigLLVMSetModulePICLevel;
|
||||
extern fn ZigLLVMSetModulePICLevel(module: *const Module) void;
|
||||
|
||||
pub const setModulePIELevel = ZigLLVMSetModulePIELevel;
|
||||
extern fn ZigLLVMSetModulePIELevel(module: *const Module) void;
|
||||
|
||||
pub const setModuleCodeModel = ZigLLVMSetModuleCodeModel;
|
||||
extern fn ZigLLVMSetModuleCodeModel(module: *const Module, code_model: CodeModel) void;
|
||||
|
||||
pub const addFunction = LLVMAddFunction;
|
||||
extern fn LLVMAddFunction(*const Module, Name: [*:0]const u8, FunctionTy: *const Type) *const Value;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user