Skip to content

Commit ddfc834

Browse files
committed
simplify outline atomics
* Rely on libSystem when targeting macOS. * Make tools/gen_outline_atomics.zig more idiomatic. * Remove the CPU detection / auxval checking from compiler_rt. This functionality belongs in a different component. Zig's compiler_rt must not rely on constructors. Instead it will export a symbol for setting the value, and start code can detect and activate it. * Remove the separate logic for inline assembly when the target does or does not have lse support. `.inst` works in both cases.
1 parent 8004230 commit ddfc834

File tree

3 files changed

+875
-9266
lines changed

3 files changed

+875
-9266
lines changed

lib/compiler_rt.zig

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
1+
const builtin = @import("builtin");
2+
13
pub const panic = @import("compiler_rt/common.zig").panic;
24

35
comptime {
46
_ = @import("compiler_rt/atomics.zig");
5-
_ = @import("compiler_rt/lse_atomics.zig");
7+
8+
// macOS has these functions inside libSystem.
9+
if (builtin.cpu.arch.isAARCH64() and builtin.os.tag != .macos) {
10+
_ = @import("compiler_rt/lse_atomics.zig");
11+
}
612

713
_ = @import("compiler_rt/addf3.zig");
814
_ = @import("compiler_rt/addhf3.zig");

0 commit comments

Comments
 (0)