Zig Version
0.16.0-dev.3061+9b1eaad13
Steps to Reproduce and Observed Behavior
on Darwin aarch64:
~/c/g/z/z/gna (master)> ./zig-aarch64-macos-0.16.0-dev.3061+9b1eaad13/zig build-lib -fcompiler-rt -fllvm ../gna.zig -femit-bin=gna.a
~/c/g/z/z/gna (master)> nm -m gna.a | grep ctz
00000000000004e0 (__TEXT,__text) private external ___ctzdi2
0000000000000578 (__TEXT,__text) private external ___ctzsi2
0000000000000410 (__TEXT,__text) private external ___ctzti2
00000000000004e0 (__TEXT,__text) non-external _compiler_rt.count0bits.__ctzdi2
0000000000000578 (__TEXT,__text) non-external _compiler_rt.count0bits.__ctzsi2
0000000000000410 (__TEXT,__text) non-external _compiler_rt.count0bits.__ctzti2
Previously, symbols from compiler-rt were exported as WEAK as the code suggests:
pub inline fn symbol(comptime func: *const anyopaque, comptime name: []const u8) void {
@export(func, .{ .name = name, .linkage = linkage, .visibility = visibility });
}
....
pub const linkage: std.builtin.GlobalLinkage = if (builtin.is_test)
.internal
else if (ofmt_c)
.strong
else
.weak;
This is important for us as we have link against custom override of such symbols.
This seems to impact only darwin.
Expected Behavior
~/c/g/z/z/gna (master)> ./zig-aarch64-macos-0.16.0-dev.3041+3dc5f1398/zig build-lib -fcompiler-rt -fllvm ../gna.zig -femit-bin=gna.a
~/c/g/z/z/gna (master)> nm -m gna.a | grep ctz
00000000000004e0 (__TEXT,__text) weak private external ___ctzdi2
0000000000000578 (__TEXT,__text) weak private external ___ctzsi2
0000000000000410 (__TEXT,__text) weak private external ___ctzti2
As showed, the same command produced weak symbols on a prior nightly.
### Zig Version
0.16.0-dev.3061+9b1eaad13
### Steps to Reproduce and Observed Behavior
on Darwin aarch64:
```
~/c/g/z/z/gna (master)> ./zig-aarch64-macos-0.16.0-dev.3061+9b1eaad13/zig build-lib -fcompiler-rt -fllvm ../gna.zig -femit-bin=gna.a
~/c/g/z/z/gna (master)> nm -m gna.a | grep ctz
00000000000004e0 (__TEXT,__text) private external ___ctzdi2
0000000000000578 (__TEXT,__text) private external ___ctzsi2
0000000000000410 (__TEXT,__text) private external ___ctzti2
00000000000004e0 (__TEXT,__text) non-external _compiler_rt.count0bits.__ctzdi2
0000000000000578 (__TEXT,__text) non-external _compiler_rt.count0bits.__ctzsi2
0000000000000410 (__TEXT,__text) non-external _compiler_rt.count0bits.__ctzti2
```
Previously, symbols from compiler-rt were exported as WEAK as the code suggests:
```
pub inline fn symbol(comptime func: *const anyopaque, comptime name: []const u8) void {
@export(func, .{ .name = name, .linkage = linkage, .visibility = visibility });
}
....
pub const linkage: std.builtin.GlobalLinkage = if (builtin.is_test)
.internal
else if (ofmt_c)
.strong
else
.weak;
```
This is important for us as we have link against custom override of such symbols.
This seems to impact only darwin.
### Expected Behavior
```
~/c/g/z/z/gna (master)> ./zig-aarch64-macos-0.16.0-dev.3041+3dc5f1398/zig build-lib -fcompiler-rt -fllvm ../gna.zig -femit-bin=gna.a
~/c/g/z/z/gna (master)> nm -m gna.a | grep ctz
00000000000004e0 (__TEXT,__text) weak private external ___ctzdi2
0000000000000578 (__TEXT,__text) weak private external ___ctzsi2
0000000000000410 (__TEXT,__text) weak private external ___ctzti2
```
As showed, the same command produced weak symbols on a prior nightly.