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.
This commit is contained in:
13
src/main.zig
13
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;
|
||||
|
||||
Reference in New Issue
Block a user