mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-07 04:23:41 +00:00
feature: add buildmode=wasi-legacy to support existing base of users who expected the
older behavior for wasi modules to not return an exit code as if they were reactors. See #4726 for some details on what this is intended to address. Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
@@ -672,6 +672,16 @@ func Build(pkgName, outpath, tmpdir string, config *compileopts.Config) (BuildRe
|
||||
ldflags = append(ldflags, "--no-entry")
|
||||
}
|
||||
|
||||
if config.Options.BuildMode == "wasi-legacy" {
|
||||
if !strings.HasPrefix(config.Triple(), "wasm32-") {
|
||||
return result, fmt.Errorf("buildmode wasi-legacy is only supported on wasm")
|
||||
}
|
||||
|
||||
if config.Options.Scheduler != "none" {
|
||||
return result, fmt.Errorf("buildmode wasi-legacy only supports scheduler=none")
|
||||
}
|
||||
}
|
||||
|
||||
// Add compiler-rt dependency if needed. Usually this is a simple load from
|
||||
// a cache.
|
||||
if config.Target.RTLib == "compiler-rt" {
|
||||
|
||||
Reference in New Issue
Block a user