[x264-devel] arm: x264 library can't be loaded on Android 6 (Marshmallow) due to text relocations

Janne Grunau janne-x264 at jannau.net
Mon Oct 12 12:55:28 CEST 2015


On 2015-10-12 11:51:07 +0800, Simon Liu wrote:
> Hello,
> 
> I'm trying to use x264 library on Android 6, and got the following error:
> 
> java.lang.UnsatisfiedLinkError: dlopen failed:
> /data/app/com.example.myapp.dev-2/lib/arm/libx264.so: has text relocations
>        at java.lang.Runtime.loadLibrary(Runtime.java:372)
>        at java.lang.System.loadLibrary(System.java:1076)
> 
> The following is my configure command:
> 
> LIBX264_CFLAGS=" \
> --cross-prefix=arm-linux-androideabi- \
> --sysroot=$SYSROOT \
> --prefix=$DEST \
> --host=arm-linux  \
> --disable-cli \
> --enable-pic \
> --enable-shared \
> --disable-avs"
> 
> ./configure $LIBX264_CFLAGS
> 
> It works well on Android 4.x/5.x, and the linker process only report a
> warning about text relocations.
> 
> As per my understanding, enable-pic should omit the text relocation issue,
> but it doesn't. It seems there're some hardcoding textrel in ASM code.

Yes, the movrel macro is not postion independent

> Is there any way to fix this issue? Or any workaround to it?

Disabling the asm is the only possibility right now. Due to the high 
performance impact I wouldn't call it workaround though. Just disabling
asm functions with movrel if PIC is enabled might have a acceptable 
performance impact if you need a solution  immediately.

I'll look at fixing the movrel macro but that might take a few days.

Janne


More information about the x264-devel mailing list