-
Notifications
You must be signed in to change notification settings - Fork 537
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
[Xamarin.Android.Build.Tasks] AOT+LLVM needs minSdkVersion #795
Merged
Conversation
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
TODO: Unit tests. |
12ec1d8
to
b17e735
Compare
@jonpryor the test failure is
Looks like we don't always get the |
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 (in `AndroidManifest.xml`) * with Android NDK r12b or later * on particular hardware devices, e.g. a Nexus 5. Actual results: the app runs, but the AOT'd images aren't used: AOT: image 'Xamarin.Android.Support.v7.AppCompat.dll.so' not found: dlopen failed: cannot locate symbol "__aeabi_memset" referenced by "/data/app/com.companyname.App1-1/lib/arm/libaot-Xamarin.Android.Support.v7.AppCompat.dll.so"... The `__aeabi_memset` symbol can't be found, preventing e.g. `Xamarin.Android.Support.v7.AppCompat.dll.so` from being used. Meaning the 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_memset` symbol][0] is that we're using 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 `.apk` on a platform which is >= `minSdkVersion` but less than `$(TargetFrameworkVersion)`, the AOT images won't be used. [0]: android/ndk#126 Fix this by updating the `<Aot/>` task to instead use the `//uses-sdk/@android:minSdkVersion` value. This ensures that we use NDK paths which correspond to the app's minimum supported API level, which should allow the AOT images to be loaded on downlevel devices.
b17e735
to
802a187
Compare
build |
jonpryor
added a commit
to jonpryor/xamarin-android
that referenced
this pull request
Aug 31, 2017
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 (in `AndroidManifest.xml`) * with Android NDK r12b or later * on particular hardware devices, e.g. a Nexus 5. Actual results: the app runs, but the AOT'd images aren't used: AOT: image 'Xamarin.Android.Support.v7.AppCompat.dll.so' not found: dlopen failed: cannot locate symbol "__aeabi_memset" referenced by "/data/app/com.companyname.App1-1/lib/arm/libaot-Xamarin.Android.Support.v7.AppCompat.dll.so"... The `__aeabi_memset` symbol can't be found, preventing e.g. `Xamarin.Android.Support.v7.AppCompat.dll.so` from being used. Meaning the 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_memset` symbol][0] is that we're using 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 `.apk` on a platform which is >= `minSdkVersion` but less than `$(TargetFrameworkVersion)`, the AOT images won't be used. [0]: android/ndk#126 Fix this by updating the `<Aot/>` task to instead use the `//uses-sdk/@android:minSdkVersion` value. This ensures that we use NDK paths which correspond to the app's minimum supported API level, which should allow the AOT images to be loaded on downlevel devices.
jonpryor
added a commit
to jonpryor/xamarin-android
that referenced
this pull request
Aug 31, 2017
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 (in `AndroidManifest.xml`) * with Android NDK r12b or later * on particular hardware devices, e.g. a Nexus 5. Actual results: the app runs, but the AOT'd images aren't used: AOT: image 'Xamarin.Android.Support.v7.AppCompat.dll.so' not found: dlopen failed: cannot locate symbol "__aeabi_memset" referenced by "/data/app/com.companyname.App1-1/lib/arm/libaot-Xamarin.Android.Support.v7.AppCompat.dll.so"... The `__aeabi_memset` symbol can't be found, preventing e.g. `Xamarin.Android.Support.v7.AppCompat.dll.so` from being used. Meaning the 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_memset` symbol][0] is that we're using 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 `.apk` on a platform which is >= `minSdkVersion` but less than `$(TargetFrameworkVersion)`, the AOT images won't be used. [0]: android/ndk#126 Fix this by updating the `<Aot/>` task to instead use the `//uses-sdk/@android:minSdkVersion` value. This ensures that we use NDK paths which correspond to the app's minimum supported API level, which should allow the AOT images to be loaded on downlevel devices.
cobey
added a commit
that referenced
this pull request
Aug 31, 2017
[Xamarin.Android.Build.Tasks] AOT+LLVM needs minSdkVersion (#795)
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
=22 (inAndroidManifest.xml
)Actual results: the app runs, but the AOT'd images aren't used:
The
__aeabi_memset
symbol can't be found, preventing e.g.Xamarin.Android.Support.v7.AppCompat.dll.so
from 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_memset
symbol 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.apk
on a platform which is >=minSdkVersion
but less than$(TargetFrameworkVersion)
, the AOT images won't be used.Fix this by updating the
<Aot/>
task to instead use the//uses-sdk/@android:minSdkVersion
value, as determined by the<GenerateJavaStubs/>
task. This ensures that we use NDK paths whichcorrespond to the app's minimum supported API level, which should
allow the AOT images to be loaded on downlevel devices.