std: remove hack in test step

This hack was initially introduced as we would export all symbols
unconditionally, including non-function definitions. This would cause
an error from the Wasmtime runtime engine, which this flag would
suppress. As we now properly export symbols, this flag is no longer
needed and any user running into this error can manually include it.

This commit also adds the `--import-symbols` ability to build.zig
This commit is contained in:
Luuk de Gram 2022-12-28 14:59:53 +01:00
parent 30f2bb8464
commit 4bffe645c6
No known key found for this signature in database
GPG Key ID: A8CFE58E4DC7D664

View File

@ -74,6 +74,9 @@ disable_sanitize_c: bool,
sanitize_thread: bool,
rdynamic: bool,
import_memory: bool = false,
/// For WebAssembly targets, this will allow for undefined symbols to
/// be imported from the host environment.
import_symbols: bool = false,
import_table: bool = false,
export_table: bool = false,
initial_memory: ?u64 = null,
@ -1458,6 +1461,9 @@ fn make(step: *Step) !void {
if (self.import_memory) {
try zig_args.append("--import-memory");
}
if (self.import_symbols) {
try zig_args.append("--import-symbols");
}
if (self.import_table) {
try zig_args.append("--import-table");
}
@ -1609,8 +1615,6 @@ fn make(step: *Step) !void {
try zig_args.append(bin_name);
try zig_args.append("--test-cmd");
try zig_args.append("--dir=.");
try zig_args.append("--test-cmd");
try zig_args.append("--allow-unknown-exports"); // TODO: Remove when stage2 is default compiler
try zig_args.append("--test-cmd-bin");
} else {
try zig_args.append("--test-no-exec");