mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 05:44:20 +00:00
This prevents symbols from these libraries from polluting the dynamic symbol tables of binaries built with Zig. The downside is that we no longer deduplicate the symbols at run time due to weak linkage. Closes #7935. Closes #13303. Closes #19342.
15 lines
457 B
Zig
15 lines
457 B
Zig
const builtin = @import("builtin");
|
|
const std = @import("std");
|
|
|
|
pub const linkage: std.builtin.GlobalLinkage = if (builtin.is_test)
|
|
.internal
|
|
else
|
|
.strong;
|
|
|
|
/// Determines the symbol's visibility to other objects.
|
|
/// For WebAssembly this allows the symbol to be resolved to other modules, but will not
|
|
/// export it to the host runtime.
|
|
pub const visibility: std.builtin.SymbolVisibility = if (linkage != .internal)
|
|
.hidden
|
|
else
|
|
.default;
|