authorgravatar for thatlemon@gmail.comLemonBoy <thatlemon@gmail.com> 2021-04-06 16:02:18+02:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-04-06 11:02:18-07:00
log10c2b36444788ae0518dfc8908a4821f4e60ed67
tree33e44625653d96bc3dec29fa01160ed9d5f32e1d
parent4d729ebc87456c9a9e1c487e6185346d1eb8d585

stage1: Work around a small problem in LLVM API

The missing initializer for a single field in the TargetOptions class was enough to turn the stack protectors into hot garbage. Fixes #8408

1 files changed, 5 insertions(+), 0 deletions(-)

src/zig_llvm.cpp+5
...@@ -153,6 +153,11 @@ LLVMTargetMachineRef ZigLLVMCreateTargetMachine(LLVMTargetRef T, const char *Tri...@@ -153,6 +153,11 @@ LLVMTargetMachineRef ZigLLVMCreateTargetMachine(LLVMTargetRef T, const char *Tri
153 }153 }
154154
155 TargetOptions opt;155 TargetOptions opt;
156
157 // Work around the missing initialization of this field in the default
158 // constructor. Use -1 so that the default value is used.
159 opt.StackProtectorGuardOffset = (unsigned)-1;
160
156 opt.FunctionSections = function_sections;161 opt.FunctionSections = function_sections;
157 switch (float_abi) {162 switch (float_abi) {
158 case ZigLLVMABITypeDefault:163 case ZigLLVMABITypeDefault: