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

compiling error with NDK r12b: relocation overflow in R_ARM_THM_CALL #152

Closed
minggo opened this issue Jul 8, 2016 · 11 comments
Closed

compiling error with NDK r12b: relocation overflow in R_ARM_THM_CALL #152

minggo opened this issue Jul 8, 2016 · 11 comments

Comments

@minggo
Copy link

minggo commented Jul 8, 2016

steps to reproduce it

  • download cocos2d-x v3.12
  • un-compress the zip file and run ./setup.py to set up some environment (doesn't support python 3)
  • enter cocos2d-x/tests/cpp-tests
  • run cocos compile -p android
  • then will met the problem

My environment:

  • Mac OS X 10.11.4
  • ndk r12b
@DanAlbert
Copy link
Member

$ cocos compile -p android
Building mode: debug
Using Eclipse project : /work/src/cocos2d-x-3.12/tests/cpp-tests/proj.android
Android platform not specified, searching a default one...
running: '/usr/local/google/home/danalbert/android-sdk-linux/tools/android update project -t android-10 -p /work/src/cocos2d-x-3.12/tests/cpp-tests/proj.android'

Updated project.properties
Updated local.properties
Updated file /work/src/cocos2d-x-3.12/tests/cpp-tests/proj.android/proguard-project.txt
Android platform not specified, searching a default one...
running: '/usr/local/google/home/danalbert/android-sdk-linux/tools/android update lib-project -p /work/src/cocos2d-x-3.12/cocos/platform/android/java -t android-19'

Updated project.properties
Updated local.properties
Updated file /work/src/cocos2d-x-3.12/cocos/platform/android/java/proguard-project.txt
Building native...
NDK build mode: debug
running: '/work/src/android-ndk-r12b/ndk-build -C /work/src/cocos2d-x-3.12/tests/cpp-tests/proj.android -j48 NDK_MODULE_PATH=/work/src/cocos2d-x-3.12/tests/cpp-tests/proj.android/../../..:/work/src/cocos2d-x-3.12/tests/cpp-tests/proj.android/../../../cocos:/work/src/cocos2d-x-3.12/tests/cpp-tests/proj.android/../../../external NDK_TOOLCHAIN_VERSION=clang NDK_DEBUG=1'

Android NDK: ERROR:/work/src/cocos2d-x-3.12/tests/cpp-tests/proj.android/../../../external/freetype2/prebuilt/android/Android.mk:cocos_freetype2_static: LOCAL_SRC_FILES points to a missing file
Android NDK: Check that /work/src/cocos2d-x-3.12/tests/cpp-tests/proj.android/../../../external/freetype2/prebuilt/android/arm64-v8a/libfreetype.a exists  or that its path is correct
make: Entering directory `/work/src/cocos2d-x-3.12/tests/cpp-tests/proj.android'
/work/src/android-ndk-r12b/build/core/prebuilt-library.mk:45: *** Android NDK: Aborting    .  Stop.
make: Leaving directory `/work/src/cocos2d-x-3.12/tests/cpp-tests/proj.android'

@DanAlbert
Copy link
Member

That error usually means that one of the binaries being linked is simply too large and that jump/relocation address simply can't fit in the instruction.

@minggo
Copy link
Author

minggo commented Jul 27, 2016

@DanAlbert thanks for testing, it is strange, all developers and me don't meet the compiling error. Now i added LOCAL_ARM_MODE := arm in all Android.mk to fix the issue. But i am not sure if it is the right way to fix it.

@minggo
Copy link
Author

minggo commented Jul 27, 2016

@DanAlbert Could you please use cocos compile -p android --app-abi armeabi to compile the codes, i think it will fix the compiling error. Thanks.

@minggo
Copy link
Author

minggo commented Jul 27, 2016

fixed in #16223

@minggo minggo closed this as completed Jul 27, 2016
@minggo minggo reopened this Jul 27, 2016
@DanAlbert
Copy link
Member

@shenhanc78: repros for me with both gold and bfd. Is there anything that can be done about this?

@minggo: I don't have this problem when building for armeabi-v7a. This might just be a matter of Thumb-1 being insufficient (in which case I think the LOCAL_ARM_MODE fix you applied is the best you can do for this)

@minggo
Copy link
Author

minggo commented Aug 15, 2016

@DanAlbert yep, it seems only has problem with armeabi. So you mean the correct way is to add LOCAL_ARM_EABI=arm?

@DanAlbert
Copy link
Member

Yeah, but you might want to do that only for armeabi, not armeabi-v7a. Thumb-2 can encode much larger offsets.

@minggo
Copy link
Author

minggo commented Aug 16, 2016

@DanAlbert thanks. But i don't quite understand that Thumb-2 can encode much larger offsets.. What's the side effect of it?

@enh
Copy link
Contributor

enh commented Aug 16, 2016

arm/thumb/thumb2 are different instruction sets. see "branch" on page 3 of http://infocenter.arm.com/help/topic/com.arm.doc.qrc0001l/QRC0001_UAL.pdf for the ranges of the available branch instructions. (T being thumb and T2 thumb2.)

@minggo
Copy link
Author

minggo commented Aug 16, 2016

Yep, i know they are different instructions set. I just want to know what will happen if i use LOCAL_ARM_EABI=arm for armeabi-v7a? Affect package size or low performance or other error?

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

3 participants