Error compiling: unsupported reloc 43 against global symbol

3,623 views
Skip to first unread message

Dimitrios Pappas

unread,
Mar 2, 2016, 8:44:27 AM3/2/16
to Android-x86
Building on Arch Linux. Both x86 and x86_64 give me following error:

external/libunwind/src/x86/Gos-linux.c:301: warning: warning: sigreturn is not implemented and will always fail
external/libunwind/src/x86/Gos-linux.c:301: warning: warning: sigreturn is not implemented and will always fail
prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.8//x86_64-linux/bin/ld: error: out/host/linux-x86/obj32/SHARED_LIBRARIES/libnativehelper_intermediates/JNIHelp.o: unsupported reloc 43 against global symbol std::string::_Rep::_S_empty_rep_storage
prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.8//x86_64-linux/bin/ld: error: out/host/linux-x86/obj32/SHARED_LIBRARIES/libnativehelper_intermediates/JNIHelp.o: unsupported reloc 43 against global symbol std::string::_Rep::_S_empty_rep_storage
prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.8//x86_64-linux/bin/ld: error: out/host/linux-x86/obj32/SHARED_LIBRARIES/libnativehelper_intermediates/JNIHelp.o: unsupported reloc 43 against global symbol std::string::_Rep::_S_empty_rep_storage

....


prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.8//x86_64-linux/bin/ld: error: out/host/linux-x86/obj32/SHARED_LIBRARIES/libnativehelper_intermediates/JniInvocation.o: unsupported reloc 43 against global symbol JniInvocation::jni_invocation_
prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.8//x86_64-linux/bin/ld: error: out/host/linux-x86/obj32/SHARED_LIBRARIES/libnativehelper_intermediates/JniInvocation.o: unsupported reloc 43 against global symbol JniInvocation::jni_invocation_
prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.8//x86_64-linux/include/c++/4.8/bits/basic_string.h:275: error: unsupported reloc 43
prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.8//x86_64-linux/include/c++/4.8/bits/basic_string.h:275: error: unsupported reloc 43
prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.8//x86_64-linux/include/c++/4.8/bits/basic_string.h:240: error: unsupported reloc 43
prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.8//x86_64-linux/include/c++/4.8/bits/basic_string.h:240: error: unsupported reloc 43
libnativehelper/JNIHelp.cpp:310: error: unsupported reloc 43
libnativehelper/JNIHelp.cpp:311: error: unsupported reloc 43
libnativehelper/JNIHelp.cpp:332: error: unsupported reloc 43
libnativehelper/JNIHelp.cpp:322: error: unsupported reloc 43
libnativehelper/JNIHelp.cpp:338: error: unsupported reloc 43
libnativehelper/JniConstants.cpp:89: error: unsupported reloc 43
libnativehelper/JniConstants.cpp:90: error: unsupported reloc 43

...

libnativehelper/JniInvocation.cpp:165: error: unsupported reloc 43
clang: error: linker command failed with exit code 1 (use -v to see invocation)
build/core/host_shared_library_internal.mk:44: recipe for target 'out/host/linux-x86/obj32/lib/libnativehelper.so' failed
make: *** [out/host/linux-x86/obj32/lib/libnativehelper.so] Error 1


Is this some problem with the toolchain? I just synced the lollipop-x86 branch and tried to compile it with
. /build/envsetup.sh
lunch (select either 8 or 11 for userdebug)
make -j4 iso_img

Thanks in advance

Carlos Zicos

unread,
Mar 13, 2016, 9:35:58 PM3/13/16
to Android-x86
Hello,

I'm facing the same problem. I tried several things like using gcc instead of clang, downgrading gcc with no success.
Did you get some clues ?

Thanks in advance

Dimitrios Pappas

unread,
Mar 15, 2016, 8:34:54 PM3/15/16
to Android-x86
I just skipped the lollipop-x86 branch and synced marshmallow-x86. This one compiles without errors. However, you have to disable host clang as described here: http://review.cyanogenmod.org/#/c/120824/. Otherwise you will run into problems while compiling ART.

Carlos Zicos

unread,
Mar 16, 2016, 7:19:49 AM3/16/16
to Android-x86
Thanks for ypur suggestion. Actually I was already trying this (eg GCC instead CLANG) but finally got other problems later during compilation (and needed to remove some cflags unknown by gcc...).
I also first tried marsmallow, which compiled effortlessly but currently I just need lollipop for some project.

I think I found some problem : in lollipop tree, prebuilt clang is elf-32, but elf-64 in marshmallow tree. Because I'm building 64 bits android (on 64 bit system), the 64 bits objects (*.o) are problems for the elf-32 linker.
To be confirmed...

Le mercredi 2 mars 2016 14:44:27 UTC+1, Dimitrios Pappas a écrit :

TheKit

unread,
Mar 16, 2016, 9:52:25 PM3/16/16
to Android-x86
So far I was able to compile Lollipop on Arch Linux only using Ubuntu 14.04 chroot. The same problem with "unsupported reloc" otherwise. It seems latest version of something on host (GCC/binutils?) clashes with Android build.

среда, 16 марта 2016 г., 19:19:49 UTC+8 пользователь Carlos Zicos написал:

jiaya...@intel.com

unread,
May 26, 2016, 6:40:58 AM5/26/16
to Android-x86
Please check your gcc version following the Wiki here : https://source.android.com/source/initializing.html.  Try 
Even though Ubuntu is not necessary, but it do save you a lot of time. 


Reply all
Reply to author
Forward
0 new messages