disallow non-global foreign import of variables on wasm

This commit is contained in:
Laytan Laats
2024-06-28 01:16:26 +02:00
parent ed7d34beb0
commit b79d7e6917
6 changed files with 9 additions and 10 deletions
+3 -1
View File
@@ -2053,10 +2053,12 @@ gb_internal void init_build_context(TargetMetrics *cross_target, Subtarget subta
gbString link_flags = gb_string_make(heap_allocator(), " ");
// link_flags = gb_string_appendc(link_flags, "--export-all ");
// link_flags = gb_string_appendc(link_flags, "--export-table ");
link_flags = gb_string_appendc(link_flags, "--allow-undefined ");
// if (bc->metrics.arch == TargetArch_wasm64) {
// link_flags = gb_string_appendc(link_flags, "-mwasm64 ");
// }
if (bc->metrics.os != TargetOs_orca) {
link_flags = gb_string_appendc(link_flags, "--allow-undefined ");
}
if (bc->no_entry_point || bc->metrics.os == TargetOs_orca) {
link_flags = gb_string_appendc(link_flags, "--no-entry ");
}