taka-no-me / android-cmake

CMake toolchain file and other scripts for the Android NDK
1.22k stars 437 forks source link

ARM64 relocation error due to default linker flags #28

Closed opatry closed 9 years ago

opatry commented 9 years ago

Hi,

it seems that the default linker flags breaks the ARM 64 build available since NDK r10 (cf. PR 23).

set( CMAKE_EXE_LINKER_FLAGS    "-Wl,-z,nocopyreloc"      CACHE STRING "executable linker flags" )

should be replaced with

set( CMAKE_EXE_LINKER_FLAGS    ""      CACHE STRING "executable linker flags" )

It fixes the relocation/link issue on ARM64 and had no incidence on other architectures. Maybe it should be defined according to current architecture and disabled only for ARM64?

Android NDK related post https://groups.google.com/forum/#!topic/android-ndk/-ajpz2E-BEE + extracted project https://bitbucket.org/opatry/ndk10_armv8a_bug

opatry commented 9 years ago

Using the master branch instead of the mentioned PR 23, everything goes well despite the -Wl,-z,nocopyreloc linker flag.