Skip to content

[mono] Compile runtime with MBR support by default on Android and Browser #47785

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
merged 3 commits into from
Feb 4, 2021
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
4 changes: 4 additions & 0 deletions src/mono/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") OR(CMAKE_CXX_COMPILER_ID STREQUAL "Cla
set(GCC 1)
endif()

if(DISABLE_INTERPRETER)
unset(ENABLE_METADATA_UPDATE)
endif()

add_definitions(-DHAVE_CONFIG_H)
add_definitions(-DMONO_DLL_EXPORT)

Expand Down
7 changes: 7 additions & 0 deletions src/mono/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,11 @@
<AndroidTestRunnerProjDirectory>$([MSBuild]::NormalizeDirectory('$(LibrariesProjectRoot)', 'Common', tests, 'AndroidTestRunner'))</AndroidTestRunnerProjDirectory>
<MonoAOTCompilerProjDirectory>$([MSBuild]::NormalizeDirectory('$(RepoTasksDir)', 'AotCompilerTask'))</MonoAOTCompilerProjDirectory>
</PropertyGroup>

<!-- Feature defaults for mono.proj and System.Private.CoreLib.csproj -->
<PropertyGroup>
<!-- default metadata update support for specific platforms -->
<MonoMetadataUpdate Condition="'$(MonoMetadataUpdate)' == '' and ('$(TargetsAndroid)' == 'true' or '$(TargetsBrowser)' == 'true')">true</MonoMetadataUpdate>
<MonoMetadataUpdate Condition="'$(MonoMetadataUpdate)' == ''">false</MonoMetadataUpdate>
</PropertyGroup>
</Project>
8 changes: 3 additions & 5 deletions src/mono/mono.proj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
- MonoAOTEnableLLVM - enable LLVM for an AOT-only Mono
- MonoAOTLLVMDir - [optional] the directory where LLVM is located, for an AOT-only Mono
- MonoVerboseBuild - enable verbose build
- MonoMetadataUpdate - enable experimental method body replacement code
- MonoMetadataUpdate - enable experimental method body replacement code (in Directory.Build.props)
- MonoThreadSuspend - coop,hybrid,preemptive - default thread suspend mode
-->

Expand Down Expand Up @@ -321,9 +321,8 @@
<_MonoAOTCXXFLAGS Include="-Wl,--build-id=sha1" />
</ItemGroup>

<!-- Experimental features -->
<!-- Devloop features -->
<ItemGroup Condition="'$(MonoMetadataUpdate)' == 'true'">
<!-- FIXME: Add sanity check that the interpreter is enabled -->
<_MonoCMakeArgs Include="-DENABLE_METADATA_UPDATE=1" />
</ItemGroup>

Expand Down Expand Up @@ -442,8 +441,7 @@
<MonoAOTCMakeArgs Condition="'$(MonoAOTEnableLLVM)' == 'true'" Include="-DLLVM_PREFIX=$(MonoAOTLLVMDir)" />
<MonoAOTCMakeArgs Include="$(_MonoAOTCFLAGSOption)" />
<MonoAOTCMakeArgs Include="$(_MonoAOTCXXFLAGSOption)" />
<!-- Experimental features -->
<!-- FIXME: Add sanity check that the interpreter is enabled -->
<!-- Devloop features -->
<MonoAOTCMakeArgs Condition="'$(MonoMetadataUpdate)' == 'true'" Include="-DENABLE_METADATA_UPDATE=1" />

<!-- thread suspend -->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<!-- Generate Mono corelib version file -->
<Import Project="GenerateMonoCoreLibVersionFile.targets" />

Expand Down
5 changes: 5 additions & 0 deletions src/mono/wasm/wasm.proj
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@
<WasmEnableMetadataUpdate Condition="'$(MonoMetadataUpdate)' == 'true'">true</WasmEnableMetadataUpdate>
</PropertyGroup>

<PropertyGroup>
<!-- TODO: set to "false" for publishing/production builds -->
<MonoMetadataUpdate Condition="'$(MonoMetadataUpdate)' == ''">true</MonoMetadataUpdate>
</PropertyGroup>

<Target Name="CheckEnv">
<Error Condition="'$(TargetArchitecture)' != 'wasm'" Text="Expected TargetArchitecture==wasm, got '$(TargetArchitecture)'"/>
<Error Condition="'$(TargetOS)' != 'Browser'" Text="Expected TargetOS==Browser, got '$(TargetOS)'"/>
Expand Down