diff options
| author | Laytan Laats <laytanlaats@hotmail.com> | 2025-03-01 16:06:32 +0100 |
|---|---|---|
| committer | Laytan Laats <laytanlaats@hotmail.com> | 2025-03-01 16:06:32 +0100 |
| commit | 66540b75f50315e372a74545de7fe91d04b1be62 (patch) | |
| tree | 0ec4072d02f48de2e3f9eb02c74bc755fe2b2281 /src | |
| parent | bb20b03f2ee52d11cabc305b354a864b04a31778 (diff) | |
fix hidden linkage applied to foreign symbols
Diffstat (limited to 'src')
| -rw-r--r-- | src/llvm_backend.cpp | 4 |
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); } } |