diff options
| author | Luuk de Gram <luuk@degram.dev> | 2022-12-28 14:57:17 +0100 |
|---|---|---|
| committer | Luuk de Gram <luuk@degram.dev> | 2022-12-28 14:57:17 +0100 |
| commit | 30f2bb8464bdae0af4920752aecaf61a3319b881 (patch) | |
| tree | 5af14df3d3c4d5037f10d1b1e32f11843d693bb3 /lib/compiler_rt/exp2.zig | |
| parent | 4aab8118a771e37566c0c3b1c40c175ce1e98285 (diff) | |
| download | zig-30f2bb8464bdae0af4920752aecaf61a3319b881.tar.gz zig-30f2bb8464bdae0af4920752aecaf61a3319b881.zip | |
compiler-rt: Set the symbol visibility
When we're compiling compiler_rt for any WebAssembly target, we do
not want to expose all the compiler-rt functions to the host runtime.
By setting the visibility of all exports to `hidden`, we allow the
linker to resolve the symbols during linktime, while not expose the
functions to the host runtime. This also means the linker can
properly garbage collect any compiler-rt function that does not get
resolved. The symbol visibility for all target remains the same as
before: `default`.
Diffstat (limited to 'lib/compiler_rt/exp2.zig')
| -rw-r--r-- | lib/compiler_rt/exp2.zig | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/compiler_rt/exp2.zig b/lib/compiler_rt/exp2.zig index daca339bae..1882367522 100644 --- a/lib/compiler_rt/exp2.zig +++ b/lib/compiler_rt/exp2.zig @@ -14,15 +14,15 @@ const common = @import("common.zig"); pub const panic = common.panic; comptime { - @export(__exp2h, .{ .name = "__exp2h", .linkage = common.linkage }); - @export(exp2f, .{ .name = "exp2f", .linkage = common.linkage }); - @export(exp2, .{ .name = "exp2", .linkage = common.linkage }); - @export(__exp2x, .{ .name = "__exp2x", .linkage = common.linkage }); + @export(__exp2h, .{ .name = "__exp2h", .linkage = common.linkage, .visibility = common.visibility }); + @export(exp2f, .{ .name = "exp2f", .linkage = common.linkage, .visibility = common.visibility }); + @export(exp2, .{ .name = "exp2", .linkage = common.linkage, .visibility = common.visibility }); + @export(__exp2x, .{ .name = "__exp2x", .linkage = common.linkage, .visibility = common.visibility }); if (common.want_ppc_abi) { - @export(exp2q, .{ .name = "exp2f128", .linkage = common.linkage }); + @export(exp2q, .{ .name = "exp2f128", .linkage = common.linkage, .visibility = common.visibility }); } - @export(exp2q, .{ .name = "exp2q", .linkage = common.linkage }); - @export(exp2l, .{ .name = "exp2l", .linkage = common.linkage }); + @export(exp2q, .{ .name = "exp2q", .linkage = common.linkage, .visibility = common.visibility }); + @export(exp2l, .{ .name = "exp2l", .linkage = common.linkage, .visibility = common.visibility }); } pub fn __exp2h(x: f16) callconv(.C) f16 { |
