-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
[wasm] Fix debug build of AOT cross compiler #50418
[wasm] Fix debug build of AOT cross compiler #50418
Conversation
For mono AOT cross compiler we use llvm libraries from `runtime.win-x64.microsoft.netcore.runtime.mono.llvm.sdk` package. These are built in Release configuration. On windows we get linker errors when mixing them with obj files compiled with debug flags. To avoid that, build the AOT cross compiler always as in Release configuration. Example of the errors: LLVMSupport.lib(Unicode.cpp.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in monosgen-2.0.lib(mini-llvm-cpp.cpp.obj) LLVMSupport.lib(Unicode.cpp.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MTd_StaticDebug' in monosgen-2.0.lib(mini-llvm-cpp.cpp.obj)
Tagging subscribers to 'arch-wasm': @lewing Issue DetailsFor the mono AOT cross compiler we use llvm libraries To avoid that, build the AOT cross compiler always as in Release Example of the errors:
|
@@ -468,6 +468,7 @@ | |||
<MonoLibClang Condition="$([MSBuild]::IsOSPlatform('Linux'))">$(EMSDK_PATH)/upstream/lib/libclang.so</MonoLibClang> | |||
<MonoLibClang Condition="$([MSBuild]::IsOSPlatform('Windows'))">$([MSBuild]::NormalizePath('$(EMSDK_PATH)', 'upstream', 'bin', 'libclang.dll'))</MonoLibClang> | |||
<PythonCmd Condition="'$(OS)' == 'Windows_NT'">call "$([MSBuild]::NormalizePath('$(EMSDK_PATH)', 'emsdk_env.bat'))" && python</PythonCmd> | |||
<_ForceRelease Condition="$([MSBuild]::IsOSPlatform('Windows')) and '$(TargetArchitecture)' == 'wasm' and '$(Configuration)' == 'Debug'">true</_ForceRelease> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this needed for !wasm too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure, so didn't want to break anything and limited it to wasm.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine to me, seems to do what it says. I don't know whether the same behavior is required for !wasm too, but should be fine for this PR.
* upstream/main: (568 commits) [wasm] Set __DistroRid on Windows to browser-wasm (dotnet#50842) [wasm] Fix order of include paths, to have the obj dir first (dotnet#50303) [wasm] Fix debug build of AOT cross compiler (dotnet#50418) Fix outdated comment (dotnet#50834) [wasm][tests] Add properties to allow passing args to xharness (dotnet#50678) Vectorized common String.Split() paths (dotnet#38001) Fix binplacing symbol files. (dotnet#50819) Move type check to after the null ref branch in out marshalling of blittable classes. (dotnet#50735) Remove extraneous CMake version requirement. (dotnet#50805) [wasm] Remove unncessary condition for EMSDK (dotnet#50810) Add loop alignment stats to JitLogCsv (dotnet#50624) Resolve ILLink warnings in System.Diagnostics.DiagnosticSource (dotnet#50265) Avoid unnecessary closures/delegates in Process (dotnet#50496) Fix for field layout verification across version bubble boundary (dotnet#50364) JIT: Enable CSE for VectorX.Create (dotnet#50644) [main] Update dependencies from mono/linker (dotnet#50779) [mono] More domain cleanup (dotnet#50771) Race condition in Mock reference tracker runtime with GC. (dotnet#50804) Remove IAssemblyName (and various fusion remnants) (dotnet#50755) Disable failing test for GCStress. (dotnet#50828) ...
For the mono AOT cross compiler we use llvm libraries
from
runtime.win-x64.microsoft.netcore.runtime.mono.llvm.sdk
package.These are built in Release configuration. On windows we get
linker errors when mixing them with obj files compiled with debug flags.
To avoid that, build the AOT cross compiler always as in Release
configuration.
Example of the errors: