Skip to content

[NativeAOT-LLVM] Enhance unresolved symbol handling #3118

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion eng/pipelines/runtimelab/install-emscripten.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,16 @@ git checkout ca7b40ae222a2d8763b6ac845388744b0e57cfb7
./emsdk install 3.1.56
./emsdk activate 3.1.56


if ($CI)
{
Write-Host "Setting EMSDK to '$InstallDir/emsdk'"
Write-Output "##vso[task.setvariable variable=EMSDK]$InstallDir/emsdk"

if ($env:EMSDK_PYTHON)
{
# Workaround for https://github.com/dotnet/runtime/issues/116746
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I don't actually know if this actually works, but it seems to have helped. The idea here was that the CI build is picking up system python instead of the emsdk bundled python, and that has some issues.)

Write-Host "Setting EMSDK_PYTHON to '$env:EMSDK_PYTHON'"
Write-Output "##vso[task.setvariable variable=EMSDK_PYTHON]$env:EMSDK_PYTHON"
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -598,9 +598,9 @@ The .NET Foundation licenses this file to you under the MIT license.
<CustomLinkerArg Condition="'$(WasmHtmlTemplate)' != ''" Include="--shell-file &quot;$(WasmHtmlTemplate)&quot;" />
<CustomLinkerArg Condition="'$(ExportsFile)' != '' and '$([System.IO.File]::ReadAllText($(ExportsFile)))' != ''" Include="-s EXPORTED_FUNCTIONS=@&quot;$(ExportsFile)&quot;" />
<CustomLinkerArg Include="-s ALLOW_MEMORY_GROWTH=1" />
<CustomLinkerArg Include="-s ERROR_ON_UNDEFINED_SYMBOLS=0" />
<CustomLinkerArg Include="-s GLOBAL_BASE=$(IlcWasmGlobalBase)" />
<CustomLinkerArg Include="-s TOTAL_STACK=$(IlcWasmStackSize)" />
<CustomLinkerArg Include="-s ERROR_ON_UNDEFINED_SYMBOLS=0" Condition="'$(IlcTreatWarningsAsErrors)' != 'true'" />
<CustomLinkerArg Condition="'$(WasmEnableJSBigIntIntegration)' == 'true'" Include="-s WASM_BIGINT=1" />
<CustomLinkerArg Condition="'$(IlcLlvmExceptionHandlingModel)' == 'cpp'" Include="-s DISABLE_EXCEPTION_CATCHING=0" />

Expand All @@ -612,18 +612,17 @@ The .NET Foundation licenses this file to you under the MIT license.

<!-- wasm-ld only supports listing exports on the command line -->
<ReadLinesFromFile File="$(ExportsFile)" Condition="'$(_targetOS)' == 'wasi' and '$(ExportsFile)' != ''">
<Output TaskParameter="Lines" ItemName="CustomLinkerArgExport" />
<Output TaskParameter="Lines" ItemName="_CustomLinkerArgExport" />
</ReadLinesFromFile>

<ItemGroup Condition="'$(_targetOS)' == 'wasi'" >
<CustomLinkerArg Include="--sysroot=&quot;$(WASI_SDK_PATH.Replace(&quot;\&quot;, &quot;/&quot;))/share/wasi-sysroot&quot;" />
<CustomLinkerArg Include="@(CustomLinkerArgExport->'-Wl,--export=%(Identity)')" />
<!-- TODO-LLVM: change to 'warn-unresolved-symbols' once we have a WASI SDK with https://github.com/llvm/llvm-project/pull/78643. -->
<CustomLinkerArg Include="-Wl,--unresolved-symbols=ignore-all" />
<CustomLinkerArg Include="-lstdc++ -lwasi-emulated-process-clocks -lwasi-emulated-signal -lwasi-emulated-getpid" />
<CustomLinkerArg Include="@(_CustomLinkerArgExport->'-Wl,--export=%(Identity)')" />
<CustomLinkerArg Include="-lstdc++;-lwasi-emulated-process-clocks;-lwasi-emulated-signal;-lwasi-emulated-mman;-lwasi-emulated-getpid" />
<CustomLinkerArg Include="-Wl,--max-memory=2147483648" />
<CustomLinkerArg Include="-Wl,--global-base=$(IlcWasmGlobalBase)" />
<CustomLinkerArg Include="-Wl,-z,stack-size=$(IlcWasmStackSize)" />
<CustomLinkerArg Include="-Wl,--warn-unresolved-symbols" />
<CustomLinkerArg Include="-Wl,--fatal-warnings" Condition="'$(IlcTreatWarningsAsErrors)' == 'true'" />
<CustomLinkerArg Include="-mexec-model=reactor" Condition="'$(NativeLib)' == 'Shared'" />
</ItemGroup>

Expand Down