Skip to content
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

Android binaries missing SONAME #960

Closed
05nelsonm opened this issue Aug 29, 2023 · 9 comments
Closed

Android binaries missing SONAME #960

05nelsonm opened this issue Aug 29, 2023 · 9 comments
Labels
enhancement:build Enhancement specific to the build process released Issue has been released

Comments

@05nelsonm
Copy link

05nelsonm commented Aug 29, 2023

Describe the bug
Android showing a linker warning in Logcat about DT_SONAME missing when running tests.

See: https://android.googlesource.com/...

To Reproduce

  1. Run on Android (after moving binaries to appropriate jniLibs directory)
  2. See Logcat

Expected behavior
libsqlitejdbc.so file should contain SONAME

Logs

W linker  : Warning: "/data/app/~~zcxv3TIBZ-Oa1_orVxLcwQ==/io.toxicity.core.data.cipher.driver.test.test-kS081-J0c1_WfBlGIntTzg==/lib/x86_64/libsqlitejdbc.so" has no DT_SONAME (will use libsqlitejdbc.so instead) and will not work when the app moves to API level 23 or later (https://android.googlesource.com/platform/bionic/+/master/android-changes-for-ndk-developers.md#missing-soname-enforced-for-api-level-23) (allowing for now because this app's target API level is still 21)

Environment (please complete the following information):

  • OS: Android (Emulators API 24, 28, 33)
  • CPU architecture: x86
  • sqlite-jdbc version: 3.41.2.1
@gotson
Copy link
Collaborator

gotson commented Aug 29, 2023

Hi, in the link you provided it mentions SONAME but you mentionDT_SONAME. So which one should it be, and what should it contain for Android, would you know?

@gotson gotson added enhancement:build Enhancement specific to the build process and removed triage labels Aug 29, 2023
@05nelsonm
Copy link
Author

Unsure. Logcat error uses DT_SONAME

@gotson
Copy link
Collaborator

gotson commented Aug 29, 2023

Unsure. Logcat error uses DT_SONAME

Do you think you can find out? We would need more details to be able to fix it.

@05nelsonm
Copy link
Author

Do you think you can find out? We would need more details to be able to fix it.

Think we have our answer >> https://stackoverflow.com/questions/41255199/warning-libcryptopp-so-is-missing-dt-soname-will-use-basename-as-a-replacement/41278924#41278924

@05nelsonm 05nelsonm changed the title Android binaries missing DT_SONAME Android binaries missing SONAME Aug 29, 2023
@gotson
Copy link
Collaborator

gotson commented Aug 31, 2023

I tried various linker options without success, the attribute is not added.

Here is what i tried:

-soname,libsqlitejdbc.so
-install_name,libsqlitejdbc.so
-Wl-soname,libsqlitejdbc.so
-Wl-install_name,libsqlitejdbc.so
-Wl-soname

@gotson gotson added help wanted Contributions are welcome and removed help wanted Contributions are welcome labels Aug 31, 2023
@gotson
Copy link
Collaborator

gotson commented Aug 31, 2023

I was using the arguments incorrectly, it seems the following works: -Wl,-soname,libsqlitejdbc.so

readelf --dynamic libsqlitejdbc.so | grep SONAME
 0x000000000000000e (SONAME)             Library soname: [libsqlitejdbc.so]

@gotson gotson closed this as completed in f6a3aef Aug 31, 2023
@gotson
Copy link
Collaborator

gotson commented Aug 31, 2023

@05nelsonm you can try the latest snapshot which contains the SONAME

@05nelsonm
Copy link
Author

@05nelsonm you can try the latest snapshot which contains the SONAME

Tried out 3.43.0.1-SNAPSHOT; no more warnings in Logcat.

Tested on x86 emulator for Android API 23, 24, 27, 33.

Seems fixed to me, thanks @gotson !

@github-actions github-actions bot added the released Issue has been released label Oct 13, 2023
@github-actions
Copy link
Contributor

🎉 This issue has been resolved in 3.43.2.0 (Release Notes)

gotson added a commit to gotson/sqlite-jdbc that referenced this issue Oct 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement:build Enhancement specific to the build process released Issue has been released
Projects
None yet
Development

No branches or pull requests

2 participants