diff options
| author | Alex Rønne Petersen <alex@alexrp.com> | 2025-07-06 20:05:18 +0200 |
|---|---|---|
| committer | Alex Rønne Petersen <alex@alexrp.com> | 2025-07-06 20:05:18 +0200 |
| commit | 1f1082e36d3bf9cda4e61cae223e9903ae6fc4ce (patch) | |
| tree | 0a2e45cda56056abd36b299ccb5bb52763d7d73f /src/Compilation.zig | |
| parent | b461d07a5464aec86c533434dab0b58edfffb331 (diff) | |
| download | zig-1f1082e36d3bf9cda4e61cae223e9903ae6fc4ce.tar.gz zig-1f1082e36d3bf9cda4e61cae223e9903ae6fc4ce.zip | |
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.
Diffstat (limited to 'src/Compilation.zig')
| -rw-r--r-- | src/Compilation.zig | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig index c890fd1925..c954fc76bc 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -234,7 +234,6 @@ fuzzer_lib: ?CrtFile = null, glibc_so_files: ?glibc.BuiltSharedObjects = null, freebsd_so_files: ?freebsd.BuiltSharedObjects = null, netbsd_so_files: ?netbsd.BuiltSharedObjects = null, -wasi_emulated_libs: []const wasi_libc.CrtFile, /// For example `Scrt1.o` and `libc_nonshared.a`. These are populated after building libc from source, /// The set of needed CRT (C runtime) files differs depending on the target and compilation settings. @@ -1567,12 +1566,6 @@ pub const CreateOptions = struct { framework_dirs: []const []const u8 = &[0][]const u8{}, frameworks: []const Framework = &.{}, windows_lib_names: []const []const u8 = &.{}, - /// These correspond to the WASI libc emulated subcomponents including: - /// * process clocks - /// * getpid - /// * mman - /// * signal - wasi_emulated_libs: []const wasi_libc.CrtFile = &.{}, /// This means that if the output mode is an executable it will be a /// Position Independent Executable. If the output mode is not an /// executable this field is ignored. @@ -2055,7 +2048,6 @@ pub fn create(gpa: Allocator, arena: Allocator, options: CreateOptions) !*Compil .function_sections = options.function_sections, .data_sections = options.data_sections, .native_system_include_paths = options.native_system_include_paths, - .wasi_emulated_libs = options.wasi_emulated_libs, .force_undefined_symbols = options.force_undefined_symbols, .link_eh_frame_hdr = link_eh_frame_hdr, .global_cc_argv = options.global_cc_argv, @@ -2384,11 +2376,6 @@ pub fn create(gpa: Allocator, arena: Allocator, options: CreateOptions) !*Compil } else if (target.isWasiLibC()) { if (!std.zig.target.canBuildLibC(target)) return error.LibCUnavailable; - for (comp.wasi_emulated_libs) |crt_file| { - comp.queued_jobs.wasi_libc_crt_file[@intFromEnum(crt_file)] = true; - } - comp.link_task_queue.pending_prelink_tasks += @intCast(comp.wasi_emulated_libs.len); - comp.queued_jobs.wasi_libc_crt_file[@intFromEnum(wasi_libc.execModelCrtFile(comp.config.wasi_exec_model))] = true; comp.queued_jobs.wasi_libc_crt_file[@intFromEnum(wasi_libc.CrtFile.libc_a)] = true; comp.link_task_queue.pending_prelink_tasks += 2; |
