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:
Alex Rønne Petersen
2025-07-06 20:05:18 +02:00
parent b461d07a54
commit 1f1082e36d
4 changed files with 78 additions and 154 deletions

View File

@@ -1539,13 +1539,6 @@ fn wasmLink(lld: *Lld, arena: Allocator) !void {
if (comp.config.link_libc and is_exe_or_dyn_lib) {
if (target.os.tag == .wasi) {
for (comp.wasi_emulated_libs) |crt_file| {
try argv.append(try comp.crtFileAsString(
arena,
wasi_libc.emulatedLibCRFileLibName(crt_file),
));
}
try argv.append(try comp.crtFileAsString(
arena,
wasi_libc.execModelCrtFileFullName(comp.config.wasi_exec_model),