Failed Android build: “error: relocation overflow in R_ARM_THM_CALL”

http://discuss.cocos2d-x.org/t/failed-android-build-error-relocation-overflow-in-r-arm-thm-call/17932

1

 of 

12

 

I use Code IDE to build default project for Android
MacOS Yosemite
NDK - android-ndk-r9d
Code IDE - 1.0.1

/js-bindings/cocos2d-x/external/curl/prebuilt/android/armeabi/libcurl.a(url.o):function IsPipeliningPossible: error: relocation overflow in R_ARM_THM_CALL
/js-bindings/cocos2d-x/external/curl/prebuilt/android/armeabi/libcurl.a(url.o):function fix_hostname.isra.1: error: relocation overflow in R_ARM_THM_CALL

Build log
/Volumes/StorageSSD/dvlp/cocos2d_projects/MyProject/frameworks/runtime-src/proj.android/../../js-bindings/cocos2d-x/cocos/platform/android/../../2d/CCDrawingPrimitives.h:82:41: note: 'init' declared here
CC_DEPRECATED_ATTRIBUTE void CC_DLL init();
^
[armeabi] Compile++ thumb: cocos2dxandroid_static <= Java_org_cocos2dx_lib_Cocos2dxAccelerometer.cpp
1 warning generated.
[armeabi] Compile++ thumb: cocos2dxandroid_static <= Java_org_cocos2dx_lib_Cocos2dxBitmap.cpp
[armeabi] Compile++ thumb: cocos2dxandroid_static <= Java_org_cocos2dx_lib_Cocos2dxHelper.cpp
[armeabi] Compile++ thumb: cocos2dxandroid_static <= Java_org_cocos2dx_lib_Cocos2dxRenderer.cpp
[armeabi] Compile++ thumb: cocos2dxandroid_static <= JniHelper.cpp
[armeabi] Compile++ thumb: cocos2dxandroid_static <= TouchesJni.cpp
[armeabi] Compile thumb : cpufeatures <= cpu-features.c
[armeabi] StaticLibrary : libcocos2dxjsb.a
[armeabi] StaticLibrary : liblocalstorage.a
[armeabi] StaticLibrary : libcocostudio.a
[armeabi] StaticLibrary : libcocosbuilder.a
[armeabi] StaticLibrary : libcocos3d.a
[armeabi] StaticLibrary : libspine.a
[armeabi] StaticLibrary : libnetwork.a
[armeabi] StaticLibrary : libaudioengine.a
[armeabi] StaticLibrary : libui.a
[armeabi] StaticLibrary : libcocosdenshion.a
[armeabi] StaticLibrary : libprotobuf-lite.a
[armeabi] StaticLibrary : libextension.a
[armeabi] StaticLibrary : libcocos2dxinternal.a
[armeabi] StaticLibrary : libbox2d.a
[armeabi] StaticLibrary : libcpufeatures.a
[armeabi] StaticLibrary : libcocos2dandroid.a
[armeabi] SharedLibrary : libcocos2djs.so
/Volumes/StorageSSD/dvlp/cocos2d_projects/MyProject/frameworks/runtime-src/proj.android/../../js-bindings/cocos2d-x/external/curl/prebuilt/android/armeabi/libcurl.a(url.o):function IsPipeliningPossible: error: relocation overflow in R_ARM_THM_CALL
/Volumes/StorageSSD/dvlp/cocos2d_projects/MyProject/frameworks/runtime-src/proj.android/../../js-bindings/cocos2d-x/external/curl/prebuilt/android/armeabi/libcurl.a(url.o):function fix_hostname.isra.1: error: relocation overflow in R_ARM_THM_CALL
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [obj/local/armeabi/libcocos2djs.so] Error 1
make: Leaving directory `/Volumes/StorageSSD/dvlp/cocos2d_projects/MyProject/frameworks/runtime-src/proj.android'
Running command: compile
Building mode: debug
running: '/Volumes/StorageSSD/dvlp/tool/android/android_sdk/hidden/android-sdk-macosx/tools/android update project -t android-20 -p /Volumes/StorageSSD/dvlp/cocos2d_projects/MyProject/frameworks/runtime-src/proj.android'

running: '/Volumes/StorageSSD/dvlp/tool/android/android_sdk/hidden/android-sdk-macosx/tools/android update lib-project -p /Volumes/StorageSSD/dvlp/cocos2d_projects/MyProject/frameworks/runtime-src/proj.android/../../js-bindings/cocos2d-x/cocos/platform/android/java -t android-20'

building native
NDK build mode: release
running: '/Volumes/StorageSSD/dvlp/tool/android/android_sdk/hidden/android-ndk-r9d/ndk-build -C /Volumes/StorageSSD/dvlp/cocos2d_projects/MyProject/frameworks/runtime-src/proj.android -j3 NDK_MODULE_PATH=/Volumes/StorageSSD/dvlp/cocos2d_projects/MyProject/frameworks/runtime-src/proj.android/../../js-bindings:/Volumes/StorageSSD/dvlp/cocos2d_projects/MyProject/frameworks/runtime-src/proj.android/../../js-bindings/cocos2d-x:/Volumes/StorageSSD/dvlp/cocos2d_projects/MyProject/frameworks/runtime-src/proj.android/../../js-bindings/cocos2d-x/cocos:/Volumes/StorageSSD/dvlp/cocos2d_projects/MyProject/frameworks/runtime-src/proj.android/../../js-bindings/cocos2d-x/external'

Ndk build failed!

Solution: 
Add 
LOCAL_ARM_MODE := arm
to files
/runtime-scr/proj.android/jni/Android.mk 
/js-bindings/bindings/Android.mk

Thanks for ucchen post

1Reply
1 person liked this.
  • created

    27 Oct
  • last post

    8 Nov
  • 12

    posts

  • 485

    views

  • 5

    users

  •  2

    likes

  • 4

    links

  • 5
    3
    2
  • Package the apk failed with the js binding1

I have the same issue, please help!

chapay said:

IsPipeliningPossible

i have same issue~~ why?

I tried with 
Code IDE 1.0 + NDK - android-ndk-r10
Code IDE 1.0 + NDK - android-ndk-r9d

all times have this issue (((

when i build debug android package, it is ok, but build release android package, it is fail.

last i have found soluction, add "LOCAL_ARM_MODE := arm" to /runtime-scr/proj.android/jni/Android.mk /js-bindings/bindings/Android.mk. it will be compile success.

but i don't know why use 32bit order set will be ok.

1 person liked this.

thanks it's work for me

@pandamicro @ludingping 
why cocos2d-x js 3.1 rc0 compile android release version show this "error: relocation overflow in R_ARM_THM_CALL " and compile debug version is ok . after add "LOCAL_ARM_MODE := arm", compile release version success. what different between arm and thumd ?

I found this topic
It's seem very informative

stackoverflow.com  19

Producing optimised NDK code for multiple architectures?

asked by  rbcc on  05:41AM - 23 Feb 11
android, c, gcc, jni

ARM processors have 2 general instruction sets that they support: "ARM" and "Thumb". Though there are different flavors of both, ARM instructions are 32 bits each and Thumb instructions are 16 bits. The main difference between the two is that ARM instructions have the possibility to do more in a single instruction than Thumb can. For example a single ARM instruction can add one register to another register, while performing a left shift on the second register. In Thumb one instruction would have to do the shift, then a second instruction would do the addition.
............

i tried to make apk for HelloWorld application.

i tried to make app using with and without LOCAL_ARM_MODE := arm but could not get success.

Please help.
error files.zip (10.4 KB)

I fixed issue with next environment
MacOS Yosemite
NDK - android-ndk-r9d
Code IDE - 1.0.1

I found ndk-r10c in your log 
Please try use android-ndk-r9d

Thanks Chapay.

I am able to build now.

After ading LOCAL_ARM_MODE := arm in files, i still have this problem..
My env : cocos2D-js 3.1, windows 8.1 64 bits, android ndk r9d.

cocos compile -p android works
cocos compile -p android -m release crash

Log :

...
[armeabi] StaticLibrary : libcocos2dxinternal.a
[armeabi] StaticLibrary : libbox2d.a
[armeabi] StaticLibrary : libcpufeatures.a
[armeabi] StaticLibrary : libcocos2dandroid.a
[armeabi] SharedLibrary : libcocos2djs.so
d:\Documents\Dev\cocos2d\myproj\frameworks\runtime-src\proj.android../../js-bindings/cocos2d-x/external/curl/prebuilt/android/armeabi/libcurl.a(url.o):function IsPipeliningPossible: error: relocation overflow in R_ARM_THM_CALL
d:\Documents\Dev\cocos2d\myproj\frameworks\runtime-src\proj.android../../js-bindings/cocos2d-x/external/curl/prebuilt/android/armeabi/libcurl.a(url.o):function fix_hostname.isra.1: error: relocation overflow in R_ARM_THM_CALL
clang++.exe: error: linker command failed with exit code 1 (use -v to see invocation)
make.exe: *** [obj/local/armeabi/libcocos2djs.so] Error 1
make.exe: Leaving directory `d:/Documents/Dev/cocos2d/myproj/frameworks/runtime-src/proj.android'
Ndk build failed!

I don't know why 

EDIT : I created a project with cocos console and copy/past my old source in new project. Compilation with release mode works. Problem solved 


你可能感兴趣的:(Failed Android build: “error: relocation overflow in R_ARM_THM_CALL”)