It’s likely to be because of the change at API level 23, requiring that x86 shared libraries not contain text relocations (see here). That means they must be compiled as Position Independent Code (for example using the -fPIC compiler flag).
Two points. Firstly, disabling the warning (even if you can succeed in doing that) isn’t going to help, because recent versions of Android will not install an app that has Text Relocations in shareable libraries. So by disabling the warning you are simply transferring the problem from build-time to install-time!
Secondly, I think LOCAL_LDFLAGS controls the linker flags, not the compiler flags. Try putting the ‘-fPIC’ in LOCAL_CFLAGS.
getcpuflags.S is an assembly language file so the -fPIC switch is not going to have any effect on that. If the text relocation is in that module, the only solution will be to re-write the assembler code. If it’s a trivial function - which I’m guessing from the filename it probably is - that may not be too difficult.
It’s even possible that the code is already position-independent but the object module generated by the assembler contains a flag to say it isn’t. Until this issue arose that would have been harmless, but now it isn’t.
Arguably whoever maintains SDL_mixer should make the modification because it’s not very satisfactory for a standard SDL extension to be incompatible with x86 Android. On the other hand it’s the fault of Google for introducing this questionable restriction.
No, just a user. But because my app is affected by this issue I have done some research into it. At the moment I can’t support x86 Android later than Lollipop, and probably I never will. It’s less of a problem than it might have been because Intel have pulled out of mobile CPU development, so there probably won’t be any more x86-based mobile devices. However it stops my app running on most Chromebooks which is more serious.
I think you mentioned earlier that an ARM build (which should not be affected by this issue) is too slow, but that’s not been my experience. The best ARM-based products (for example my OnePlus 5 phone) are much faster than any x86-based mobile devices I have ever tested. Perhaps you should consider that route.
It is very slow on android emulator. Besides it takes a lot of CPU when I start run app on armeabi-v7a emulator. I will buy some android device (or devices) for testing but only after I will run successfully and test on emulators.
I see only one option at current moment: connect somehow with SDL2 developers and ask them.
Oh, I see. I’ve never used an Android emulator; I’ve read too many reports of them giving misleading results. I’ve found testing on a real device to be entirely satisfactory, using USB debugging (adb).
Problem is in the mpg123 library and it was added to SDL2_mixer only in 2.0.2 version of mixer. mpg123 is absent in the 2.0.1 version of SDL2_mixer. Is it really so needed in the mixer if mixer became a broken in android x86?
I wonder if the issue has been misunderstood by whoever made those changes. Disabling the warning (which is what you were also trying to do) does not address the true problem, it simply defers it from being reported at build time (which is helpful) to it becoming a fatal error at install time (which is unhelpful). I don’t know of any solution other than modifying the assembly language code to be position-independent.