diff options
author | Richard Musiol <mail@richard-musiol.de> | 2021-10-24 12:28:18 +0200 |
---|---|---|
committer | Dmitri Shuralyov <dmitshur@golang.org> | 2021-10-28 18:01:34 +0000 |
commit | 18b970277e8516abcdfd18be76f02d3bd74919dc (patch) | |
tree | 87cbafb3b28cb06e1c149583d17315114f4ab179 /misc | |
parent | 91aa2f190aa07addb964afa48f98466bdb1a8556 (diff) | |
download | go-18b970277e8516abcdfd18be76f02d3bd74919dc.tar.gz go-18b970277e8516abcdfd18be76f02d3bd74919dc.zip |
[release-branch.go1.17] cmd/link: increase reserved space for passing env on wasm
On wasm, the wasm_exec.js helper passes the command line arguments and
environment variables via a reserved space in the wasm linear memory.
Increase this reserved space from 4096 to 8192 bytes so more environment
variables can fit into the limit.
Later, after https://golang.org/cl/350737 landed, we can switch to the
WASI interface for getting the arguments and environment. This would
remove the limit entirely.
Updates #49011.
Fixes #49154.
Change-Id: I48a6e952a97d33404ed692c98e9b49c5cd6b269b
Reviewed-on: https://go-review.googlesource.com/c/go/+/358194
Trust: Richard Musiol <neelance@gmail.com>
Run-TryBot: Richard Musiol <neelance@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
(cherry picked from commit 252324e879e32f948d885f787decf8af06f82be9)
Reviewed-on: https://go-review.googlesource.com/c/go/+/359399
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Diffstat (limited to 'misc')
-rw-r--r-- | misc/wasm/wasm_exec.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/misc/wasm/wasm_exec.js b/misc/wasm/wasm_exec.js index df7a6b848f..5651141f44 100644 --- a/misc/wasm/wasm_exec.js +++ b/misc/wasm/wasm_exec.js @@ -569,9 +569,9 @@ // The linker guarantees global data starts from at least wasmMinDataAddr. // Keep in sync with cmd/link/internal/ld/data.go:wasmMinDataAddr. - const wasmMinDataAddr = 4096 + 4096; + const wasmMinDataAddr = 4096 + 8192; if (offset >= wasmMinDataAddr) { - throw new Error("command line too long"); + throw new Error("total length of command line and environment variables exceeds limit"); } this._inst.exports.run(argc, argv); |