commit abc8ddcfa9e229b4c9a53dc6cc757a6835fd15a5 (tree)
parent 2da956b84a1f26ea9b52e2314e8393cffba95df2
Author: Alex Rønne Petersen <alex@alexrp.com>
Date: Wed, 10 Dec 2025 15:39:59 +0100
llvm: fix aliases not having linkage, visibility, etc set
Diffstat:
1 file changed, 16 insertions(+), 0 deletions(-)
diff --git 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);
}
}