-
Notifications
You must be signed in to change notification settings - Fork 564
Use new LLVM-based Xamarin.Android toolchain #6683
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
Conversation
76ee592 to
6989c5c
Compare
jonathanpeppers
left a comment
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.
Might check if this fixes: #6685
And add proj.AotAssemblies = true; to that test?
Will do once this run's done, I want to see if there are any obvious issues. |
|
Some tests fail with the following error message: This is because |
|
Mono/dotnet AOT PRs: |
47cdace to
c333cff
Compare
Context: dotnet#6683 (comment) Changes: mono/mono@a5d1934...148f536 * mono/mono@148f536b0b4 [2020-02] [AOT] Use .short directive instead of .hword (#21419) * mono/mono@a6f3e8f179a Avoid an assert in ves_icall_RuntimeFieldInfo_SetValueInternal (#21420) * mono/mono@3c4f3de377d Add correct InetAccess category to HttpClientTest.Proxy_Disabled test and disable Ping tests * mono/mono@9f35bf1b807 Add missing handle function enter/return macros (#21407) * mono/mono@45efaa3b6f9 [interp] Remove hack for nint/nfloat (#21395)
Context: dotnet#6683 (comment) Changes: mono/mono@a5d1934...148f536 * mono/mono@148f536b0b4 [2020-02] [AOT] Use .short directive instead of .hword (#21419) * mono/mono@a6f3e8f179a Avoid an assert in ves_icall_RuntimeFieldInfo_SetValueInternal (#21420) * mono/mono@3c4f3de377d Add correct InetAccess category to HttpClientTest.Proxy_Disabled test and disable Ping tests * mono/mono@9f35bf1b807 Add missing handle function enter/return macros (#21407) * mono/mono@45efaa3b6f9 [interp] Remove hack for nint/nfloat (#21395)
Context: dotnet#6683 (comment) Changes: mono/mono@a5d1934...148f536 * mono/mono@148f536b0b4 [2020-02] [AOT] Use .short directive instead of .hword (#21419) * mono/mono@a6f3e8f179a Avoid an assert in ves_icall_RuntimeFieldInfo_SetValueInternal (#21420) * mono/mono@3c4f3de377d Add correct InetAccess category to HttpClientTest.Proxy_Disabled test and disable Ping tests * mono/mono@9f35bf1b807 Add missing handle function enter/return macros (#21407) * mono/mono@45efaa3b6f9 [interp] Remove hack for nint/nfloat (#21395)
Context: #6683 (comment) Changes: mono/mono@a5d1934...148f536 * mono/mono@148f536b0b4: [2020-02] [AOT] Use .short directive instead of .hword (#21419) * mono/mono@a6f3e8f179a: Avoid an assert in ves_icall_RuntimeFieldInfo_SetValueInternal (#21420) * mono/mono@3c4f3de377d: Add correct InetAccess category to HttpClientTest.Proxy_Disabled test and disable Ping tests * mono/mono@9f35bf1b807: Add missing handle function enter/return macros (#21407) * mono/mono@45efaa3b6f9: [interp] Remove hack for nint/nfloat (#21395)
8bf9dec to
a9132c4
Compare
a9132c4 to
c594a5a
Compare
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.cs
Outdated
Show resolved
Hide resolved
0b05031 to
164cc8a
Compare
|
It's ready for review, but before merging the new toolchain has to be released (it's currently a pre-release) and that depends on this PR being green. |
|
The diacritics tests fails in the AOT compiler: |
0369a8f to
83cbc55
Compare
|
It appears the toolchain works fine, I've created its new release and bumped this PR to use it. There were a couple of test failures here which appeared not to be related to the PR (one HTTP timeout and one dotnet run failure that did however build and install the app, logcat contained no errors neither did |
5a116c1 to
e2d0a94
Compare
076efef to
e6db87f
Compare
e6db87f to
d165f65
Compare
| } | ||
| } | ||
|
|
||
| // DotNet fails, see https://github.com/xamarin/xamarin-android/issues/6685 |
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.
This should instead link to: dotnet/runtime#65484
| // Enable the commented out signature (and AOT) once the above is fixed | ||
| [Test] | ||
| [Category ("SmokeTests")] | ||
| // public void SmokeTestBuildWithSpecialCharacters ([Values (false, true)] bool forms, [Values (false, true)] bool aot) |
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 wonder if we should instead do:
public void SmokeTestBuildWithSpecialCharacters ([Values (false, true)] bool forms, [Values (false /*, true */)] bool aot)| // TODO: AOT fails https://github.com/xamarin/xamarin-android/issues/6685 | ||
| // .NET 6 uses AOT by default for Release | ||
| proj.AotAssemblies = false; | ||
| proj.AotAssemblies = false; /* = true; once AOT is fixed */ |
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.
…and then set this to aot.
src/Xamarin.Android.Build.Tasks/Utilities/NativeAssemblyGenerator/NativeAssemblyGenerator.cs
Show resolved
Hide resolved
Context: fd5f31cc89648957243f31ba8fd7af7fccba11e4
Context: https://github.com/xamarin/xamarin-android/issues/6685
Context: https://github.com/xamarin/xamarin-android-binutils
Context: https://github.com/xamarin/xamarin-android-binutils/commit/6d4e3bbceff617235abf03727d5233cb97b80cfb
Context: https://github.com/xamarin/xamarin-android/issues/6840
Changes: https://github.com/xamarin/xamarin-android-binutils/compare/2.35.2-XA.1...L_13.0.1-4.0.1
So far, Xamarin.Android has been using a GNU Binutils toolchain to
compile and link native assembler code we generate during application
build. Unfortunately, Binutils have a problem with certain filename
encodings on Windows -- which required that we downgrade to Binutils
2.35.2 in commit fd5f31cc -- so we decided to switch to an LLVM-based
toolchain which handles such file names without issues.
However, as mono/mono & dotnet/runtime AOT expects a
GNU Binutils-compatible toolchain, it was necessary to implement a
GNU Assembler (`gas`) wrapper around the LLVM `llvm-mc` assembler, so
that command lines used by the Mono AOT compiler keep working fine.
Since LLVM utilities are multi-target by default and, unlike GNU
Binutils, LLVM doesn't need separate builds of every utility, we now
provide GNU Binutils architecture-prefixed wrapper scripts which
invoke their LLVM counterparts with appropriate parameters.
The following LLVM utilities are included:
- `llvm-mc` (assembler)
- `lld` (linker)
- `llvm-strip`
Migrating to LLVM from GNU Binutils increases our install size:
* macOS `.pkg` size increases by ~29MB,
installation size increases by ~75MB.
* Windows `.vsix` size increases by ~14MB,
installation size increases by ~40MB.
Aside: We've updated our unit tests to set
`$(_DisableParallelAot)`=True, because when AOT is done in parallel,
it's very difficult to make sense of the AOT compiler messages, as
messages from multiple processes are all intermixed. We're disabling
parallel AOT to preserve our sanity when things break.
TODO: the Resulting `.apk` sizes also increase unexpectedly, with
`Xamarin.Forms_Performance_Integration-Signed-Release-Profiled-Aot.apkdesc`
showing a 1.7MB increase in `.apk` size. We believe that this is
because of more verbose debug symbols.
xamarin/xamarin-android#6840 will track this. |
Fixes: dotnet#6840 Context: dotnet#6683 Pass the `-s` flag to the native linker in order to produce shared AOT libraries without debug symbols. This is controlled by a new msbuild property `$(AndroidStripAotLibraries)`, which defaults to `true`
Fixes: dotnet#6840 Context: dotnet#6683 Pass the `-s` flag to the native linker in order to produce shared AOT libraries without debug symbols. This is controlled by a new msbuild property `$(AndroidStripAotLibraries)`, which defaults to `true`
Fixes: dotnet#6840 Context: dotnet#6683 Pass the `-s` flag to the native linker in order to produce shared AOT libraries without debug symbols. Symbols are stripped unless the `$(DebugSymbols)` property is set to `True`.
Fixes: dotnet#6840 Context: dotnet#6683 Pass the `-s` flag to the native linker in order to produce shared AOT libraries without debug symbols. Symbols are stripped unless the `$(DebugSymbols)` property is set to `True`.
Context: #6685
Context: fd5f31c
So far,
Xamarin.Androidhas been using a GNU Binutils toolchain to compile and link native assembler code we generateduring application build. Unfortunately, Binutils have a problem with certain filename encodings on Windows and so we
decided to switch to an LLVM-based toolchain which handles such file names without issues.
However, since Mono/dotnet AOT expects a GNU build chain, it was necessary to implement a GNU Assembler (
gas) wrapperaround the LLVM
llvm-mcassembler, so that command lines used by the Mono AOT compiler keep working fine.Since LLVM utilities are multi-target by default and, unlike GNU Binutils, they don't need separate builds of every utility,
we provide GNU Binutils architecture-prefixed wrapper scripts which invoke their LLVM counterparts with appropriate parameters.
The following LLVM utilities are included:
llvm-mc(assembler)lld(linker)llvm-strip