From 5e957c471f2c2381453f08eb02b3e4b2f043cc4a Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Wed, 21 Apr 2021 19:46:16 -0400 Subject: [PATCH] [wasm] Use response files for `emcc` invocations (#51530) * [wasm] Use response files for `emcc` invocations This adds response file for the linker command line, which will be the longest one. And it uses a known name for the response file. In future, once we have dependency checking, we can use such response files for that too. Fixes #51437 . * [wasm] Emit emcc arguments, one per line in the rsp file Having the arguments one per line, also means that we don't have to quote the file paths. And it is more readable. * [wasm] Revert to quote file paths even in response file for emcc Suggested by Pranavkm: ``` .. their format does require whitespaces to be quoted: https://github.com/emscripten-core/emscripten/blob/main/tools/response_file.py#L16-L53. ``` --- src/mono/wasm/build/WasmApp.targets | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/mono/wasm/build/WasmApp.targets b/src/mono/wasm/build/WasmApp.targets index be9b8434fbc..a3854461b78 100644 --- a/src/mono/wasm/build/WasmApp.targets +++ b/src/mono/wasm/build/WasmApp.targets @@ -473,7 +473,23 @@ - + + + <_EmccLinkerArguments Include="$(EmccLDFlags)" /> + <_EmccLinkerArguments Include="--js-library "%(_DotnetJSSrcFile.Identity)"" /> + <_EmccLinkerArguments Include=""%(_BitcodeFile.Identity)"" /> + <_EmccLinkerArguments Include=""%(_WasmObjects.Identity)"" /> + <_EmccLinkerArguments Include="-o "$(_WasmIntermediateOutputPath)dotnet.js"" /> + + + + <_EmccLinkerResponseFile>$(_WasmIntermediateOutputPath)emcc-link.rsp + + + + + + -- GitLab