authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-12-06 14:00:49+01:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-12-06 14:51:22+01:00
logf8372d030e50b6eec50fd21a387b4d875f81a178
tree231dfa77ed8dd0adb49535dbdfedf57860717a34
parentc9d6f8b5058ba0df3bf281a3be3a3570c2219754
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

compiler: Classify libatomic as an alias for compiler-rt.

This is a library that ships with GCC and provides fallback implementations of atomic intrinsics where necessary. Since we do the same in our compiler-rt implementation, and since some build systems insist on passing -latomic even for Clang (which zig cc masquerades as), just satisfy this dependency by way of compiler-rt. Closes #22165.

1 files changed, 3 insertions(+), 1 deletions(-)

src/target.zig+3-1
...@@ -267,7 +267,9 @@ pub fn classifyCompilerRtLibName(target: std.Target, name: []const u8) CompilerR...@@ -267,7 +267,9 @@ pub fn classifyCompilerRtLibName(target: std.Target, name: []const u8) CompilerR
267 // the linker unable to find `_Unwind_RaiseException` and other related symbols.267 // the linker unable to find `_Unwind_RaiseException` and other related symbols.
268 return .both;268 return .both;
269 }269 }
270 if (std.mem.eql(u8, name, "compiler_rt")) {270 if (std.mem.eql(u8, name, "compiler_rt") or
271 std.mem.eql(u8, name, "atomic"))
272 {
271 return .only_compiler_rt;273 return .only_compiler_rt;
272 }274 }
273 if (std.mem.eql(u8, name, "unwind")) {275 if (std.mem.eql(u8, name, "unwind")) {