| author | |
| committer | |
| log | 092352ec63d3a4e9ff59a5d8ad8f119bf0eda468 |
| tree | df59739ecb008fb3412477964932933c7ec1d8bc |
| parent | 846571ce4e9840c278eb5bad1eb5221e84cf92de |
| signature |
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.2 files changed, 5 insertions(+), 3 deletions(-)
lib/c/common.zig+1-1| ... | @@ -9,7 +9,7 @@ else | ... | @@ -9,7 +9,7 @@ else |
| 9 | /// Determines the symbol's visibility to other objects. | 9 | /// Determines the symbol's visibility to other objects. |
| 10 | /// For WebAssembly this allows the symbol to be resolved to other modules, but will not | 10 | /// For WebAssembly this allows the symbol to be resolved to other modules, but will not |
| 11 | /// export it to the host runtime. | 11 | /// export it to the host runtime. |
| 12 | pub const visibility: std.builtin.SymbolVisibility = if (builtin.cpu.arch.isWasm() and linkage != .internal) | 12 | pub const visibility: std.builtin.SymbolVisibility = if (linkage != .internal) |
| 13 | .hidden | 13 | .hidden |
| 14 | else | 14 | else |
| 15 | .default; | 15 | .default; |
lib/compiler_rt/common.zig+4-2| ... | @@ -13,8 +13,10 @@ else | ... | @@ -13,8 +13,10 @@ else |
| 13 | /// Determines the symbol's visibility to other objects. | 13 | /// Determines the symbol's visibility to other objects. |
| 14 | /// For WebAssembly this allows the symbol to be resolved to other modules, but will not | 14 | /// For WebAssembly this allows the symbol to be resolved to other modules, but will not |
| 15 | /// export it to the host runtime. | 15 | /// export it to the host runtime. |
| 16 | pub const visibility: std.builtin.SymbolVisibility = | 16 | pub const visibility: std.builtin.SymbolVisibility = if (linkage != .internal) |
| 17 | if (builtin.target.cpu.arch.isWasm() and linkage != .internal) .hidden else .default; | 17 | .hidden |
| 18 | else | ||
| 19 | .default; | ||
| 18 | 20 | ||
| 19 | pub const PreferredLoadStoreElement = element: { | 21 | pub const PreferredLoadStoreElement = element: { |
| 20 | if (std.simd.suggestVectorLength(u8)) |vec_size| { | 22 | if (std.simd.suggestVectorLength(u8)) |vec_size| { |