diff --git a/src/zig_llvm.cpp b/src/zig_llvm.cpp index 5a7d60f83b..12ae9de75e 100644 --- a/src/zig_llvm.cpp +++ b/src/zig_llvm.cpp @@ -153,6 +153,11 @@ LLVMTargetMachineRef ZigLLVMCreateTargetMachine(LLVMTargetRef T, const char *Tri } TargetOptions opt; + + // Work around the missing initialization of this field in the default + // constructor. Use -1 so that the default value is used. + opt.StackProtectorGuardOffset = (unsigned)-1; + opt.FunctionSections = function_sections; switch (float_abi) { case ZigLLVMABITypeDefault: