Skip to content

Commit 869677e

Browse files
radekdoulikmatouskozak
authored andcommitted
[wasm] Do not use link flags for bitcode compilation (dotnet#101397)
* [wasm] Do not use link flags for bitcode compilation This avoids errors like: /root/helix/work/correlation/build/wasm-shared/WasmApp.Common.targets(832,5): error : emcc: warning: linker setting ignored during compilation: 'EXPORT_ES6' [-Wunused-command-line-argument] [/root/helix/work/workitem/e/publish/ProxyProjectForAOTOnHelix.proj] /root/helix/work/correlation/build/wasm-shared/WasmApp.Common.targets(832,5): error : emcc: warning: linker setting ignored during compilation: 'EXPORT_EXCEPTION_HANDLING_HELPERS' [-Wunused-command-line-argument] [/root/helix/work/workitem/e/publish/ProxyProjectForAOTOnHelix.proj] * Rename _BitcodeLDFlags to _BitcodeCompileFlags Update the comment as well. _BitcodeLDFlags were used only for the BC compilation. This way we keep the possibility to add extra flags via EmccExtraBitcodeCompilationFlags and WasiClangExtraBitcodeCompileFlags.
1 parent 3085c59 commit 869677e

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/mono/browser/build/BrowserWasmApp.targets

+2-2
Original file line numberDiff line numberDiff line change
@@ -406,8 +406,8 @@
406406

407407
<Target Name="_BrowserWasmBeforeWriteCompileBitcodeRsp" BeforeTargets="_WasmWriteRspForCompilingBitcode">
408408
<ItemGroup>
409-
<_BitcodeLDFlags Include="@(_EmccLDFlags)" />
410-
<_BitcodeLDFlags Include="$(EmccExtraBitcodeLDFlags)" />
409+
<_BitcodeCompileFlags Include="@(_EmccCommonFlags)" />
410+
<_BitcodeCompileFlags Include="$(EmccExtraBitcodeCompilationFlags)" />
411411
</ItemGroup>
412412
</Target>
413413

src/mono/wasi/build/WasiApp.targets

+2-2
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,8 @@
265265
<!-- FIXME: merge with some other target -->
266266
<Target Name="_WasiBeforeWriteRspForCompilingBitcodeRsp" BeforeTargets="_WasmWriteRspForCompilingBitcode">
267267
<ItemGroup>
268-
<_BitcodeLDFlags Include="@(_WasiClangLDFlags)" />
269-
<_BitcodeLDFlags Include="$(WasiClangExtraBitcodeLDFlags)" />
268+
<_BitcodeCompileFlags Include="@(_WasiClangCommonFlags)" />
269+
<_BitcodeCompileFlags Include="$(WasiClangExtraBitcodeCompileFlags)" />
270270
</ItemGroup>
271271
</Target>
272272

src/mono/wasm/build/WasmApp.Common.targets

+2-2
Original file line numberDiff line numberDiff line change
@@ -800,11 +800,11 @@
800800
<Target Name="_WasmSelectRuntimeComponentsForLinking" Condition="'$(WasmIsWorkloadAvailable)' == 'true'" DependsOnTargets="_MonoSelectRuntimeComponents" />
801801

802802
<!--
803-
Inputs: @(_BitcodeLDFlags), $(_WasmCompileBitcodeRsp)
803+
Inputs: @(_BitcodeCompileFlags), $(_WasmCompileBitcodeRsp)
804804
Outputs: file @(_WasmCompileBitcodeRsp
805805
-->
806806
<Target Name="_WasmWriteRspForCompilingBitcode">
807-
<WriteLinesToFile Lines="@(_BitcodeLDFlags)" File="$(_WasmCompileBitcodeRsp)" Overwrite="true" WriteOnlyWhenDifferent="true" />
807+
<WriteLinesToFile Lines="@(_BitcodeCompileFlags)" File="$(_WasmCompileBitcodeRsp)" Overwrite="true" WriteOnlyWhenDifferent="true" />
808808
<ItemGroup>
809809
<FileWrites Include="$(_WasmCompileBitcodeRsp)" />
810810
</ItemGroup>

0 commit comments

Comments
 (0)