aboutsummaryrefslogtreecommitdiff
path: root/src/zig_llvm.cpp
diff options
context:
space:
mode:
authorJacob Young <jacobly0@users.noreply.github.com>2024-07-24 00:51:03 -0400
committerAndrew Kelley <andrew@ziglang.org>2024-07-24 15:24:17 -0700
commitf4f5b2bc41e09ed68caf3c839433e44bd9b33249 (patch)
tree27e0b314e63c8dd7d248a7e7f1fdd1a04042d2cf /src/zig_llvm.cpp
parentbe56c67b1444632a719db2aac9a8476c2911b882 (diff)
downloadzig-f4f5b2bc41e09ed68caf3c839433e44bd9b33249.tar.gz
zig-f4f5b2bc41e09ed68caf3c839433e44bd9b33249.zip
llvm: force `TargetOptions.UseInitArray` to `true`
The `TargetOptions` default constructor initializes all `bool`s to `false`, yet clang defaults to setting this option to `true`. Since recent glibc versions on linux do not appear to support this being set to `false`, just changing the default for now unless a use case for making it configurable is found.
Diffstat (limited to 'src/zig_llvm.cpp')
-rw-r--r--src/zig_llvm.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/zig_llvm.cpp b/src/zig_llvm.cpp
index 5aca64cd0a..167e7a162f 100644
--- a/src/zig_llvm.cpp
+++ b/src/zig_llvm.cpp
@@ -129,6 +129,7 @@ LLVMTargetMachineRef ZigLLVMCreateTargetMachine(LLVMTargetRef T, const char *Tri
TargetOptions opt;
+ opt.UseInitArray = true;
opt.FunctionSections = function_sections;
opt.DataSections = data_sections;
switch (float_abi) {