compiler-rt, zigc: Use hidden visibility except when testing.

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.
This commit is contained in:
Alex Rønne Petersen 2025-05-18 20:55:56 +02:00
parent 846571ce4e
commit 092352ec63
No known key found for this signature in database
2 changed files with 5 additions and 3 deletions

View File

@ -9,7 +9,7 @@ else
/// 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 (builtin.cpu.arch.isWasm() and linkage != .internal)
pub const visibility: std.builtin.SymbolVisibility = if (linkage != .internal)
.hidden
else
.default;

View File

@ -13,8 +13,10 @@ else
/// 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 (builtin.target.cpu.arch.isWasm() and linkage != .internal) .hidden else .default;
pub const visibility: std.builtin.SymbolVisibility = if (linkage != .internal)
.hidden
else
.default;
pub const PreferredLoadStoreElement = element: {
if (std.simd.suggestVectorLength(u8)) |vec_size| {