From abc8ddcfa9e229b4c9a53dc6cc757a6835fd15a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Wed, 10 Dec 2025 15:39:59 +0100 Subject: [PATCH] llvm: fix aliases not having linkage, visibility, etc set --- src/codegen/llvm.zig | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/codegen/llvm.zig b/src/codegen/llvm.zig index f8995446b3..5dc55b74f6 100644 --- a/src/codegen/llvm.zig +++ b/src/codegen/llvm.zig @@ -1787,6 +1787,22 @@ pub const Object = struct { global_index.toConst(), ); try alias_index.rename(exp_name, &o.builder); + + const alias_global_index = alias_index.ptrConst(&o.builder).global; + alias_global_index.setUnnamedAddr(.default, &o.builder); + if (comp.config.dll_export_fns) + alias_global_index.setDllStorageClass(.dllexport, &o.builder); + alias_global_index.setLinkage(switch (first_export.opts.linkage) { + .internal => unreachable, + .strong => .external, + .weak => .weak_odr, + .link_once => .linkonce_odr, + }, &o.builder); + alias_global_index.setVisibility(switch (first_export.opts.visibility) { + .default => .default, + .hidden => .hidden, + .protected => .protected, + }, &o.builder); } }