aboutsummaryrefslogtreecommitdiff
path: root/lib/compiler_rt/cmpdf2.zig
diff options
context:
space:
mode:
authorLuuk de Gram <luuk@degram.dev>2022-12-28 14:57:17 +0100
committerLuuk de Gram <luuk@degram.dev>2022-12-28 14:57:17 +0100
commit30f2bb8464bdae0af4920752aecaf61a3319b881 (patch)
tree5af14df3d3c4d5037f10d1b1e32f11843d693bb3 /lib/compiler_rt/cmpdf2.zig
parent4aab8118a771e37566c0c3b1c40c175ce1e98285 (diff)
downloadzig-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/cmpdf2.zig')
-rw-r--r--lib/compiler_rt/cmpdf2.zig16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/compiler_rt/cmpdf2.zig b/lib/compiler_rt/cmpdf2.zig
index 67dbcd8b4d..8a7b37c2c9 100644
--- a/lib/compiler_rt/cmpdf2.zig
+++ b/lib/compiler_rt/cmpdf2.zig
@@ -7,15 +7,15 @@ pub const panic = common.panic;
comptime {
if (common.want_aeabi) {
- @export(__aeabi_dcmpeq, .{ .name = "__aeabi_dcmpeq", .linkage = common.linkage });
- @export(__aeabi_dcmplt, .{ .name = "__aeabi_dcmplt", .linkage = common.linkage });
- @export(__aeabi_dcmple, .{ .name = "__aeabi_dcmple", .linkage = common.linkage });
+ @export(__aeabi_dcmpeq, .{ .name = "__aeabi_dcmpeq", .linkage = common.linkage, .visibility = common.visibility });
+ @export(__aeabi_dcmplt, .{ .name = "__aeabi_dcmplt", .linkage = common.linkage, .visibility = common.visibility });
+ @export(__aeabi_dcmple, .{ .name = "__aeabi_dcmple", .linkage = common.linkage, .visibility = common.visibility });
} else {
- @export(__eqdf2, .{ .name = "__eqdf2", .linkage = common.linkage });
- @export(__nedf2, .{ .name = "__nedf2", .linkage = common.linkage });
- @export(__ledf2, .{ .name = "__ledf2", .linkage = common.linkage });
- @export(__cmpdf2, .{ .name = "__cmpdf2", .linkage = common.linkage });
- @export(__ltdf2, .{ .name = "__ltdf2", .linkage = common.linkage });
+ @export(__eqdf2, .{ .name = "__eqdf2", .linkage = common.linkage, .visibility = common.visibility });
+ @export(__nedf2, .{ .name = "__nedf2", .linkage = common.linkage, .visibility = common.visibility });
+ @export(__ledf2, .{ .name = "__ledf2", .linkage = common.linkage, .visibility = common.visibility });
+ @export(__cmpdf2, .{ .name = "__cmpdf2", .linkage = common.linkage, .visibility = common.visibility });
+ @export(__ltdf2, .{ .name = "__ltdf2", .linkage = common.linkage, .visibility = common.visibility });
}
}