未验证 提交 5e957c47 编写于 作者: A Ankit Jain 提交者: GitHub

[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.
```
上级 01aaf1e1
......@@ -473,7 +473,23 @@
<Message Text="Compiling native assets with emcc. This may take a while ..." Importance="High" />
<Exec Command='emcc $(EmccCFlags) "%(_WasmObjectsToBuild.Identity)" -c -o "%(_WasmObjectsToBuild.OutputPath)"' EnvironmentVariables="@(EmscriptenEnvVars)" />
<Exec Command="emcc $(EmccLDFlags) @(_DotnetJSSrcFile->'--js-library &quot;%(Identity)&quot;', ' ') @(_BitcodeFile->'&quot;%(Identity)&quot;', ' ') @(_WasmObjects->'&quot;%(Identity)&quot;', ' ') -o &quot;$(_WasmIntermediateOutputPath)dotnet.js&quot;" EnvironmentVariables="@(EmscriptenEnvVars)" />
<ItemGroup>
<_EmccLinkerArguments Include="$(EmccLDFlags)" />
<_EmccLinkerArguments Include="--js-library &quot;%(_DotnetJSSrcFile.Identity)&quot;" />
<_EmccLinkerArguments Include="&quot;%(_BitcodeFile.Identity)&quot;" />
<_EmccLinkerArguments Include="&quot;%(_WasmObjects.Identity)&quot;" />
<_EmccLinkerArguments Include="-o &quot;$(_WasmIntermediateOutputPath)dotnet.js&quot;" />
</ItemGroup>
<PropertyGroup>
<_EmccLinkerResponseFile>$(_WasmIntermediateOutputPath)emcc-link.rsp</_EmccLinkerResponseFile>
</PropertyGroup>
<WriteLinesToFile Lines="@(_EmccLinkerArguments)" File="$(_EmccLinkerResponseFile)" />
<Message Text="Running emcc with @(_EmccLinkerArguments->'%(Identity)', ' ')" Importance="Low" />
<Exec Command="emcc &quot;@$(_EmccLinkerResponseFile)&quot;" EnvironmentVariables="@(EmscriptenEnvVars)" />
<Exec Command='"$(_WasmOptCommand)" --strip-dwarf "$(_WasmIntermediateOutputPath)dotnet.wasm" -o "$(_WasmIntermediateOutputPath)dotnet.wasm"' Condition="'$(WasmNativeStrip)' == 'true'" IgnoreStandardErrorWarningFormat="true" EnvironmentVariables="@(EmscriptenEnvVars)" />
<ItemGroup>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册