-
Notifications
You must be signed in to change notification settings - Fork 257
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
conditional branch to PLT in THUMB-2 not supported yet. #337
Comments
Thanks for the report. I've raised this internally as http://b/36451810 (our binutils folks use our internal bug tracker). I'll post updates here as I get them. |
Triaging for r16 since we need a binutils update and it's unlikely that we'll get one in time for r15. |
Hi, You can use this NDK : Android NDK, Revision 10e (May 2015) downloadable here : https://developer.android.com/ndk/downloads/older_releases.html which works with gstreamer example. Cheers |
internal status:
|
Android.mk は Android tutorials[*1] と同じです。 Application.mk は android-ndk 側の問題[*2] があるため、 clang を使用せず gcc でビルドするように設定しています。 *1: https://gstreamer.freedesktop.org/documentation/tutorials/android/index.html) *2: android/ndk#337
@DanAlbert Is this problem fixed in version r16b ? I also encounter this issue. Okay,I see it.It will be fixed in r17 for your plan.. |
@DanAlbert does this problem has a patch currently or does this problem has a workaround? Yesterday I do some tests and maybe found a workaround
I want to know that if this is a good library?Is it dangerous to use it? I also test it using r16b,and the error cannot disappear. |
from the internal bug:
|
Can switch to bfd with |
did you solve this issue? |
-fuse-ld=bfd got further, still encountered another issue possibly related:
|
Not fixed in binutils yet, and we're past the point that it would make it to r17 if it were submitted today. |
https://bugzilla.gnome.org/show_bug.cgi?id=793980 |
It is true that the gold linker does not support "conditional branch to PLT in THUMB-2", and the bfd linker does. However, adding this support in the linker will not be a lasting solution. The conditional branch to PLT using a R_ARM_THM_JUMP19 relocation has a small range. Even if gold were to support it, it would only be useful in a small number of cases. In this example, if I change the linker to ld.bfd with this patch:
The build completes successfully. However, when I upgrade to gstreamer 1.14.0, I get a different build failure:
This shows the problem with R_ARM_THM_JUMP19 relocation. It does not have a good enough range. Even if a linker handles it today, an increase in the size of .so file will cause the linker to fail at a later date. A better solution is to avoid this relocation, by converting this conditional branch into an unconditional branch, or by converting this branch through PLT into a direct jump. I've sent patches for doing this to upstream ffmpeg and openssl projects:
The build issues should be fixed once these patches are merged upstream and make their way into gstreamer. Here are the two gstreamer bugs for re-enabling asm optimizations for libav and openssl/poly1305: |
Branch to global symbol results in reference to PLT, and when compiling for THUMB-2 - in a R_ARM_THM_JUMP19 relocation. Some linkers don't support this relocation (ld.gold), while others can end up truncating the relocation to fit (ld.bfd). Convert this branch through PLT into a direct branch that the assembler can resolve locally. See android/ndk#337 for background. The current workaround is to disable poly1305 optimization assembly, which is not optimal and can be reverted after this patch: https://github.com/freedesktop/gstreamer-cerbero/commit/beab607d2b1ff23c41b7e01aa9c64be5e247d1e6 CLA: trivial Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from #5949)
Branch to global symbol results in reference to PLT, and when compiling for THUMB-2 - in a R_ARM_THM_JUMP19 relocation. Some linkers don't support this relocation (ld.gold), while others can end up truncating the relocation to fit (ld.bfd). Convert this branch through PLT into a direct branch that the assembler can resolve locally. See android/ndk#337 for background. The current workaround is to disable poly1305 optimization assembly, which is not optimal and can be reverted after this patch: https://github.com/freedesktop/gstreamer-cerbero/commit/beab607d2b1ff23c41b7e01aa9c64be5e247d1e6 CLA: trivial Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from #5949) (cherry picked from commit 5bb1cd2)
Branch to global symbol results in reference to PLT, and when compiling for THUMB-2 - in a R_ARM_THM_JUMP19 relocation. Some linkers don't support this relocation (ld.gold), while others can end up truncating the relocation to fit (ld.bfd). Convert this branch through PLT into a direct branch that the assembler can resolve locally. See android/ndk#337 for background. The current workaround is to disable neon during gstreamer build, which is not optimal and can be reverted after this patch: https://github.com/freedesktop/gstreamer-cerbero/commit/41556c415739fbc3a72c7eaee7e70a565b719b2f Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Branch to global symbol results in reference to PLT, and when compiling for THUMB-2 - in a R_ARM_THM_JUMP19 relocation. Some linkers don't support this relocation (ld.gold), while others can end up truncating the relocation to fit (ld.bfd). Convert this branch through PLT into a direct branch that the assembler can resolve locally. See android/ndk#337 for background. The current workaround is to disable neon during gstreamer build, which is not optimal and can be reverted after this patch: https://github.com/freedesktop/gstreamer-cerbero/commit/41556c415739fbc3a72c7eaee7e70a565b719b2f Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit b22db4f) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Branch to global symbol results in reference to PLT, and when compiling for THUMB-2 - in a R_ARM_THM_JUMP19 relocation. Some linkers don't support this relocation (ld.gold), while others can end up truncating the relocation to fit (ld.bfd). Convert this branch through PLT into a direct branch that the assembler can resolve locally. See android/ndk#337 for background. The current workaround is to disable neon during gstreamer build, which is not optimal and can be reverted after this patch: https://github.com/freedesktop/gstreamer-cerbero/commit/41556c415739fbc3a72c7eaee7e70a565b719b2f Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit b22db4f) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
FWIW: I built the test case here with r15c and both Clang and GCC. It fails with Clang and succeeds with GCC. Both toolchains use The |
we've upstreamed fixes to openssl and ffmpeg. there are no R_ARM_THM_JUMP19 relocations in https://gstreamer.freedesktop.org/data/pkg/android/1.14.1/ -Bsymbolic is a workaround for those building old versions of gstreamer from source. |
There's no relocations in the gstreamer 1.14.1 binaries because we disabled neon optimzations in ffmpeg due to this issue. Do you have references to the specific commits in openssl and ffmpeg that fixed this issue? |
Branch to global symbol results in reference to PLT, and when compiling for THUMB-2 - in a R_ARM_THM_JUMP19 relocation. Some linkers don't support this relocation (ld.gold), while others can end up truncating the relocation to fit (ld.bfd). Convert this branch through PLT into a direct branch that the assembler can resolve locally. See android/ndk#337 for background. The current workaround is to disable neon during gstreamer build, which is not optimal and can be reverted after this patch: https://github.com/freedesktop/gstreamer-cerbero/commit/41556c415739fbc3a72c7eaee7e70a565b719b2f Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit b22db4f) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
see rahulchaudhry's comment above for links to the patches. |
Branch to global symbol results in reference to PLT, and when compiling for THUMB-2 - in a R_ARM_THM_JUMP19 relocation. Some linkers don't support this relocation (ld.gold), while others can end up truncating the relocation to fit (ld.bfd). Convert this branch through PLT into a direct branch that the assembler can resolve locally. See android/ndk#337 for background. The current workaround is to disable neon during gstreamer build, which is not optimal and can be reverted after this patch: https://github.com/freedesktop/gstreamer-cerbero/commit/41556c415739fbc3a72c7eaee7e70a565b719b2f Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit b22db4f) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Branch to global symbol results in reference to PLT, and when compiling for THUMB-2 - in a R_ARM_THM_JUMP19 relocation. Some linkers don't support this relocation (ld.gold), while others can end up truncating the relocation to fit (ld.bfd). Convert this branch through PLT into a direct branch that the assembler can resolve locally. See android/ndk#337 for background. The current workaround is to disable neon during gstreamer build, which is not optimal and can be reverted after this patch: https://github.com/freedesktop/gstreamer-cerbero/commit/41556c415739fbc3a72c7eaee7e70a565b719b2f Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit b22db4f) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Branch to global symbol results in reference to PLT, and when compiling for THUMB-2 - in a R_ARM_THM_JUMP19 relocation. Some linkers don't support this relocation (ld.gold), while others can end up truncating the relocation to fit (ld.bfd). Convert this branch through PLT into a direct branch that the assembler can resolve locally. See android/ndk#337 for background. The current workaround is to disable neon during gstreamer build, which is not optimal and can be reverted after this patch: https://github.com/freedesktop/gstreamer-cerbero/commit/41556c415739fbc3a72c7eaee7e70a565b719b2f Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit b22db4f) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Branch to global symbol results in reference to PLT, and when compiling for THUMB-2 - in a R_ARM_THM_JUMP19 relocation. Some linkers don't support this relocation (ld.gold), while others can end up truncating the relocation to fit (ld.bfd). Convert this branch through PLT into a direct branch that the assembler can resolve locally. See android/ndk#337 for background. The current workaround is to disable neon during gstreamer build, which is not optimal and can be reverted after this patch: https://github.com/freedesktop/gstreamer-cerbero/commit/41556c415739fbc3a72c7eaee7e70a565b719b2f Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit b22db4f465c9adb2cf1489e04f7b65ef6bb55b8b) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Description
While compiling a project with the gstreamer SDK:
Environment Details
To reproduce:
Uncommenting the toolchain line in jni/Application.mk to switch to GCC makes the error go away.
Note that you can pretty much ignore all of my code, as the error is coming from trying to link the gstreamer sdk libraries.
The text was updated successfully, but these errors were encountered: