We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 4595

Summary: CMake: ANDROID_DL_LIBRARY points to the wrong libdl
Product: SDL Reporter: Tony Wasserka <neobrainx+libsdl>
Component: buildAssignee: Sam Lantinga <slouken>
Status: RESOLVED DUPLICATE QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: sylvain.becker
Version: HG 2.0   
Hardware: All   
OS: Android (All)   

Description Tony Wasserka 2019-04-12 12:45:39 UTC
The Android NDK developers have restructured their toolchain and CMake toolchain file recently. Attempting to build SDL2 with CMake will now cause it to link against the static version of libdl, which is a stub implementation though: dlopen & co aren't actually supported in libdl.a (see https://github.com/android-ndk/ndk/issues/929#issuecomment-482219474). As a result, SDLActivity will fail to load any shared libraries at runtime.

The fix suggested in the NDK ticket is to use
> find_library(ANDROID_DL_LIBRARY NAMES libdl.so dl)
in SDL's main CMakeLists.txt. I confirmed this properly picks up the shared library locally.
Comment 1 Tony Wasserka 2019-04-12 21:16:28 UTC
Apparently this is considered a bug in the NDK, so it might be worth waiting out if the NDK folks can come up with a fix that resolves the need for the SDL workaround mentioned above.
Comment 2 Ryan C. Gordon 2019-05-18 18:48:54 UTC
Tagging a bunch of bugs with "target-2.0.10" so we have a clear list of things to address before a 2.0.10 release.

Please note that "addressing" one of these bugs might mean deciding to defer on it until after 2.0.10, or resolving it as WONTFIX, etc. This is just here to tell us we should look at it carefully, and soon.

If you have new information or feedback on this issue, this is a good time to add it to the conversation, as we're likely to be paying attention to this specific report in the next few days/weeks.

Thanks!

--ryan.
Comment 3 Sylvain 2019-08-21 10:22:55 UTC
Was fixed in bug 3918 
https://hg.libsdl.org/SDL/rev/4a410f099040

*** This bug has been marked as a duplicate of bug 3918 ***