aboutsummaryrefslogtreecommitdiff
path: root/lib/compiler_rt/stack_probe.zig
diff options
context:
space:
mode:
authorAlex Rønne Petersen <alex@alexrp.com>2025-05-18 22:20:55 +0200
committerAlex Rønne Petersen <alex@alexrp.com>2025-05-19 00:22:03 +0200
commit90fb2d97542e5a9fdb8ebf4fcc85b9f900dd3e66 (patch)
treed8e6ad0c00850624d0d819300fed3b73a98d9e80 /lib/compiler_rt/stack_probe.zig
parent092352ec63d3a4e9ff59a5d8ad8f119bf0eda468 (diff)
downloadzig-90fb2d97542e5a9fdb8ebf4fcc85b9f900dd3e66.tar.gz
zig-90fb2d97542e5a9fdb8ebf4fcc85b9f900dd3e66.zip
compiler-rt: Fix some exports to respect the common linkage and visibility.
Diffstat (limited to 'lib/compiler_rt/stack_probe.zig')
-rw-r--r--lib/compiler_rt/stack_probe.zig17
1 files changed, 8 insertions, 9 deletions
diff --git a/lib/compiler_rt/stack_probe.zig b/lib/compiler_rt/stack_probe.zig
index 31a0852832..c45946900a 100644
--- a/lib/compiler_rt/stack_probe.zig
+++ b/lib/compiler_rt/stack_probe.zig
@@ -1,28 +1,27 @@
const std = @import("std");
const builtin = @import("builtin");
+const common = @import("common.zig");
const os_tag = builtin.os.tag;
const arch = builtin.cpu.arch;
const abi = builtin.abi;
const is_test = builtin.is_test;
-const linkage: std.builtin.GlobalLinkage = if (builtin.is_test) .internal else .weak;
-const strong_linkage: std.builtin.GlobalLinkage = if (builtin.is_test) .internal else .strong;
-pub const panic = @import("common.zig").panic;
+pub const panic = common.panic;
comptime {
if (builtin.os.tag == .windows) {
// Default stack-probe functions emitted by LLVM
if (builtin.target.isMinGW()) {
- @export(&_chkstk, .{ .name = "_alloca", .linkage = linkage });
- @export(&___chkstk_ms, .{ .name = "___chkstk_ms", .linkage = linkage });
+ @export(&_chkstk, .{ .name = "_alloca", .linkage = common.linkage, .visibility = common.visibility });
+ @export(&___chkstk_ms, .{ .name = "___chkstk_ms", .linkage = common.linkage, .visibility = common.visibility });
if (arch == .thumb or arch == .aarch64) {
- @export(&__chkstk, .{ .name = "__chkstk", .linkage = linkage });
+ @export(&__chkstk, .{ .name = "__chkstk", .linkage = common.linkage, .visibility = common.visibility });
}
} else if (!builtin.link_libc) {
// This symbols are otherwise exported by MSVCRT.lib
- @export(&_chkstk, .{ .name = "_chkstk", .linkage = linkage });
- @export(&__chkstk, .{ .name = "__chkstk", .linkage = linkage });
+ @export(&_chkstk, .{ .name = "_chkstk", .linkage = common.linkage, .visibility = common.visibility });
+ @export(&__chkstk, .{ .name = "__chkstk", .linkage = common.linkage, .visibility = common.visibility });
}
}
@@ -30,7 +29,7 @@ comptime {
.x86,
.x86_64,
=> {
- @export(&zig_probe_stack, .{ .name = "__zig_probe_stack", .linkage = linkage });
+ @export(&zig_probe_stack, .{ .name = "__zig_probe_stack", .linkage = common.linkage, .visibility = common.visibility });
},
else => {},
}