diff options
| author | Alex Rønne Petersen <alex@alexrp.com> | 2024-12-06 14:00:49 +0100 |
|---|---|---|
| committer | Alex Rønne Petersen <alex@alexrp.com> | 2024-12-06 14:51:22 +0100 |
| commit | f8372d030e50b6eec50fd21a387b4d875f81a178 (patch) | |
| tree | 231dfa77ed8dd0adb49535dbdfedf57860717a34 /src | |
| parent | c9d6f8b5058ba0df3bf281a3be3a3570c2219754 (diff) | |
| download | zig-f8372d030e50b6eec50fd21a387b4d875f81a178.tar.gz zig-f8372d030e50b6eec50fd21a387b4d875f81a178.zip | |
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/target.zig | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/target.zig b/src/target.zig index 6297d21bfc..ae3a8e7ecc 100644 --- a/src/target.zig +++ b/src/target.zig @@ -267,7 +267,9 @@ pub fn classifyCompilerRtLibName(target: std.Target, name: []const u8) CompilerR // the linker unable to find `_Unwind_RaiseException` and other related symbols. return .both; } - if (std.mem.eql(u8, name, "compiler_rt")) { + if (std.mem.eql(u8, name, "compiler_rt") or + std.mem.eql(u8, name, "atomic")) + { return .only_compiler_rt; } if (std.mem.eql(u8, name, "unwind")) { |
