authorgravatar for thejoshwolfe@gmail.comJosh Wolfe <thejoshwolfe@gmail.com> 2020-10-08 21:40:56-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-10-09 01:54:42-04:00
logbc6904eccc53da5b4de0728c8b52e6d0e9ed522e
treed0c47226ec210cfd956b0536acf94e3b65ef9051
parent1951ecb228d5eb9956ef4487e20be03d87a2153d

include compiler_rt and c for wasm static libraries


2 files changed, 5 insertions(+), 2 deletions(-)

src/Compilation.zig+4-1
......@@ -922,7 +922,10 @@ pub fn create(gpa: *Allocator, options: InitOptions) !*Compilation {
922922 try comp.work_queue.writeItem(.libcxx);
923923 try comp.work_queue.writeItem(.libcxxabi);
924924 }
925 if (is_exe_or_dyn_lib and build_options.is_stage1) {
925
926 const needs_compiler_rt_and_c = is_exe_or_dyn_lib or
927 (comp.getTarget().isWasm() and comp.bin_file.options.output_mode != .Obj);
928 if (needs_compiler_rt_and_c and build_options.is_stage1) {
926929 try comp.work_queue.writeItem(.{ .libcompiler_rt = {} });
927930 if (!comp.bin_file.options.link_libc) {
928931 try comp.work_queue.writeItem(.{ .zig_libc = {} });
src/link/Wasm.zig+1-1
......@@ -374,7 +374,7 @@ fn linkWithLLD(self: *Wasm, comp: *Compilation) !void {
374374 try argv.append(p);
375375 }
376376
377 if (self.base.options.output_mode == .Exe and !self.base.options.is_compiler_rt_or_libc) {
377 if (self.base.options.output_mode != .Obj and !self.base.options.is_compiler_rt_or_libc) {
378378 if (!self.base.options.link_libc) {
379379 try argv.append(comp.libc_static_lib.?.full_object_path);
380380 }