You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When targeting the API-21, the lib SDL2.so is not loaded because a few functions are claimed to be missing (ex: signal, sigsetaction, atof, ...)
I am not sure about the correct solution to perform: referencing shared libraries "libc" and "libm" does not seems to solve the problem.
On 2014-10-20 12:37:58 +0000, Gabriel Jacobo wrote:
Can you post the error log?
On 2014-10-20 16:43:54 +0000, Sylvain wrote:
The first error is :
E/AndroidRuntime(24105): java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "signal" referenced by "libSDL2.so"...
-> If, I comment HAVE_SIGNAL, HAVE_SIGACTION
I have :
E/AndroidRuntime(25255): java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "atof" referenced by "libSDL2.so"...
-> If, I comment HAVE_ATOF:
E/AndroidRuntime(25671): java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "sigemptyset" referenced by "libSDL2.so"...
... Then :
E/AndroidRuntime(29050): java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "srand" referenced by "libSDL2.so"...
Adding libc, libm does not solve the problem. Downgrading to API-level 20 does solve the problem
On 2014-10-21 14:10:35 +0000, Gabriel Jacobo wrote:
I tried reproducing with the latest NDK for Linux, using androidbuild.sh and testgles2.c, the issue does not show up with the default project settings.
Let me know if you find out what's going on.
On 2014-10-21 14:14:15 +0000, Sylvain wrote:
In case, it helps, here's some precision :
api level 21
ndk-r10c
Linux 64-bit (x86)
arch = arm-v7a
I will try later with testgles2
On 2014-10-21 19:12:14 +0000, Sylvain wrote:
I can get the same problem with testgles2. I start with
../build-scripts/androidbuild.sh com.blabla.blabla testgles2.c
I go to the build dir.
This build an .apk with the "dlopen" issue.
The rand/srand issue needs more work, and we probably need to add a config.h define for this.
On 2015-06-17 07:26:35 +0000, Sylvain wrote:
Ok Thanks!
Anyway a quick workaround for "rand/srand" is to remove the compilation of "src/test/*.c" from "SDL/Android.mk".
On 2016-06-30 07:57:51 +0000, Sylvain wrote:
After a long time, I found out more clearly what was going wrong.
The native libraries should be built with a "APP_PLATFORM" as low as possible.
Ideally, APP_PLATFORM should be equals to the minSdkVersion of the AndroidManifest.xml
So that the application never runs on a lower APP_PLATFORM than it has been built for.
An additional good patch would be to write explicitly in "jni/Application.mk": APP_PLATFORM=android-10
(If no APP_PLATFORM is set, the "targetSdkVersion" of the AndroidManifest.xml is applied as an APP_PLATFORM to the native libraries. And currently, this is bad, because targetSdkVersion is 12, whereas minSdkLevel is 10.
And in fact, there is a warning from ndk: "Android NDK: WARNING: APP_PLATFORM android-12 is larger than android:minSdkVersion 10 in ./AndroidManifest.xml".)
to precise what happened in the initial reported test-case:
Let say the "c" code contains a call to "srand()".
with APP_PLATFORM=android-21, libSDL2.so contains a undef reference to "srand()".
with APP_PLATFORM=android-10, libSDL2.so contains a undef reference to "srand48()".
but srand() is missing on devices with APP_PLATFORM=android-10 (it was in fact replaced by srand48()).
So, if you build for android-21 (where srand() is available), you will really have a call to "srand()" and it will fail on android-10.
That was the issue. The path tried to fix this by in fact always calling srand48().
SDL patches that were applied are beneficial anyway, there are implicitly allowing they backward compatibility of using android-21 on a android-10 platform.
It can be helpful in case you want to target a higher APP_PLATFORM than minSdkVersion to have potentially access to more functions.
Eg you want to have access to GLES3 functions (or other) of "android-21". But, if dlopen() fails (on android-10), you do a fall-back to GLES2.
This bug report was migrated from our old Bugzilla tracker.
These attachments are available in the static archive:
Reported in version: 2.0.3
Reported for operating system, platform: Android (All), x86_64
Comments on the original bug report:
On 2014-10-20 06:31:30 +0000, Sylvain wrote:
On 2014-10-20 12:37:58 +0000, Gabriel Jacobo wrote:
On 2014-10-20 16:43:54 +0000, Sylvain wrote:
On 2014-10-21 14:10:35 +0000, Gabriel Jacobo wrote:
On 2014-10-21 14:14:15 +0000, Sylvain wrote:
On 2014-10-21 19:12:14 +0000, Sylvain wrote:
On 2015-04-24 09:45:26 +0000, Sylvain wrote:
On 2015-06-17 05:20:26 +0000, Sam Lantinga wrote:
On 2015-06-17 06:46:08 +0000, Sylvain wrote:
On 2015-06-17 06:55:05 +0000, Sylvain wrote:
On 2015-06-17 07:06:07 +0000, Sylvain wrote:
On 2015-06-17 07:09:44 +0000, Sam Lantinga wrote:
On 2015-06-17 07:26:35 +0000, Sylvain wrote:
On 2016-06-30 07:57:51 +0000, Sylvain wrote:
On 2016-06-30 08:43:04 +0000, Sylvain wrote:
On 2016-10-14 13:58:50 +0000, Sam Lantinga wrote:
The text was updated successfully, but these errors were encountered: