| ... | @@ -11,6 +11,8 @@ const native_os = builtin.os.tag; | ... | @@ -11,6 +11,8 @@ const native_os = builtin.os.tag; |
| 11 | const native_arch = builtin.cpu.arch; | 11 | const native_arch = builtin.cpu.arch; |
| 12 | const native_abi = builtin.abi; | 12 | const native_abi = builtin.abi; |
| 13 | | 13 | |
| | 14 | const linkage: std.builtin.GlobalLinkage = if (builtin.is_test) .internal else .strong; |
| | 15 | |
| 14 | const is_wasm = switch (native_arch) { | 16 | const is_wasm = switch (native_arch) { |
| 15 | .wasm32, .wasm64 => true, | 17 | .wasm32, .wasm64 => true, |
| 16 | else => false, | 18 | else => false, |
| ... | @@ -30,14 +32,14 @@ comptime { | ... | @@ -30,14 +32,14 @@ comptime { |
| 30 | } | 32 | } |
| 31 | | 33 | |
| 32 | if (builtin.link_libc) { | 34 | if (builtin.link_libc) { |
| 33 | @export(&strcmp, .{ .name = "strcmp", .linkage = .strong }); | 35 | @export(&strcmp, .{ .name = "strcmp", .linkage = linkage }); |
| 34 | @export(&strncmp, .{ .name = "strncmp", .linkage = .strong }); | 36 | @export(&strncmp, .{ .name = "strncmp", .linkage = linkage }); |
| 35 | @export(&strerror, .{ .name = "strerror", .linkage = .strong }); | 37 | @export(&strerror, .{ .name = "strerror", .linkage = linkage }); |
| 36 | @export(&strlen, .{ .name = "strlen", .linkage = .strong }); | 38 | @export(&strlen, .{ .name = "strlen", .linkage = linkage }); |
| 37 | @export(&strcpy, .{ .name = "strcpy", .linkage = .strong }); | 39 | @export(&strcpy, .{ .name = "strcpy", .linkage = linkage }); |
| 38 | @export(&strncpy, .{ .name = "strncpy", .linkage = .strong }); | 40 | @export(&strncpy, .{ .name = "strncpy", .linkage = linkage }); |
| 39 | @export(&strcat, .{ .name = "strcat", .linkage = .strong }); | 41 | @export(&strcat, .{ .name = "strcat", .linkage = linkage }); |
| 40 | @export(&strncat, .{ .name = "strncat", .linkage = .strong }); | 42 | @export(&strncat, .{ .name = "strncat", .linkage = linkage }); |
| 41 | } | 43 | } |
| 42 | } | 44 | } |
| 43 | | 45 | |