Skip to content

Commit 07c93cb

Browse files
committed
compiler-rt: Add a comment explaining why we currently need weak linkage.
1 parent 90fb2d9 commit 07c93cb

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/compiler_rt/common.zig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ const builtin = @import("builtin");
33
const native_endian = builtin.cpu.arch.endian();
44
const ofmt_c = builtin.object_format == .c;
55

6+
/// For now, we prefer weak linkage because some of the routines we implement here may also be
7+
/// provided by system/dynamic libc. Eventually we should be more disciplined about this on a
8+
/// per-symbol, per-target basis: https://github.com/ziglang/zig/issues/11883
69
pub const linkage: std.builtin.GlobalLinkage = if (builtin.is_test)
710
.internal
811
else if (ofmt_c)

0 commit comments

Comments
 (0)