[Cmake-commits] CMake branch, master, updated. v3.15.0-rc1-123-g5773f12

Kitware Robot kwrobot at kitware.com
Wed Jun 19 08:23:09 EDT 2019


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, master has been updated
       via  5773f12d849815c0a61f09e622e90dd56fb4f333 (commit)
       via  9e99a95c7db5be8c6b979b0170ab4cf78bb32307 (commit)
      from  7ccd9a27df8649c17d7b6925851d4e258ea913d9 (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=5773f12d849815c0a61f09e622e90dd56fb4f333
commit 5773f12d849815c0a61f09e622e90dd56fb4f333
Merge: 7ccd9a2 9e99a95
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Jun 19 12:22:05 2019 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Wed Jun 19 08:22:17 2019 -0400

    Merge topic 'android-pie-cmp0083'
    
    9e99a95c7d Android: ensure PIE behavior is consistent regardless CMP0083 policy
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !3459


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9e99a95c7db5be8c6b979b0170ab4cf78bb32307
commit 9e99a95c7db5be8c6b979b0170ab4cf78bb32307
Author:     Marc Chevrier <marc.chevrier at gmail.com>
AuthorDate: Tue Jun 18 17:34:19 2019 +0200
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Wed Jun 19 08:12:45 2019 -0400

    Android: ensure PIE behavior is consistent regardless CMP0083 policy
    
    In commit c4b4d8b3a6 (POSITION_INDEPENDENT_CODE: Manage link flags for
    executables, 2018-10-02, v3.14.0-rc1~395^2) we accidentally removed our
    Android-specific logic for PIE under the CMP0083 OLD behavior.  Restore
    it and also implement Android-specific logic for CMP0083 NEW behavior.
    
    Fixes: #19393

diff --git a/Help/policy/CMP0083.rst b/Help/policy/CMP0083.rst
index 32acf1f..e0b09cf 100644
--- a/Help/policy/CMP0083.rst
+++ b/Help/policy/CMP0083.rst
@@ -28,6 +28,12 @@ This policy was introduced in CMake version 3.14. Use the
 Unlike most policies, CMake version |release| does not warn when this policy is
 not set and simply uses ``OLD`` behavior.
 
+.. Note::
+
+   Android platform has a special handling of ``PIE`` so it is not required
+   to use the :module:`CheckPIESupported` module to ensure flags are passed to
+   the linker.
+
 .. include:: DEPRECATED.txt
 
 Examples
diff --git a/Modules/Platform/Android/abi-common.cmake b/Modules/Platform/Android/abi-common.cmake
index a0b47f4..6bce3c7 100644
--- a/Modules/Platform/Android/abi-common.cmake
+++ b/Modules/Platform/Android/abi-common.cmake
@@ -12,6 +12,26 @@ if(NOT DEFINED CMAKE_POSITION_INDEPENDENT_CODE
   set(CMAKE_POSITION_INDEPENDENT_CODE ON)
 endif()
 
+cmake_policy(GET CMP0083 _CMP0083)
+if(_CMP0083 STREQUAL NEW)
+  # PIE Flags are managed by compiler configuration files
+  if(CMAKE_SYSTEM_VERSION VERSION_GREATER_EQUAL 16)
+    # ensure PIE flags are passed to the linker
+    set(CMAKE_C_LINK_PIE_SUPPORTED YES CACHE INTERNAL "PIE (C)")
+    set(CMAKE_CXX_LINK_PIE_SUPPORTED YES CACHE INTERNAL "PIE (CXX)")
+    if(CMAKE_SYSTEM_VERSION VERSION_GREATER_EQUAL 21)
+      # no PIE executable are no longer supported
+      set(CMAKE_C_LINK_NO_PIE_SUPPORTED NO CACHE INTERNAL "NO_PIE (C)")
+      set(CMAKE_CXX_LINK_NO_PIE_SUPPORTED NO CACHE INTERNAL "NO_PIE (CXX)")
+    endif()
+  endif()
+else()
+  if(CMAKE_POSITION_INDEPENDENT_CODE)
+    string(APPEND _ANDROID_ABI_INIT_EXE_LDFLAGS " -fPIE -pie")
+  endif()
+endif()
+unset(_CMP0083)
+
 string(APPEND _ANDROID_ABI_INIT_EXE_LDFLAGS " -Wl,--gc-sections")
 
 if(NOT _ANDROID_ABI_INIT_EXE_LDFLAGS_NO_nocopyreloc)

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

Summary of changes:
 Help/policy/CMP0083.rst                   |  6 ++++++
 Modules/Platform/Android/abi-common.cmake | 20 ++++++++++++++++++++
 2 files changed, 26 insertions(+)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list