Skip to content
/ zig Public
forked from ziglang/zig

Commit

Permalink
compiler: Recognize libgcc_s regardless of target ABI.
Browse files Browse the repository at this point in the history
The real libgcc_s is a compiler-provided library; it works just fine with both
glibc and musl. There's no reason that I can see for this check to be limited to
glibc-based targets.
  • Loading branch information
alexrp committed Dec 6, 2024
1 parent f8372d0 commit 7e5f7dd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/target.zig
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ pub fn supportsReturnAddress(target: std.Target) bool {
pub const CompilerRtClassification = enum { none, only_compiler_rt, only_libunwind, both };

pub fn classifyCompilerRtLibName(target: std.Target, name: []const u8) CompilerRtClassification {
if (target.abi.isGnu() and std.mem.eql(u8, name, "gcc_s")) {
if (std.mem.eql(u8, name, "gcc_s")) {
// libgcc_s includes exception handling functions, so if linking this library
// is requested, zig needs to instead link libunwind. Otherwise we end up with
// the linker unable to find `_Unwind_RaiseException` and other related symbols.
Expand Down

0 comments on commit 7e5f7dd

Please sign in to comment.