-
Notifications
You must be signed in to change notification settings - Fork 528
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[monodroid] Build the Xamarin.Android runtime for net6 (#5665)
Context: dotnet/runtime#48416 Context: dotnet/runtime#44505 Context: #5537 Update the `src/monodroid` build system to build the native Xamarin.Android runtime libraries (e.g. `libmono-android.debug.so`) against the MonoVM shipped from the `dotnet/runtime` repository in the `Microsoft.NETCore.App.Runtime.*` NuGet packages. These NuGet packages also contain the header files needed to access and use MonoVM's embedding API. We thus ~double the number of libraries built by `src/monodroid`, with one set of builds against the "legacy" Mono, using Mono from the SDK archives, and another set of builds against .NET 6 MonoVM. This change requires the introduction of new target directories in `$(XAInstallPrefix)xbuild/Xamarin/Android/lib` (e.g. `bin/Debug/lib/xamarin.android/xbuild/Xamarin/Android/lib`): * `arm64-v8a-net6` * `armeabi-v7a-net6` * `x86_64-net6` * `x86-net6` These directories now contain only the shared libraries together comprising the Xamarin.Android native runtime libraries: * `libmono-android.*.so` * `libxamarin-debug-app-helper*.so` * `libxamarin-app.so` Mono runtime libraries are *not* copied from their respective NuGet packages; the .NET 6 NuGet packages are required to obtain them. Compared to the "legacy" builds, we are missing the libMonoPosixHelper.so` library. This helper lib will eventually be placed in a `Mono.Posix` NuGet, once we are able to separate `Mono.Posix` files from the Mono sources and place them in a [separate repository][0]. `xaprepare` is modified to generate MSBuild and cmake fragments responsible for building net6 runtime binaries. The `libmono-android.*.so` native libraries no longer need to export any entry points for P/Invoke purposes. Instead, the new `PINVOKE_OVERRIDE` [runtime property][1] is used to hook into the P/Invoke lookup process. This allows us to not only hide the public symbols, but also to remove the `libxa-internal-api.so` library (d583b7c) completely. [0]: https://github.com/mono/mono.posix [1]: https://docs.microsoft.com/en-us/dotnet/core/tutorials/netcore-hosting#step-3---prepare-runtime-properties
- Loading branch information
Showing
47 changed files
with
2,043 additions
and
249 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
xamarin/monodroid:main@2e93b630e47701dae56f426fe5934846d571832b | ||
xamarin/monodroid:main@dade1f497271f3ae5ceb1fe8c6c672b399a369ec | ||
mono/mono:2020-02@c66141a8c7ba2566c578c2dd012b2b723e006213 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ The attached notices are provided for information only. | |
2. bazelbuild/bazel (https://github.com/bazelbuild/bazel/) | ||
3. force-net/crc32.net (https://github.com/force-net/Crc32.NET) | ||
4. nunit/nunitlite (https://github.com/nunit/nunitlite/) | ||
5. tessil/robin-map (https://github.com/Tessil/robin-map) | ||
|
||
%% android/platform/tools/base NOTICES AND INFORMATION BEGIN HERE | ||
================================================================= | ||
|
@@ -487,3 +488,31 @@ THE SOFTWARE. | |
===================================================== | ||
END OF nunit/nunitlite NOTICES AND INFORMATION | ||
|
||
%% tessil/robin-map NOTICES AND INFORMATION BEGIN HERE | ||
====================================================== | ||
MIT License | ||
|
||
Copyright (c) 2017 Thibaut Goetghebuer-Planchon <[email protected]> | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
|
||
|
||
====================================================== | ||
END OF tessil/robin-map NOTICES AND INFORMATION | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
set(NETCORE_APP_RUNTIME_DIR_ARM "@NETCORE_APP_RUNTIME_ANDROID_ARM@") | ||
set(NETCORE_APP_RUNTIME_DIR_ARM64 "@NETCORE_APP_RUNTIME_ANDROID_ARM64@") | ||
set(NETCORE_APP_RUNTIME_DIR_X86 "@NETCORE_APP_RUNTIME_ANDROID_X86@") | ||
set(NETCORE_APP_RUNTIME_DIR_X86_64 "@NETCORE_APP_RUNTIME_ANDROID_X86_64@") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.