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 3991 - Warning: shared library text segment is not shareable
Summary: Warning: shared library text segment is not shareable
Status: RESOLVED FIXED
Alias: None
Product: SDL_mixer
Classification: Unclassified
Component: misc (show other bugs)
Version: 2.0.2
Hardware: x86 Android (All)
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-12-05 09:52 UTC by test user
Modified: 2017-12-08 19:02 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description test user 2017-12-05 09:52:18 UTC
When I try to run my app in Android studio on Android (x86) emulator I get next error:

[x86] Compile        : mpg123 <= getcpuflags.S
  [x86] Compile        : mpg123 <= dither.c
  [x86] Compile        : mpg123 <= feature.c
  [x86] SharedLibrary  : libmpg123.so
  /Android/Sdk/ndk-bundle/toolchains/x86-4.9/prebuilt/linux-x86_64/lib/gcc/i686-linux-android/4.9.x/../../../../i686-linux-android/bin/ld: warning: shared library text segment is not shareable
  /Android/Sdk/ndk-bundle/toolchains/x86-4.9/prebuilt/linux-x86_64/lib/gcc/i686-linux-android/4.9.x/../../../../i686-linux-android/bin/ld: error: treating warnings as errors
  clang++: error: linker command failed with exit code 1 (use -v to see invocation)
  make: *** [/app/build/intermediates/ndkBuild/debug/obj/local/x86/libmpg123.so] Error 1

It is happen only for x86 ABI. I build successfully for armeabi-v7a ABI. But for x86 I get error. I am using SDL2-2.0.7, SDL2_image-2.0.2 and SDL2_mixer-2.0.2.

Android with armeabi-v7a is very slow that is why I need android with x86 to test my app.

The latest changes in SDL2_mixer which is located at this link https://hg.libsdl.org/SDL_mixer/file/929c90225030 don't fix this issue. This bug is generated by external library /external/mpg123-1.25.6. In the file /external/mpg123-1.25.6/Android.mk of the latest changes in SDL2_mixer there are next lines:

# This disables the following warning:
   190 #   warning: shared library text segment is not shareable
   191 # However, the library still has PIC unaware assembly!
   192 LOCAL_DISABLE_FATAL_LINKER_WARNINGS = true

Setting LOCAL_DISABLE_FATAL_LINKER_WARNINGS to true doesn't fix the issue and after running app on android emulator I get next error:

dlopen failed: /data/app/com.myapp-1/lib/x86/libmpg123.so: has text relocations

. Is there a chance that this error will be fixed?

Thank you!
Comment 1 test user 2017-12-05 10:18:49 UTC
I use this sdk version:

minSdkVersion 16
targetSdkVersion 27
Comment 2 Sam Lantinga 2017-12-07 16:28:23 UTC
I'll take a look. We may need to disable assembly on Android to resolve this.
Comment 3 Sam Lantinga 2017-12-07 16:50:14 UTC
Fixed, thanks!
https://hg.libsdl.org/SDL_mixer/rev/5fe3b562f4e2
Comment 4 test user 2017-12-08 07:11:00 UTC
I've checked fixes and it works now. I can run my app in android (x86) emulator now.

Thank you!
Comment 5 Sam Lantinga 2017-12-08 19:02:23 UTC
You're welcome!