From bc6904eccc53da5b4de0728c8b52e6d0e9ed522e Mon Sep 17 00:00:00 2001 From: Josh Wolfe Date: Thu, 8 Oct 2020 21:40:56 -0400 Subject: include compiler_rt and c for wasm static libraries --- src/Compilation.zig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/Compilation.zig') diff --git a/src/Compilation.zig b/src/Compilation.zig index 3e74df35af..e87233eb58 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -922,7 +922,10 @@ pub fn create(gpa: *Allocator, options: InitOptions) !*Compilation { try comp.work_queue.writeItem(.libcxx); try comp.work_queue.writeItem(.libcxxabi); } - if (is_exe_or_dyn_lib and build_options.is_stage1) { + + const needs_compiler_rt_and_c = is_exe_or_dyn_lib or + (comp.getTarget().isWasm() and comp.bin_file.options.output_mode != .Obj); + if (needs_compiler_rt_and_c and build_options.is_stage1) { try comp.work_queue.writeItem(.{ .libcompiler_rt = {} }); if (!comp.bin_file.options.link_libc) { try comp.work_queue.writeItem(.{ .zig_libc = {} }); -- cgit v1.2.3