Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning: shared library text segment is not shareable #241

Closed
SDLBugzilla opened this issue Feb 11, 2021 · 0 comments
Closed

Warning: shared library text segment is not shareable #241

SDLBugzilla opened this issue Feb 11, 2021 · 0 comments

Comments

@SDLBugzilla
Copy link
Collaborator

This bug report was migrated from our old Bugzilla tracker.

Reported in version: 2.0.2
Reported for operating system, platform: Android (All), x86

Comments on the original bug report:

On 2017-12-05 09:52:18 +0000, test user wrote:

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!

On 2017-12-05 10:18:49 +0000, test user wrote:

I use this sdk version:

minSdkVersion 16
targetSdkVersion 27

On 2017-12-07 16:28:23 +0000, Sam Lantinga wrote:

I'll take a look. We may need to disable assembly on Android to resolve this.

On 2017-12-07 16:50:14 +0000, Sam Lantinga wrote:

Fixed, thanks!
https://hg.libsdl.org/SDL_mixer/rev/5fe3b562f4e2

On 2017-12-08 07:11:00 +0000, test user wrote:

I've checked fixes and it works now. I can run my app in android (x86) emulator now.

Thank you!

On 2017-12-08 19:02:23 +0000, Sam Lantinga wrote:

You're welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant