| author | |
| committer | |
| log | 37a34b54afee183f397cf708ac8d074fa7cc92d6 |
| tree | 87343a9fd1de152ca6448f6a09ea0eb71e5331d2 |
| parent | f8372d030e50b6eec50fd21a387b4d875f81a178 |
| signature |
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.2 files changed, 3 insertions(+), 3 deletions(-)
src/main.zig+1-1| ... | ... | @@ -3832,7 +3832,7 @@ fn createModule( |
| 3832 | 3832 | create_module.opts.link_libcpp = true; |
| 3833 | 3833 | continue; |
| 3834 | 3834 | } |
| 3835 | switch (target_util.classifyCompilerRtLibName(target, lib_name)) { | |
| 3835 | switch (target_util.classifyCompilerRtLibName(lib_name)) { | |
| 3836 | 3836 | .none => {}, |
| 3837 | 3837 | .only_libunwind, .both => { |
| 3838 | 3838 | create_module.opts.link_libunwind = true; |
src/target.zig+2-2| ... | ... | @@ -260,8 +260,8 @@ pub fn supportsReturnAddress(target: std.Target) bool { |
| 260 | 260 | |
| 261 | 261 | pub const CompilerRtClassification = enum { none, only_compiler_rt, only_libunwind, both }; |
| 262 | 262 | |
| 263 | pub fn classifyCompilerRtLibName(target: std.Target, name: []const u8) CompilerRtClassification { | |
| 264 | if (target.abi.isGnu() and std.mem.eql(u8, name, "gcc_s")) { | |
| 263 | pub fn classifyCompilerRtLibName(name: []const u8) CompilerRtClassification { | |
| 264 | if (std.mem.eql(u8, name, "gcc_s")) { | |
| 265 | 265 | // libgcc_s includes exception handling functions, so if linking this library |
| 266 | 266 | // is requested, zig needs to instead link libunwind. Otherwise we end up with |
| 267 | 267 | // the linker unable to find `_Unwind_RaiseException` and other related symbols. |