aboutsummaryrefslogtreecommitdiff
path: root/src/llvm_backend.cpp
diff options
context:
space:
mode:
authorLaytan Laats <laytanlaats@hotmail.com>2025-03-01 16:06:32 +0100
committerLaytan Laats <laytanlaats@hotmail.com>2025-03-01 16:06:32 +0100
commit66540b75f50315e372a74545de7fe91d04b1be62 (patch)
tree0ec4072d02f48de2e3f9eb02c74bc755fe2b2281 /src/llvm_backend.cpp
parentbb20b03f2ee52d11cabc305b354a864b04a31778 (diff)
fix hidden linkage applied to foreign symbols
Diffstat (limited to 'src/llvm_backend.cpp')
-rw-r--r--src/llvm_backend.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/llvm_backend.cpp b/src/llvm_backend.cpp
index 9cf996e84..f21ca9f75 100644
--- a/src/llvm_backend.cpp
+++ b/src/llvm_backend.cpp
@@ -169,7 +169,7 @@ gb_internal void lb_correct_entity_linkage(lbGenerator *gen) {
other_global = LLVMGetNamedGlobal(ec.other_module->mod, ec.cname);
if (other_global) {
LLVMSetLinkage(other_global, LLVMWeakAnyLinkage);
- if (!ec.e->Variable.is_export) {
+ if (!ec.e->Variable.is_export && !ec.e->Variable.is_foreign) {
LLVMSetVisibility(other_global, LLVMHiddenVisibility);
}
}
@@ -177,7 +177,7 @@ gb_internal void lb_correct_entity_linkage(lbGenerator *gen) {
other_global = LLVMGetNamedFunction(ec.other_module->mod, ec.cname);
if (other_global) {
LLVMSetLinkage(other_global, LLVMWeakAnyLinkage);
- if (!ec.e->Procedure.is_export) {
+ if (!ec.e->Procedure.is_export && !ec.e->Procedure.is_foreign) {
LLVMSetVisibility(other_global, LLVMHiddenVisibility);
}
}