diff options
| author | Benjamin Feng <benjamin.feng@glassdoor.com> | 2019-04-27 09:52:58 -0500 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-05-03 13:23:02 -0400 |
| commit | 8d58dc715b334c1e842e8c97fd345b561ef77fb8 (patch) | |
| tree | 909b96ea4095bad43ccbc3747c4c017ba8849b8f /src/link.cpp | |
| parent | fca3e3a73f157d93ae3d57f90c13512acfbe9aa4 (diff) | |
| download | zig-8d58dc715b334c1e842e8c97fd345b561ef77fb8.tar.gz zig-8d58dc715b334c1e842e8c97fd345b561ef77fb8.zip | |
Switch wasm export-all to only values marked exports
Diffstat (limited to 'src/link.cpp')
| -rw-r--r-- | src/link.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/link.cpp b/src/link.cpp index bd1587b459..385b28b71e 100644 --- a/src/link.cpp +++ b/src/link.cpp @@ -1096,10 +1096,16 @@ static void construct_linker_job_wasm(LinkJob *lj) { lj->args.append("--no-entry"); // So lld doesn't look for _start. } lj->args.append("--allow-undefined"); - lj->args.append("--export-all"); lj->args.append("-o"); lj->args.append(buf_ptr(&g->output_file_path)); + auto export_it = g->exported_symbol_names.entry_iterator(); + decltype(g->exported_symbol_names)::Entry *curr_entry = nullptr; + while ((curr_entry = export_it.next()) != nullptr) { + Buf *arg = buf_sprintf("--export=%s", buf_ptr(curr_entry->key)); + lj->args.append(buf_ptr(arg)); + } + // .o files for (size_t i = 0; i < g->link_objects.length; i += 1) { lj->args.append((const char *)buf_ptr(g->link_objects.at(i))); |
