From 1f1082e36d3bf9cda4e61cae223e9903ae6fc4ce Mon Sep 17 00:00:00 2001 From: Alex Rønne Petersen Date: Sun, 6 Jul 2025 20:05:18 +0200 Subject: wasi: Build emulated libraries into libc.a This matches what we do for small helper libraries like this in MinGW-w64. It simplifies the compiler a bit, and also means the build system doesn't have to treat these library names specially. Closes #24325. --- src/main.zig | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'src/main.zig') diff --git a/src/main.zig b/src/main.zig index 0456122405..7b7d5be59a 100644 --- a/src/main.zig +++ b/src/main.zig @@ -972,8 +972,6 @@ fn buildOutputType( .windows_libs = .empty, .link_inputs = .empty, - .wasi_emulated_libs = .{}, - .c_source_files = .{}, .rc_source_files = .{}, @@ -3406,7 +3404,6 @@ fn buildOutputType( .framework_dirs = create_module.framework_dirs.items, .frameworks = resolved_frameworks.items, .windows_lib_names = create_module.windows_libs.keys(), - .wasi_emulated_libs = create_module.wasi_emulated_libs.items, .want_compiler_rt = want_compiler_rt, .want_ubsan_rt = want_ubsan_rt, .hash_style = hash_style, @@ -3687,8 +3684,6 @@ const CreateModule = struct { /// output. Allocated with gpa. link_inputs: std.ArrayListUnmanaged(link.Input), - wasi_emulated_libs: std.ArrayListUnmanaged(wasi_libc.CrtFile), - c_source_files: std.ArrayListUnmanaged(Compilation.CSourceFile), rc_source_files: std.ArrayListUnmanaged(Compilation.RcSourceFile), @@ -3819,14 +3814,6 @@ fn createModule( .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; -- cgit v1.2.3