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 dd75fc27af2c737f0c6d78fe39578529ce5012da (commit) via 4bcfaef9173923b2a6bd5f3900fb2c3189865905 (commit) via 6a46f51b508611bc6ee56e417f327ff85c4f1066 (commit) via 59b8d5e81eeb77f9e507e01c8ff0fcd68f40f415 (commit) via a41ead566cf8b0d1890ad820858ae6fd4334f8de (commit) from a00cb0cbeea37a2d896275dfef76060481822da7 (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=dd75fc27af2c737f0c6d78fe39578529ce5012da commit dd75fc27af2c737f0c6d78fe39578529ce5012da Merge: a00cb0c 4bcfaef Author: Brad King <brad.k...@kitware.com> AuthorDate: Wed Sep 30 13:49:56 2015 -0400 Commit: CMake Topic Stage <kwro...@kitware.com> CommitDate: Wed Sep 30 13:49:56 2015 -0400 Merge topic 'cray-linux-compiler-wrappers' into next 4bcfaef9 Cray: Do not support shared libraries if compiler links statically 6a46f51b Cray: Detect when compiler links static binaries 59b8d5e8 Cray: Add Linux-specific compiler information modules a41ead56 Drop executable symbol export if platform does not support shared libs https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4bcfaef9173923b2a6bd5f3900fb2c3189865905 commit 4bcfaef9173923b2a6bd5f3900fb2c3189865905 Author: Brad King <brad.k...@kitware.com> AuthorDate: Wed Sep 30 13:47:01 2015 -0400 Commit: Brad King <brad.k...@kitware.com> CommitDate: Wed Sep 30 13:47:01 2015 -0400 Cray: Do not support shared libraries if compiler links statically When using the Cray programming environment on Linux the compiler wrappers may force static linking. In this case tell CMake that the target architecture does not support shared libraries. This will prevent projects from accidentally adding shared libraries when the toolchain does not support them. It also helps CMake avoid linking with flags that require shared libraries to be supported. diff --git a/Modules/Platform/Linux-Cray.cmake b/Modules/Platform/Linux-Cray.cmake index ace197b..8453875 100644 --- a/Modules/Platform/Linux-Cray.cmake +++ b/Modules/Platform/Linux-Cray.cmake @@ -19,4 +19,7 @@ endif() set(__LINUX_COMPILER_CRAY 1) macro(__linux_compiler_cray lang) + if(CMAKE_${lang}_COMPILER_LINKS_STATICALLY) + set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS FALSE) + endif() endmacro() diff --git a/Modules/Platform/Linux-GNU.cmake b/Modules/Platform/Linux-GNU.cmake index 0e254c6..a18edc7 100644 --- a/Modules/Platform/Linux-GNU.cmake +++ b/Modules/Platform/Linux-GNU.cmake @@ -22,4 +22,8 @@ macro(__linux_compiler_gnu lang) # We pass this for historical reasons. Projects may have # executables that use dlopen but do not set ENABLE_EXPORTS. set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS "-rdynamic") + + if(CMAKE_${lang}_COMPILER_LINKS_STATICALLY) + set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS FALSE) + endif() endmacro() diff --git a/Modules/Platform/Linux-Intel.cmake b/Modules/Platform/Linux-Intel.cmake index 20fddb4..75e2cea 100644 --- a/Modules/Platform/Linux-Intel.cmake +++ b/Modules/Platform/Linux-Intel.cmake @@ -51,4 +51,8 @@ macro(__linux_compiler_intel lang) if(NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 12.0) set(CMAKE_${lang}_COMPILE_OPTIONS_VISIBILITY "-fvisibility=") endif() + + if(CMAKE_${lang}_COMPILER_LINKS_STATICALLY) + set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS FALSE) + endif() endmacro() diff --git a/Modules/Platform/Linux-PGI.cmake b/Modules/Platform/Linux-PGI.cmake index baa2248..861c5d4 100644 --- a/Modules/Platform/Linux-PGI.cmake +++ b/Modules/Platform/Linux-PGI.cmake @@ -24,4 +24,8 @@ macro(__linux_compiler_pgi lang) set(CMAKE_${lang}_COMPILE_OPTIONS_PIE "") set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "-fPIC") set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-shared") + + if(CMAKE_${lang}_COMPILER_LINKS_STATICALLY) + set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS FALSE) + endif() endmacro() https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6a46f51b508611bc6ee56e417f327ff85c4f1066 commit 6a46f51b508611bc6ee56e417f327ff85c4f1066 Author: Brad King <brad.k...@kitware.com> AuthorDate: Wed Sep 30 13:42:50 2015 -0400 Commit: Brad King <brad.k...@kitware.com> CommitDate: Wed Sep 30 13:45:26 2015 -0400 Cray: Detect when compiler links static binaries Cray programming environment compiler wrappers may add the '-static' flag to invocations of the underlying compiler. This forces the binaries to link statically. Detect this from the compiler id binary and save the result so we can use it to choose other flags later. diff --git a/Modules/CMakeCCompiler.cmake.in b/Modules/CMakeCCompiler.cmake.in index c72e338..a1bfc70 100644 --- a/Modules/CMakeCCompiler.cmake.in +++ b/Modules/CMakeCCompiler.cmake.in @@ -2,6 +2,7 @@ set(CMAKE_C_COMPILER "@CMAKE_C_COMPILER@") set(CMAKE_C_COMPILER_ARG1 "@CMAKE_C_COMPILER_ARG1@") set(CMAKE_C_COMPILER_ID "@CMAKE_C_COMPILER_ID@") set(CMAKE_C_COMPILER_VERSION "@CMAKE_C_COMPILER_VERSION@") +set(CMAKE_C_COMPILER_LINKS_STATICALLY "@CMAKE_C_COMPILER_LINKS_STATICALLY@") set(CMAKE_C_STANDARD_COMPUTED_DEFAULT "@CMAKE_C_STANDARD_COMPUTED_DEFAULT@") set(CMAKE_C_COMPILE_FEATURES "@CMAKE_C_COMPILE_FEATURES@") set(CMAKE_C90_COMPILE_FEATURES "@CMAKE_C90_COMPILE_FEATURES@") diff --git a/Modules/CMakeCXXCompiler.cmake.in b/Modules/CMakeCXXCompiler.cmake.in index 52e44f6..4218a6d 100644 --- a/Modules/CMakeCXXCompiler.cmake.in +++ b/Modules/CMakeCXXCompiler.cmake.in @@ -2,6 +2,7 @@ set(CMAKE_CXX_COMPILER "@CMAKE_CXX_COMPILER@") set(CMAKE_CXX_COMPILER_ARG1 "@CMAKE_CXX_COMPILER_ARG1@") set(CMAKE_CXX_COMPILER_ID "@CMAKE_CXX_COMPILER_ID@") set(CMAKE_CXX_COMPILER_VERSION "@CMAKE_CXX_COMPILER_VERSION@") +set(CMAKE_CXX_COMPILER_LINKS_STATICALLY "@CMAKE_CXX_COMPILER_LINKS_STATICALLY@") set(CMAKE_CXX_STANDARD_COMPUTED_DEFAULT "@CMAKE_CXX_STANDARD_COMPUTED_DEFAULT@") set(CMAKE_CXX_COMPILE_FEATURES "@CMAKE_CXX_COMPILE_FEATURES@") set(CMAKE_CXX98_COMPILE_FEATURES "@CMAKE_CXX98_COMPILE_FEATURES@") diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake index df6daf3..82b39bb 100644 --- a/Modules/CMakeDetermineCompilerId.cmake +++ b/Modules/CMakeDetermineCompilerId.cmake @@ -106,6 +106,7 @@ function(CMAKE_DETERMINE_COMPILER_ID lang flagvar src) set(MSVC_${lang}_ARCHITECTURE_ID "${MSVC_${lang}_ARCHITECTURE_ID}" PARENT_SCOPE) set(CMAKE_${lang}_CL_SHOWINCLUDES_PREFIX "${CMAKE_${lang}_CL_SHOWINCLUDES_PREFIX}" PARENT_SCOPE) + set(CMAKE_${lang}_COMPILER_LINKS_STATICALLY "${CMAKE_${lang}_COMPILER_LINKS_STATICALLY}" PARENT_SCOPE) set(CMAKE_${lang}_COMPILER_VERSION "${CMAKE_${lang}_COMPILER_VERSION}" PARENT_SCOPE) set(CMAKE_${lang}_SIMULATE_ID "${CMAKE_${lang}_SIMULATE_ID}" PARENT_SCOPE) set(CMAKE_${lang}_SIMULATE_VERSION "${CMAKE_${lang}_SIMULATE_VERSION}" PARENT_SCOPE) @@ -529,6 +530,13 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file) endif() endif() + if(DEFINED ENV{CRAYPE_VERSION}) + execute_process(COMMAND file "${file}" OUTPUT_VARIABLE out ERROR_VARIABLE out) + if(out MATCHES "statically linked") + set(CMAKE_${lang}_COMPILER_LINKS_STATICALLY 1 PARENT_SCOPE) + endif() + endif() + # Check if a valid compiler and platform were found. if(COMPILER_ID AND NOT COMPILER_ID_TWICE) set(CMAKE_${lang}_COMPILER_ID "${COMPILER_ID}") diff --git a/Modules/CMakeFortranCompiler.cmake.in b/Modules/CMakeFortranCompiler.cmake.in index 14fdd60..6b984e5 100644 --- a/Modules/CMakeFortranCompiler.cmake.in +++ b/Modules/CMakeFortranCompiler.cmake.in @@ -2,6 +2,7 @@ set(CMAKE_Fortran_COMPILER "@CMAKE_Fortran_COMPILER@") set(CMAKE_Fortran_COMPILER_ARG1 "@CMAKE_Fortran_COMPILER_ARG1@") set(CMAKE_Fortran_COMPILER_ID "@CMAKE_Fortran_COMPILER_ID@") set(CMAKE_Fortran_COMPILER_VERSION "@CMAKE_Fortran_COMPILER_VERSION@") +set(CMAKE_Fortran_COMPILER_LINKS_STATICALLY "@CMAKE_Fortran_COMPILER_LINKS_STATICALLY@") set(CMAKE_Fortran_PLATFORM_ID "@CMAKE_Fortran_PLATFORM_ID@") set(CMAKE_Fortran_SIMULATE_ID "@CMAKE_Fortran_SIMULATE_ID@") set(CMAKE_Fortran_SIMULATE_VERSION "@CMAKE_Fortran_SIMULATE_VERSION@") https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=59b8d5e81eeb77f9e507e01c8ff0fcd68f40f415 commit 59b8d5e81eeb77f9e507e01c8ff0fcd68f40f415 Author: Chuck Atkins <chuck.atk...@kitware.com> AuthorDate: Wed Sep 30 12:32:51 2015 -0500 Commit: Brad King <brad.k...@kitware.com> CommitDate: Wed Sep 30 13:42:28 2015 -0400 Cray: Add Linux-specific compiler information modules diff --git a/Modules/Platform/Linux-Cray-C.cmake b/Modules/Platform/Linux-Cray-C.cmake new file mode 100644 index 0000000..f87725f --- /dev/null +++ b/Modules/Platform/Linux-Cray-C.cmake @@ -0,0 +1,2 @@ +include(Platform/Linux-Cray) +__linux_compiler_cray(C) diff --git a/Modules/Platform/Linux-Cray-CXX.cmake b/Modules/Platform/Linux-Cray-CXX.cmake new file mode 100644 index 0000000..8b63285 --- /dev/null +++ b/Modules/Platform/Linux-Cray-CXX.cmake @@ -0,0 +1,2 @@ +include(Platform/Linux-Cray) +__linux_compiler_cray(CXX) diff --git a/Modules/Platform/Linux-Cray-Fortran.cmake b/Modules/Platform/Linux-Cray-Fortran.cmake new file mode 100644 index 0000000..076f394 --- /dev/null +++ b/Modules/Platform/Linux-Cray-Fortran.cmake @@ -0,0 +1,2 @@ +include(Platform/Linux-Cray) +__linux_compiler_cray(Fortran) diff --git a/Modules/Platform/Linux-Cray.cmake b/Modules/Platform/Linux-Cray.cmake new file mode 100644 index 0000000..ace197b --- /dev/null +++ b/Modules/Platform/Linux-Cray.cmake @@ -0,0 +1,22 @@ + +#============================================================================= +# Copyright 2015 Kitware, Inc. +# +# Distributed under the OSI-approved BSD License (the "License"); +# see accompanying file Copyright.txt for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the License for more information. +#============================================================================= +# (To distribute this file outside of CMake, substitute the full +# License text for the above reference.) + +# This module is shared by multiple languages; use include blocker. +if(__LINUX_COMPILER_CRAY) + return() +endif() +set(__LINUX_COMPILER_CRAY 1) + +macro(__linux_compiler_cray lang) +endmacro() https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a41ead566cf8b0d1890ad820858ae6fd4334f8de commit a41ead566cf8b0d1890ad820858ae6fd4334f8de Author: Chuck Atkins <chuck.atk...@kitware.com> AuthorDate: Tue Sep 29 11:34:18 2015 -0500 Commit: Brad King <brad.k...@kitware.com> CommitDate: Wed Sep 30 13:40:50 2015 -0400 Drop executable symbol export if platform does not support shared libs Instead of always adding CMAKE_SHARED_LIBRARY_LINK_<LANG>_FLAGS to executables, or just when the ENABLE_EXPORTS property is set (CMP0065), make sure that the target platform also actually supports shared libraries. If not, then the executable cannot possibly provide symbols to them anyway. diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index f4de0f2..3230403 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -1542,7 +1542,9 @@ void cmLocalGenerator::OutputLinkLibraries(std::string& linkLibraries, this->Makefile->GetSafeDefinition("CMAKE_LIBRARY_PATH_TERMINATOR"); // Flags to link an executable to shared libraries. - if( tgt.GetType() == cmTarget::EXECUTABLE ) + if (tgt.GetType() == cmTarget::EXECUTABLE && + this->StateSnapshot.GetState()-> + GetGlobalPropertyAsBool("TARGET_SUPPORTS_SHARED_LIBS")) { bool add_shlib_flags = false; switch(tgt.Target->GetPolicyStatusCMP0065()) ----------------------------------------------------------------------- Summary of changes: Modules/CMakeCCompiler.cmake.in | 1 + Modules/CMakeCXXCompiler.cmake.in | 1 + Modules/CMakeDetermineCompilerId.cmake | 8 ++++++++ Modules/CMakeFortranCompiler.cmake.in | 1 + Modules/Platform/Linux-Cray-C.cmake | 2 ++ Modules/Platform/Linux-Cray-CXX.cmake | 2 ++ Modules/Platform/Linux-Cray-Fortran.cmake | 2 ++ .../Platform/{GHS-MULTI.cmake => Linux-Cray.cmake} | 18 ++++++++---------- Modules/Platform/Linux-GNU.cmake | 4 ++++ Modules/Platform/Linux-Intel.cmake | 4 ++++ Modules/Platform/Linux-PGI.cmake | 4 ++++ 11 files changed, 37 insertions(+), 10 deletions(-) create mode 100644 Modules/Platform/Linux-Cray-C.cmake create mode 100644 Modules/Platform/Linux-Cray-CXX.cmake create mode 100644 Modules/Platform/Linux-Cray-Fortran.cmake copy Modules/Platform/{GHS-MULTI.cmake => Linux-Cray.cmake} (72%) hooks/post-receive -- CMake _______________________________________________ Cmake-commits mailing list Cmake-commits@cmake.org http://public.kitware.com/mailman/listinfo/cmake-commits