[Cmake-commits] CMake branch, next, updated. v3.7.0-rc2-717-gfddee52

Brad King brad.king at kitware.com
Mon Oct 24 13:57:14 EDT 2016


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  fddee52d5bdf90d806834411062b3af37a6332bc (commit)
       via  4c272adbe1d67af4779f4e72d9562457ed851dac (commit)
       via  6205f1797e33c22ab1f9cda8598d02b24497b806 (commit)
      from  2d4e1942743e5d150076e57b2cc5efef7f9ab115 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fddee52d5bdf90d806834411062b3af37a6332bc
commit fddee52d5bdf90d806834411062b3af37a6332bc
Merge: 2d4e194 4c272ad
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Oct 24 13:57:12 2016 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Oct 24 13:57:12 2016 -0400

    Merge topic 'android-pic' into next
    
    4c272adb Android: Link position-independent executables with proper flags
    6205f179 Android: Set CMAKE_POSITION_INDEPENDENT_CODE automatically


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4c272adbe1d67af4779f4e72d9562457ed851dac
commit 4c272adbe1d67af4779f4e72d9562457ed851dac
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Oct 24 11:45:18 2016 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Oct 24 11:45:18 2016 -0400

    Android: Link position-independent executables with proper flags
    
    Add `-fPIE -pie` to the default executable link flags when
    `CMAKE_POSITION_INDEPENDENT_CODE` is enabled.  This is required by
    Android 16 and above for executables to run on the device.
    
    Closes: #16382

diff --git a/Modules/Platform/Android/abi-common.cmake b/Modules/Platform/Android/abi-common.cmake
index 533bd90..3b0eb01 100644
--- a/Modules/Platform/Android/abi-common.cmake
+++ b/Modules/Platform/Android/abi-common.cmake
@@ -8,6 +8,10 @@ if(NOT DEFINED CMAKE_POSITION_INDEPENDENT_CODE
   set(CMAKE_POSITION_INDEPENDENT_CODE ON)
 endif()
 
+if(CMAKE_POSITION_INDEPENDENT_CODE)
+  string(APPEND _ANDROID_ABI_INIT_EXE_LDFLAGS " -fPIE -pie")
+endif()
+
 string(APPEND _ANDROID_ABI_INIT_EXE_LDFLAGS " -Wl,--gc-sections")
 
 if(NOT _ANDROID_ABI_INIT_EXE_LDFLAGS_NO_nocopyreloc)

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6205f1797e33c22ab1f9cda8598d02b24497b806
commit 6205f1797e33c22ab1f9cda8598d02b24497b806
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Oct 24 11:40:53 2016 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Oct 24 11:40:53 2016 -0400

    Android: Set CMAKE_POSITION_INDEPENDENT_CODE automatically
    
    If the toolchain file or cache does not set this, enable it
    automatically based on the Android API version.  Versions 16
    and above expect position independent code.
    
    Use the main `CMAKE_POSITION_INDEPENDENT_CODE` setting in favor of
    hard-coding `-fpic` or `-fPIC` in the compiler flags for each ABI.
    This allows CMake to use `-fpie` or `-fPIE` as needed when sources
    are meant for executables, and `-fpic` or `-fPIC` for other sources.

diff --git a/Modules/Platform/Android/abi-arm64-v8a-Clang.cmake b/Modules/Platform/Android/abi-arm64-v8a-Clang.cmake
index e56b67b..f4717d5 100644
--- a/Modules/Platform/Android/abi-arm64-v8a-Clang.cmake
+++ b/Modules/Platform/Android/abi-arm64-v8a-Clang.cmake
@@ -1,10 +1,6 @@
 # <ndk>/build/core/toolchains/aarch64-linux-android-clang/setup.mk
 set(_ANDROID_ABI_CLANG_TARGET "aarch64-none-linux-android")
 
-string(APPEND _ANDROID_ABI_INIT_CFLAGS
-  " -fpic"
-  )
-
 # Suppress -Wl,-z,nocopyreloc flag on arm64-v8a
 set(_ANDROID_ABI_INIT_EXE_LDFLAGS_NO_nocopyreloc 1)
 
diff --git a/Modules/Platform/Android/abi-arm64-v8a-GNU.cmake b/Modules/Platform/Android/abi-arm64-v8a-GNU.cmake
index 0bcfc86..b71a674 100644
--- a/Modules/Platform/Android/abi-arm64-v8a-GNU.cmake
+++ b/Modules/Platform/Android/abi-arm64-v8a-GNU.cmake
@@ -1,7 +1,4 @@
 # <ndk>/build/core/toolchains/aarch64-linux-android-4.9/setup.mk
-string(APPEND _ANDROID_ABI_INIT_CFLAGS
-  " -fpic"
-  )
 
 # Suppress -Wl,-z,nocopyreloc flag on arm64-v8a
 set(_ANDROID_ABI_INIT_EXE_LDFLAGS_NO_nocopyreloc 1)
diff --git a/Modules/Platform/Android/abi-armeabi-Clang.cmake b/Modules/Platform/Android/abi-armeabi-Clang.cmake
index 4fc3009..b857bd3 100644
--- a/Modules/Platform/Android/abi-armeabi-Clang.cmake
+++ b/Modules/Platform/Android/abi-armeabi-Clang.cmake
@@ -14,7 +14,6 @@ endif()
 string(APPEND _ANDROID_ABI_INIT_CFLAGS
   " -msoft-float"
   " -mtune=xscale"
-  " -fpic"
   )
 
 include(Platform/Android/abi-common-Clang)
diff --git a/Modules/Platform/Android/abi-armeabi-GNU.cmake b/Modules/Platform/Android/abi-armeabi-GNU.cmake
index 10cac00..33e8b31 100644
--- a/Modules/Platform/Android/abi-armeabi-GNU.cmake
+++ b/Modules/Platform/Android/abi-armeabi-GNU.cmake
@@ -12,7 +12,6 @@ endif()
 string(APPEND _ANDROID_ABI_INIT_CFLAGS
   " -msoft-float"
   " -mtune=xscale"
-  " -fpic"
   )
 
 include(Platform/Android/abi-common-GNU)
diff --git a/Modules/Platform/Android/abi-armeabi-v6-Clang.cmake b/Modules/Platform/Android/abi-armeabi-v6-Clang.cmake
index 15f1d4a..a7412f5 100644
--- a/Modules/Platform/Android/abi-armeabi-v6-Clang.cmake
+++ b/Modules/Platform/Android/abi-armeabi-v6-Clang.cmake
@@ -13,7 +13,6 @@ endif()
 
 string(APPEND _ANDROID_ABI_INIT_CFLAGS
   " -mfloat-abi=softfp"
-  " -fpic"
   )
 
 include(Platform/Android/abi-common-Clang)
diff --git a/Modules/Platform/Android/abi-armeabi-v6-GNU.cmake b/Modules/Platform/Android/abi-armeabi-v6-GNU.cmake
index 7492de0..1fda184 100644
--- a/Modules/Platform/Android/abi-armeabi-v6-GNU.cmake
+++ b/Modules/Platform/Android/abi-armeabi-v6-GNU.cmake
@@ -11,7 +11,6 @@ endif()
 
 string(APPEND _ANDROID_ABI_INIT_CFLAGS
   " -mfloat-abi=softfp"
-  " -fpic"
   )
 
 include(Platform/Android/abi-common-GNU)
diff --git a/Modules/Platform/Android/abi-armeabi-v7a-Clang.cmake b/Modules/Platform/Android/abi-armeabi-v7a-Clang.cmake
index 3a3efb3..e2ab58b 100644
--- a/Modules/Platform/Android/abi-armeabi-v7a-Clang.cmake
+++ b/Modules/Platform/Android/abi-armeabi-v7a-Clang.cmake
@@ -23,7 +23,6 @@ string(APPEND _ANDROID_ABI_INIT_LDFLAGS
 
 string(APPEND _ANDROID_ABI_INIT_CFLAGS
   " -mfloat-abi=softfp"
-  " -fpic"
   )
 
 include(Platform/Android/abi-common-Clang)
diff --git a/Modules/Platform/Android/abi-armeabi-v7a-GNU.cmake b/Modules/Platform/Android/abi-armeabi-v7a-GNU.cmake
index d27e37e..b7c328d 100644
--- a/Modules/Platform/Android/abi-armeabi-v7a-GNU.cmake
+++ b/Modules/Platform/Android/abi-armeabi-v7a-GNU.cmake
@@ -17,7 +17,6 @@ endif()
 
 string(APPEND _ANDROID_ABI_INIT_CFLAGS
   " -mfloat-abi=softfp"
-  " -fpic"
   )
 
 string(APPEND _ANDROID_ABI_INIT_LDFLAGS
diff --git a/Modules/Platform/Android/abi-common.cmake b/Modules/Platform/Android/abi-common.cmake
index 84e7dbd..533bd90 100644
--- a/Modules/Platform/Android/abi-common.cmake
+++ b/Modules/Platform/Android/abi-common.cmake
@@ -3,6 +3,11 @@ string(APPEND _ANDROID_ABI_INIT_CFLAGS
   " -no-canonical-prefixes"
   )
 
+if(NOT DEFINED CMAKE_POSITION_INDEPENDENT_CODE
+    AND NOT CMAKE_SYSTEM_VERSION VERSION_LESS 16)
+  set(CMAKE_POSITION_INDEPENDENT_CODE ON)
+endif()
+
 string(APPEND _ANDROID_ABI_INIT_EXE_LDFLAGS " -Wl,--gc-sections")
 
 if(NOT _ANDROID_ABI_INIT_EXE_LDFLAGS_NO_nocopyreloc)
diff --git a/Modules/Platform/Android/abi-mips-Clang.cmake b/Modules/Platform/Android/abi-mips-Clang.cmake
index bf6b9fc..73addde 100644
--- a/Modules/Platform/Android/abi-mips-Clang.cmake
+++ b/Modules/Platform/Android/abi-mips-Clang.cmake
@@ -1,8 +1,4 @@
 # <ndk>/build/core/toolchains/mipsel-linux-android-clang/setup.mk
 set(_ANDROID_ABI_CLANG_TARGET "mipsel-none-linux-android")
 
-string(APPEND _ANDROID_ABI_INIT_CFLAGS
-  " -fpic"
-  )
-
 include(Platform/Android/abi-common-Clang)
diff --git a/Modules/Platform/Android/abi-mips-GNU.cmake b/Modules/Platform/Android/abi-mips-GNU.cmake
index d380440..982ad46 100644
--- a/Modules/Platform/Android/abi-mips-GNU.cmake
+++ b/Modules/Platform/Android/abi-mips-GNU.cmake
@@ -1,6 +1,3 @@
 # <ndk>/build/core/toolchains/mipsel-linux-android-4.9/setup.mk
-string(APPEND _ANDROID_ABI_INIT_CFLAGS
-  " -fpic"
-  )
 
 include(Platform/Android/abi-common-GNU)
diff --git a/Modules/Platform/Android/abi-mips64-Clang.cmake b/Modules/Platform/Android/abi-mips64-Clang.cmake
index 1a94107..603f1b2 100644
--- a/Modules/Platform/Android/abi-mips64-Clang.cmake
+++ b/Modules/Platform/Android/abi-mips64-Clang.cmake
@@ -1,8 +1,4 @@
 # <ndk>/build/core/toolchains/mips64el-linux-android-clang/setup.mk
 set(_ANDROID_ABI_CLANG_TARGET "mips64el-none-linux-android")
 
-string(APPEND _ANDROID_ABI_INIT_CFLAGS
-  " -fpic"
-  )
-
 include(Platform/Android/abi-common-Clang)
diff --git a/Modules/Platform/Android/abi-mips64-GNU.cmake b/Modules/Platform/Android/abi-mips64-GNU.cmake
index 4525d40..a1bc2c2 100644
--- a/Modules/Platform/Android/abi-mips64-GNU.cmake
+++ b/Modules/Platform/Android/abi-mips64-GNU.cmake
@@ -1,6 +1,3 @@
 # <ndk>/build/core/toolchains/mips64el-linux-android-4.9/setup.mk
-string(APPEND _ANDROID_ABI_INIT_CFLAGS
-  " -fpic"
-  )
 
 include(Platform/Android/abi-common-GNU)
diff --git a/Modules/Platform/Android/abi-x86-Clang.cmake b/Modules/Platform/Android/abi-x86-Clang.cmake
index f63ed36..fe7eace 100644
--- a/Modules/Platform/Android/abi-x86-Clang.cmake
+++ b/Modules/Platform/Android/abi-x86-Clang.cmake
@@ -1,8 +1,4 @@
 # <ndk>/build/core/toolchains/x86-clang/setup.mk
 set(_ANDROID_ABI_CLANG_TARGET "i686-none-linux-android")
 
-string(APPEND _ANDROID_ABI_INIT_CFLAGS
-  " -fPIC"
-  )
-
 include(Platform/Android/abi-common-Clang)
diff --git a/Modules/Platform/Android/abi-x86_64-Clang.cmake b/Modules/Platform/Android/abi-x86_64-Clang.cmake
index c15042b..3cbcd49 100644
--- a/Modules/Platform/Android/abi-x86_64-Clang.cmake
+++ b/Modules/Platform/Android/abi-x86_64-Clang.cmake
@@ -1,8 +1,4 @@
 # <ndk>/build/core/toolchains/x86_64-clang/setup.mk
 set(_ANDROID_ABI_CLANG_TARGET "x86_64-none-linux-android")
 
-string(APPEND _ANDROID_ABI_INIT_CFLAGS
-  " -fPIC"
-  )
-
 include(Platform/Android/abi-common-Clang)

-----------------------------------------------------------------------

Summary of changes:
 Modules/Platform/Android/abi-arm64-v8a-Clang.cmake   |    4 ----
 Modules/Platform/Android/abi-arm64-v8a-GNU.cmake     |    3 ---
 Modules/Platform/Android/abi-armeabi-Clang.cmake     |    1 -
 Modules/Platform/Android/abi-armeabi-GNU.cmake       |    1 -
 Modules/Platform/Android/abi-armeabi-v6-Clang.cmake  |    1 -
 Modules/Platform/Android/abi-armeabi-v6-GNU.cmake    |    1 -
 Modules/Platform/Android/abi-armeabi-v7a-Clang.cmake |    1 -
 Modules/Platform/Android/abi-armeabi-v7a-GNU.cmake   |    1 -
 Modules/Platform/Android/abi-common.cmake            |    9 +++++++++
 Modules/Platform/Android/abi-mips-Clang.cmake        |    4 ----
 Modules/Platform/Android/abi-mips-GNU.cmake          |    3 ---
 Modules/Platform/Android/abi-mips64-Clang.cmake      |    4 ----
 Modules/Platform/Android/abi-mips64-GNU.cmake        |    3 ---
 Modules/Platform/Android/abi-x86-Clang.cmake         |    4 ----
 Modules/Platform/Android/abi-x86_64-Clang.cmake      |    4 ----
 15 files changed, 9 insertions(+), 35 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list