aboutsummaryrefslogtreecommitdiff
path: root/src/llvm_backend.cpp
diff options
context:
space:
mode:
authorgingerBill <gingerBill@users.noreply.github.com>2025-04-25 08:23:48 +0100
committerGitHub <noreply@github.com>2025-04-25 08:23:48 +0100
commitb83809779b66fa4935eff356ee9f84a114982726 (patch)
tree1a5baee3a497ad7ec415afc10a5f0062f5e1a656 /src/llvm_backend.cpp
parentcfb478808e7dae48f3a40fe7e40927c5e38a5d1d (diff)
parent9284ebb5e831c6c25e90131f5c607997760a7396 (diff)
Merge pull request #5075 from Barinzaya/global-var-alignment
Fix Global/Static Variable Alignment
Diffstat (limited to 'src/llvm_backend.cpp')
-rw-r--r--src/llvm_backend.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/llvm_backend.cpp b/src/llvm_backend.cpp
index 083a1d90e..2f861573a 100644
--- a/src/llvm_backend.cpp
+++ b/src/llvm_backend.cpp
@@ -2598,6 +2598,7 @@ gb_internal bool lb_generate_code(lbGenerator *gen) {
LLVMSetLinkage(g.value, USE_SEPARATE_MODULES ? LLVMWeakAnyLinkage : LLVMInternalLinkage);
}
lb_set_linkage_from_entity_flags(m, g.value, e->flags);
+ LLVMSetAlignment(g.value, cast(u32)type_align_of(e->type));
if (e->Variable.link_section.len > 0) {
LLVMSetSection(g.value, alloc_cstring(permanent_allocator(), e->Variable.link_section));