sdl2_frt/include
Sam Lantinga 83cb2b63a3 Fixed bug 2758 - Android issues with NDK r10c and API-21
Sylvain

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.
2016-10-14 06:57:55 -07:00
..
begin_code.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
close_code.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_assert.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_atomic.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_audio.h audio: Implemented buffer queueing for capture devices (SDL_DequeueAudio()). 2016-08-06 02:47:27 -04:00
SDL_bits.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_blendmode.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_clipboard.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_config_android.h Fixed bug 2758 - Android issues with NDK r10c and API-21 2016-10-14 06:57:55 -07:00
SDL_config_iphoneos.h Enable SDL_LoadObject on iOS 8+ and tvOS. 2016-09-25 15:02:06 -03:00
SDL_config_macosx.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_config_minimal.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_config_pandora.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_config_psp.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_config_windows.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_config_winrt.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_config_wiz.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_config.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_config.h.cmake Fixed building with cmake when fcitx isn't installed 2016-10-14 01:04:21 -07:00
SDL_config.h.in Fixed bug 2824 - Add Fcitx Input Method Support 2016-10-07 18:57:40 -07:00
SDL_copying.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_cpuinfo.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_egl.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_endian.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_error.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_events.h Added SDL_DROPBEGIN and SDL_DROPCOMPLETE events, plus window IDs for drops. 2016-01-05 01:42:00 -05:00
SDL_filesystem.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_gamecontroller.h Added brackets to function names in header comments so that doxygen links them. 2016-08-03 22:30:31 +02:00
SDL_gesture.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_haptic.h Fixed bug 3165 - define numbers don't match types in Swift 2016-10-01 13:35:36 -07:00
SDL_hints.h Implemented SDL_GetHintBoolean() to make it easier to check boolean hints 2016-10-07 23:40:44 -07:00
SDL_joystick.h Added brackets to function names in header comments so that doxygen links them. 2016-08-03 22:30:31 +02:00
SDL_keyboard.h Fixed two old identifiers in header comments. 2016-08-03 22:39:44 +02:00
SDL_keycode.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_loadso.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_log.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_main.h Android: Updated name of README file. 2016-04-25 22:17:38 +02:00
SDL_messagebox.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_mouse.h Added brackets to function names in header comments so that doxygen links them. 2016-08-03 22:30:31 +02:00
SDL_mutex.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_name.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_opengl_glext.h Fixed crash if initialization of EGL failed but was tried again later. 2015-06-21 17:33:46 +02:00
SDL_opengl.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_opengles2_gl2.h Fixed crash if initialization of EGL failed but was tried again later. 2015-06-21 17:33:46 +02:00
SDL_opengles2_gl2ext.h Fixed crash if initialization of EGL failed but was tried again later. 2015-06-21 17:33:46 +02:00
SDL_opengles2_gl2platform.h Fixed crash if initialization of EGL failed but was tried again later. 2015-06-21 17:33:46 +02:00
SDL_opengles2_khrplatform.h Fixed crash if initialization of EGL failed but was tried again later. 2015-06-21 17:33:46 +02:00
SDL_opengles2.h Fixed including OpenGL ES on iOS without any other SDL headers 2016-09-14 08:20:24 -07:00
SDL_opengles.h Fixed including OpenGL ES on iOS without any other SDL headers 2016-09-14 08:20:24 -07:00
SDL_pixels.h Fixed comment for new pixel formats 2016-10-11 23:21:41 -07:00
SDL_platform.h Initial Apple TV / tvOS support. 2016-09-13 22:18:06 -03:00
SDL_power.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_quit.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_rect.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_render.h Fixed bug 3345 - SDL_RenderClear inconsistency with ClipRect 2016-10-01 11:46:32 -07:00
SDL_revision.h Fixed crash if initialization of EGL failed but was tried again later. 2015-06-21 17:33:46 +02:00
SDL_rwops.h Fixed bug 3165 - define numbers don't match types in Swift 2016-10-01 13:35:36 -07:00
SDL_scancode.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_shape.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_stdinc.h Fixed bug 2885 - SDL_stdinc.h doesn't need to include iconv.h 2016-10-07 16:44:42 -07:00
SDL_surface.h Fixed bug 2924 - SDL_CreateRGBSurface[From] versions that take SDL_PIXELFORMAT enum 2016-10-07 17:04:58 -07:00
SDL_system.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_syswm.h Expose the EGL display and window for Vivante SDL windows 2016-01-16 21:58:49 -08:00
SDL_test_assert.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_test_common.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_test_compare.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_test_crc32.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_test_font.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_test_fuzzer.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_test_harness.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_test_images.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_test_log.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_test_md5.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_test_random.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_test.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_thread.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_timer.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_touch.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_types.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_version.h Updated version to 2.0.5 in preparation for release 2016-09-28 22:24:01 -07:00
SDL_video.h Fixed bug 3165 - define numbers don't match types in Swift 2016-10-01 13:35:36 -07:00
SDL.h Fixed bug 3165 - define numbers don't match types in Swift 2016-10-01 13:35:36 -07:00