From 7e5f7dd50c6911143f46fd54b38abf9828d2730f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Fri, 6 Dec 2024 14:07:15 +0100 Subject: [PATCH] compiler: Recognize libgcc_s regardless of target ABI. 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. --- src/target.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/target.zig b/src/target.zig index ae3a8e7ecc5f..91d5d925ac20 100644 --- a/src/target.zig +++ b/src/target.zig @@ -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.