diff options
| author | Alex Rønne Petersen <alex@alexrp.com> | 2024-12-09 10:46:56 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-09 10:46:56 +0100 |
| commit | 7cd2c1ce8770ccd3bb5a9d9c79baf4d0013ab0c8 (patch) | |
| tree | 54d5a06f7c71e3e8c2d2564c21d022752467fb63 /src | |
| parent | 589f4e91708366ddff9ee6793d5f88b05a260959 (diff) | |
| parent | c9e74bb9aa6d17993e3c8e922963601a00b405bc (diff) | |
| download | zig-7cd2c1ce8770ccd3bb5a9d9c79baf4d0013ab0c8.tar.gz zig-7cd2c1ce8770ccd3bb5a9d9c79baf4d0013ab0c8.zip | |
Merge pull request #22191 from alexrp/wasi-libc-names
`std.zig.target`: Teach `isLibCLibName()` about emulated wasi-libc libraries
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.zig | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/main.zig b/src/main.zig index cf2d37d086..d3a0b4cdef 100644 --- a/src/main.zig +++ b/src/main.zig @@ -3824,6 +3824,15 @@ fn createModule( for (create_module.cli_link_inputs.items) |cli_link_input| switch (cli_link_input) { .name_query => |nq| { const lib_name = nq.name; + + if (target.os.tag == .wasi) { + if (wasi_libc.getEmulatedLibCrtFile(lib_name)) |crt_file| { + try create_module.wasi_emulated_libs.append(arena, crt_file); + create_module.opts.link_libc = true; + continue; + } + } + if (std.zig.target.isLibCLibName(target, lib_name)) { create_module.opts.link_libc = true; continue; @@ -3832,6 +3841,7 @@ fn createModule( create_module.opts.link_libcpp = true; continue; } + switch (target_util.classifyCompilerRtLibName(lib_name)) { .none => {}, .only_libunwind, .both => { @@ -3857,12 +3867,6 @@ fn createModule( fatal("cannot use absolute path as a system library: {s}", .{lib_name}); } - if (target.os.tag == .wasi) { - if (wasi_libc.getEmulatedLibCrtFile(lib_name)) |crt_file| { - try create_module.wasi_emulated_libs.append(arena, crt_file); - continue; - } - } unresolved_link_inputs.appendAssumeCapacity(cli_link_input); any_name_queries_remaining = true; }, |
