-
Notifications
You must be signed in to change notification settings - Fork 532
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
Make sure app bundle has soname set #2192
Conversation
This PR should update one of the mkbundle We currently have Should we update an existing on-device test to set |
96e7504
to
b1007bb
Compare
{ | ||
public static class Config | ||
{ | ||
public static readonly string LlvmReadobj = Path.Combine ("@ANDROID_NDK_DIRECTORY@", "toolchains", "llvm", "prebuilt", "@HOST_ARCH@", "bin", "llvm-readobj@EXECUTABLE_EXTENSION@"); |
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.
As per 3440227, this should use @"@ANDROID_NDK_DIRECTORY@"
(using @-strings), so that this works properly on Windows.
public static class Config | ||
{ | ||
public static readonly string LlvmReadobj = Path.Combine ("@ANDROID_NDK_DIRECTORY@", "toolchains", "llvm", "prebuilt", "@HOST_ARCH@", "bin", "llvm-readobj@EXECUTABLE_EXTENSION@"); | ||
public static readonly string GccReadelf = Path.Combine ("@ANDROID_NDK_DIRECTORY@", "toolchains", "@OLD_TOOLCHAIN@", "prebuilt", "@HOST_ARCH@", "bin", "x86_64-linux-android-readelf@EXECUTABLE_EXTENSION@"); |
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.
As per 3440227, this should use @"@ANDROID_NDK_DIRECTORY@"
(using @-strings), so that this works properly on Windows.
b1007bb
to
95da18b
Compare
</ProjectReference> | ||
</ItemGroup> | ||
|
||
<Target Name="Prepare" |
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.
From the "Appeasing Visual Studio for Mac" department, custom targets should not go into .csproj
files, because whenever you e.g. add a project to the .sln
, Visual Studio for Mac will "reformat" every .csproj
referenced by the .sln
. (Related: https://bugzilla.xamarin.com/show_bug.cgi?id=42603)
To appease VS for Mac -- and keep our sanity! -- custom targets should go into a .targets
file, e.g. Xamarin.Android.MakeBundle-UnitTests.targets
-- and the .csproj
should <Import/>
the .targets
file. (See e.g. Mono.Android.csproj
, mono-runtimes.csproj
, and nearly every other project we have!)
95da18b
to
c848031
Compare
build |
The failure is due a misbehaving
The exception is thrown on a threadpool thread and is not delivered to the runner, thus the unhandled status and process exit. |
build |
@@ -0,0 +1,7 @@ | |||
#!/bin/bash -e |
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.
What is this file used for? I don't see any other mentions of run.sh
.
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.
it's just a way to run this without having to launch the whole msbuild machinery - faster turnover of changes
If |
Android API23 and newer requires that any shared library used by an application which targets API23 or newer has its soname set in the ELF header or otherwise the OS will refuse to load it: 09-18 08:07:27.687 10698 10698 W linker : Warning: "/data/app/Mono.Android_Tests-O9bT_-xHyd26brpmOI9RNg==/lib/x86/libmonodroid_bundle_app.so" has no DT_SONAME (will use libmonodroid_bundle_app.so instead) and will not work when the app moves to API level 23 or later (https://android.googlesource. com/platform/bionic/+/master/missing-soname-enforced-for-api-level-23) (allowing for now because this app's target API level is still 22) (TaskId:201) This commit fixes the problem by passing `-soname libmonodroid_bundle_app.so` to the linker when building the bundle.
c848031
to
833d39d
Compare
Android API23 and newer requires that any shared library used by an application
which targets API23 or newer has its soname set in the ELF header or otherwise
the OS will refuse to load it:
09-18 08:07:27.687 10698 10698 W linker : Warning: "/data/app/Mono.Android_Tests-O9bT_-xHyd26brpmOI9RNg==/lib/x86/libmonodroid_bundle_app.so" has no DT_SONAME (will use libmonodroid_bundle_app.so instead) and will not work when the app moves to API level 23 or later (https://android.googlesource.
com/platform/bionic/+/master/missing-soname-enforced-for-api-level-23) (allowing for now because this app's target API level is still 22) (TaskId:201)
This commit fixes the problem by passing
-soname libmonodroid_bundle_app.so
tothe linker when building the bundle.