aboutsummaryrefslogtreecommitdiff
path: root/src-self-hosted
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2019-07-03 14:43:33 -0400
committerAndrew Kelley <andrew@ziglang.org>2019-07-03 14:43:33 -0400
commit2f4faf306d5d7a5b730b4dc6d426af713289bb51 (patch)
tree51eab8ecad767f7436bf7ef3fe3f155009e5e5d1 /src-self-hosted
parent53ca4118bdd3908092a53b6b4c59762a85b78dfc (diff)
parentbbc0d440b86a1783c1fddc5e594f9b4067016489 (diff)
downloadzig-2f4faf306d5d7a5b730b4dc6d426af713289bb51.tar.gz
zig-2f4faf306d5d7a5b730b4dc6d426af713289bb51.zip
Merge branch 'function-sections' of https://github.com/timonkruiper/zig into timonkruiper-function-sections
Diffstat (limited to 'src-self-hosted')
-rw-r--r--src-self-hosted/compilation.zig1
-rw-r--r--src-self-hosted/llvm.zig5
2 files changed, 4 insertions, 2 deletions
diff --git a/src-self-hosted/compilation.zig b/src-self-hosted/compilation.zig
index bd20442d4b..a64e52a2b6 100644
--- a/src-self-hosted/compilation.zig
+++ b/src-self-hosted/compilation.zig
@@ -516,6 +516,7 @@ pub const Compilation = struct {
opt_level,
reloc_mode,
llvm.CodeModelDefault,
+ false // TODO: add -ffunction-sections option
) orelse return error.OutOfMemory;
defer llvm.DisposeTargetMachine(comp.target_machine);
diff --git a/src-self-hosted/llvm.zig b/src-self-hosted/llvm.zig
index 5cb95682ab..40d414e5f7 100644
--- a/src-self-hosted/llvm.zig
+++ b/src-self-hosted/llvm.zig
@@ -163,8 +163,8 @@ extern fn LLVMCopyStringRepOfTargetData(TD: *TargetData) ?[*]u8;
pub const CreateTargetDataLayout = LLVMCreateTargetDataLayout;
extern fn LLVMCreateTargetDataLayout(T: *TargetMachine) ?*TargetData;
-pub const CreateTargetMachine = LLVMCreateTargetMachine;
-extern fn LLVMCreateTargetMachine(
+pub const CreateTargetMachine = ZigLLVMCreateTargetMachine;
+extern fn ZigLLVMCreateTargetMachine(
T: *Target,
Triple: [*]const u8,
CPU: [*]const u8,
@@ -172,6 +172,7 @@ extern fn LLVMCreateTargetMachine(
Level: CodeGenOptLevel,
Reloc: RelocMode,
CodeModel: CodeModel,
+ function_sections: bool,
) ?*TargetMachine;
pub const GetHostCPUName = LLVMGetHostCPUName;