diff options
author | Brad King <brad.king@kitware.com> | 2016-10-24 14:16:37 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2016-10-24 14:16:37 (GMT) |
commit | 3d5ec790eea47a91c6f70d172c42839db02b8467 (patch) | |
tree | e0e705e3b4554f60e136831f3f3bfc7220ecdde3 | |
parent | 1ae2c232b652b69bb7605eae765a86c3bb520b8f (diff) | |
parent | 295c8efa359cbee22e45e6e9358990209b35aa39 (diff) | |
download | CMake-3d5ec790eea47a91c6f70d172c42839db02b8467.zip CMake-3d5ec790eea47a91c6f70d172c42839db02b8467.tar.gz CMake-3d5ec790eea47a91c6f70d172c42839db02b8467.tar.bz2 |
Merge topic 'android-link-exe'
295c8efa Android: Add missing link flags for device executables
-rw-r--r-- | Modules/Platform/Android-Common.cmake | 4 | ||||
-rw-r--r-- | Modules/Platform/Android/abi-arm64-v8a-Clang.cmake | 3 | ||||
-rw-r--r-- | Modules/Platform/Android/abi-arm64-v8a-GNU.cmake | 3 | ||||
-rw-r--r-- | Modules/Platform/Android/abi-common.cmake | 6 |
4 files changed, 16 insertions, 0 deletions
diff --git a/Modules/Platform/Android-Common.cmake b/Modules/Platform/Android-Common.cmake index 6544696..8755d4f 100644 --- a/Modules/Platform/Android-Common.cmake +++ b/Modules/Platform/Android-Common.cmake @@ -107,6 +107,7 @@ set(_ANDROID_ABI_INIT_CFLAGS "") set(_ANDROID_ABI_INIT_CFLAGS_DEBUG "") set(_ANDROID_ABI_INIT_CFLAGS_RELEASE "") set(_ANDROID_ABI_INIT_LDFLAGS "") +set(_ANDROID_ABI_INIT_EXE_LDFLAGS "") macro(__android_compiler_common lang) if(_ANDROID_ABI_INIT_CFLAGS) @@ -125,6 +126,9 @@ macro(__android_compiler_common lang) string(APPEND CMAKE_${t}_LINKER_FLAGS_INIT " ${_ANDROID_ABI_INIT_LDFLAGS}") endforeach() endif() + if(_ANDROID_ABI_INIT_EXE_LDFLAGS) + string(APPEND CMAKE_EXE_LINKER_FLAGS_INIT " ${_ANDROID_ABI_INIT_EXE_LDFLAGS}") + endif() if(DEFINED _ANDROID_STL_EXCEPTIONS) if(_ANDROID_STL_EXCEPTIONS) diff --git a/Modules/Platform/Android/abi-arm64-v8a-Clang.cmake b/Modules/Platform/Android/abi-arm64-v8a-Clang.cmake index 3ff1fe5..e56b67b 100644 --- a/Modules/Platform/Android/abi-arm64-v8a-Clang.cmake +++ b/Modules/Platform/Android/abi-arm64-v8a-Clang.cmake @@ -5,4 +5,7 @@ string(APPEND _ANDROID_ABI_INIT_CFLAGS " -fpic" ) +# Suppress -Wl,-z,nocopyreloc flag on arm64-v8a +set(_ANDROID_ABI_INIT_EXE_LDFLAGS_NO_nocopyreloc 1) + include(Platform/Android/abi-common-Clang) diff --git a/Modules/Platform/Android/abi-arm64-v8a-GNU.cmake b/Modules/Platform/Android/abi-arm64-v8a-GNU.cmake index 538ec2f..0bcfc86 100644 --- a/Modules/Platform/Android/abi-arm64-v8a-GNU.cmake +++ b/Modules/Platform/Android/abi-arm64-v8a-GNU.cmake @@ -3,4 +3,7 @@ string(APPEND _ANDROID_ABI_INIT_CFLAGS " -fpic" ) +# Suppress -Wl,-z,nocopyreloc flag on arm64-v8a +set(_ANDROID_ABI_INIT_EXE_LDFLAGS_NO_nocopyreloc 1) + include(Platform/Android/abi-common-GNU) diff --git a/Modules/Platform/Android/abi-common.cmake b/Modules/Platform/Android/abi-common.cmake index 12d8e5c..84e7dbd 100644 --- a/Modules/Platform/Android/abi-common.cmake +++ b/Modules/Platform/Android/abi-common.cmake @@ -2,3 +2,9 @@ string(APPEND _ANDROID_ABI_INIT_CFLAGS " -funwind-tables" " -no-canonical-prefixes" ) + +string(APPEND _ANDROID_ABI_INIT_EXE_LDFLAGS " -Wl,--gc-sections") + +if(NOT _ANDROID_ABI_INIT_EXE_LDFLAGS_NO_nocopyreloc) + string(APPEND _ANDROID_ABI_INIT_EXE_LDFLAGS " -Wl,-z,nocopyreloc") +endif() |