[Xamarin.Android.Build.Tasks] AOT+LLVM needs minSdkVersion (#795) #805
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=58029
Scenario: Build a project with:
$(Configuration)=Release$(AotAssemblies)=True$(EnableLLVM)=True$(TargetFrameworkVersion)=v7.1 (API-25)//uses-sdk/@android:minSdkVersion=10 (inAndroidManifest.xml)Actual results: the app runs, but the AOT'd images aren't used:
The
__aeabi_memsetsymbol can't be found, preventing e.g.Xamarin.Android.Support.v7.AppCompat.dll.sofrom being used. Meaningthe app pays the build overhead and size penalty of AOT+LLVM, but
doesn't get anything out of it; only the JIT is used.
The cause of the missing
__aeabi_memsetsymbol is that we'reusing the NDK paths which corresponds with
$(TargetFrameworkVersion),not the NDK paths which correspond with
//uses-sdk/@android:minSdkVersion. Because of this, if you use the.apkon a platform which is >=minSdkVersionbut less than$(TargetFrameworkVersion), the AOT images won't be used.Fix this by updating the
<Aot/>task to instead use the//uses-sdk/@android:minSdkVersionvalue. This ensures that we useNDK paths which correspond to the app's minimum supported API level,
which should allow the AOT images to be loaded on downlevel devices.