-
Notifications
You must be signed in to change notification settings - Fork 245
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
new Android azure build scripts need soname fixes #897
Comments
(This kinda tells why I didn't leave Cerbero while I don't prefer sticking to it...) |
If you have trouble reproducing the issues locally, I had been working on locally runnable shell scripts. I put those files under |
This artifact is from vcpkg. I assume you meant: https://dev.azure.com/tommbrt/tommbrt/_build/results?buildId=5303&view=artifacts&pathAsName=false&type=publishedArtifacts And what's the error when using the original, non-renamed libs? Like this artifact here: https://dev.azure.com/tommbrt/tommbrt/_build/results?buildId=5300&view=artifacts&pathAsName=false&type=publishedArtifacts I've read on the web that this doesn't work (and you also told me), but I haven't found a meaningful error message. After all, the |
Oops, yes, I didn't mean vcpkg. I think I had no idea how to get to the right pipeline. When I use the original (cerbero-based) builds, there is no error on x86. The errors on 64-bit environments (both intel and arm) are like this: atsushieno/aap-lv2-fluidsynth#1. The soname semantic versions are just filename and not a problem IF the strongly-named version files are treated as shared libraries by the platform. Linux (I guess glibc) treats |
Ok, I must admit I don't fully understand or comprehend the problem. I haven't found any official documentation about that either. I will just compile the four libs in question as static ones to avoid this problem. Not nice, but my best guess. I've implemented static linking in this artifact. Feel free to try it. In the meantime, I'll try to get your lv2-fluidsynth app working with the android emulator. |
On .so not loading versioned files, I haven't seen any "official documentation" either, but Android is not a standard-based platform thus it wouldn't qualify the actual behavior. The problem has been commonly known among Android native app devs: https://stackoverflow.com/questions/11491065/linking-with-versioned-shared-library-in-android-ndk Instead of my complicated app, I was trying to build test runner for the tests in |
I think I found the root cause of the incorrectly named .so files: Previously, I was passing When setting up the pipeline initially, I had already tried android targets, but gettext kept failing to find its library. It still does, see this build: https://dev.azure.com/tommbrt/tommbrt/_build/results?buildId=5354&view=results And now I understand the problem for this one: the Apart from that I have been able to compile |
I'm having hard time getting successful builds from my scripts now, partly for the same reason as you had problem at gettext. It could be workarounded by skipping its installation, but I have another issue which stops build in the middle. Maybe the it is due to some mismatch from Azure build scripts and mine, but haven't figured out why. It is pushed on the same tree as I commented earlier, for public reference. I was going to give up and tried to just use the binary builds, but since my attempt to build Android tests runner depends on internals (e.g. Regarding shared library builds now I tried them from Azure artifacts with my own app (audio plugin), and confirmed that things haven't changed.
I don't really understand libtool either, but it seems the
Those gradle tasks don't really run tests on target Android. |
Try to In short: I wasn't able to figure out that In case it still doesn't work for you, I could simply publish the entire build-root as azure artifact. Just let me know. |
Thanks, the build fix worked like a charm! I thought you were going to build static libfluidsynth.a but it seems it's only for gettext etc. which would keep it simple for mere native library users. I confirmed those updated libraries work fine on my app too. |
Changes are from FluidSynth#897 (comment)
context: FluidSynth/fluidsynth#897 fixes: #1 This also removes uselss CI-SKIP scripting which never worked. Now it points to my fluidsynth-fork, but the related scripts should be brought upstream (once I sort out how to deal with the actual tests).
Today I got a working "Android tests" running on x86 emulator, which I hope to make it runnable (my android-testing branch). It is with handful of disabled tests, but surprisingly not too many, It does not bring any changes for resolving sf files, so they are quite expected. I have no idea whether the current CI settings are viable to get emulator up and running for every build though. The tests should be PR-ed with a separate issue probably. |
Great, that looks very good already, thanks! I wouldn't mind about the few disabled tests. If you want I can deal with setting up CI properly. |
Changes are from FluidSynth#897 (comment)
FluidSynth version
Confirmed build artifacts from: https://dev.azure.com/tommbrt/tommbrt/_build/results?buildId=5294&view=results
Reference Cerbero builds: https://app.circleci.com/pipelines/github/FluidSynth/fluidsynth/1391/workflows/c05fb732-8b6c-405e-90f7-c73a480ed659/jobs/1377
Describe the bug
The Android build artifacts from new build scripts cause run-time failures due to inconsistent shared library symbolic name, like this:
It tries to load
libintl.so.8
which we rename at copying files. But Androiddlopen()
does not seem to support soname differences like this (I'm not sure if it is POSIX-compliant or bionic specific, but it is how Android works).After all, we have to provide "consistent" soname using
-Wl,-soname,xxx
compiler argument, or whatever equivalent.This does not happen to Cerbero-based artifacts.
The Cerbero-based artifacts worked fine on x86 target (they show another issue on arm64 and x86_64 for my app, so it's hard to tell the precise difference). Most likely on armeabi-v7a too (unconfirmed). I believe the problem is ABI-agnostic.
When I was building fluidsynth for Android back in 2015, I had some ugly hackaround by retouching binaries directly: https://github.com/atsushieno/android-fluidsynth/blob/master/rewrite-binary.sh
Expected behavior
The resulting libraries do not contain
libxxx.so.x.y
as reference sonames.Steps to reproduce
What I used to confirm was my Android app https://github.com/atsushieno/aap-lv2-fluidsynth/ but there is no intuitive alternative project so far...
The text was updated successfully, but these errors were encountered: