zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 666e8799251452f74ca97b4a6a930c7b3d0ce553 (tree)
parent a71bfc249d3f814d7d659fe5cf4cb582483e8938
Author: Shritesh Bhattarai <shritesh@shritesh.com>
Date:   Wed, 10 Apr 2019 17:14:44 -0500

Build compiler_rt for WASM exe

Diffstat:
Msrc/link.cpp | 10++++++++++
1 file changed, 10 insertions(+), 0 deletions(-)

diff --git a/src/link.cpp b/src/link.cpp @@ -1101,6 +1101,16 @@ static void construct_linker_job_wasm(LinkJob *lj) { for (size_t i = 0; i < g->link_objects.length; i += 1) { lj->args.append((const char *)buf_ptr(g->link_objects.at(i))); } + + if (g->out_type == OutTypeExe) { + if (g->libc_link_lib == nullptr) { + Buf *builtin_a_path = build_a(g, "builtin"); + lj->args.append(buf_ptr(builtin_a_path)); + } + + Buf *compiler_rt_o_path = build_compiler_rt(g); + lj->args.append(buf_ptr(compiler_rt_o_path)); + } } static void coff_append_machine_arg(CodeGen *g, ZigList<const char *> *list) {