-
Notifications
You must be signed in to change notification settings - Fork 35
dynamic library does not have SONAME #36
Comments
Adding SONAME requires some non-trivial patches to setup.py and/or distutils. I'd like a self-contained App to test before investing time into SONAME stuffs. Also, I really suggest you to build static library libpython.a and link your JNI library to libpython.a so to get rid of all the issues around dynamic linking. |
I played around and added the following patch to configure.ac. I realize this is hard coded, but this added the SONAME to my dynamic library, and fixed some of my issues. `diff --git a/configure.ac b/configure.ac AC_MSG_CHECKING([for -Wl,--no-as-needed]) ` |
I have tried to get the static library to work, but I have not had much luck. Any chance you can point me in the right direction if you recommend that, or update my test app to show how that would work? |
Sorry, but I don't have much time recently for testing it. Mind to share error messages you've got? (I'm not asking for a complete example this time - I know preparing it is very time consuming :P) I think after rebuilding python3-android as static libraries and remove loadLibrary("python3.9") are first steps? |
I feel I'm doing something wrong. I've tried adding these lines to CMakeLists
but get this error
I've tried to just change what is currently in the CMakesList.txt and use STATIC instead of SHARED and .a instead of .o. The app then compiles, but crashes at runtime with
Runtime Output
At this point I feel I need to create a fork of your project that has my hack in configure.ac so I can at least get back to that if needed. Maybe we can get a static build working, but other then a requests library input failing on my 32 bit 6.0.1 device, everything works with this SONAME patch. |
As an added note. I'm pretty much giving up on the 1 device that doesn't run this. I tracked it down to the requests library (https://requests.readthedocs.io/en/master/) It appears to fail in urllib3 when trying to make the following import
I tried removing these imports, but it only created other issues. Just sharing for the sake of sharing, not sure it helps anyone understand my issues. |
Hmm, that's strange. If you want to continue the state library approach, could you check if
Yet another strange stuff... |
In trying to figure out issues I'm having on older devices running 6.0.1, I'm wondering if some of my issues are that I had to change how I import the library. In looking back at my fork, the dynamic library has an SONAME, the current version coming from this fork are not. In looking back at Issue 18 I noticed that my errors was showing the windows style path, and I wonder if it's causing some of my issues. As described here
On a side note, I also see that Python 3.9b5 is available. I tried adding a similar path to the configure.ac, but I didn't have much luck.
The text was updated successfully, but these errors were encountered: