summaryrefslogtreecommitdiffstats
path: root/Modules/Compiler
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2024-06-05 16:48:02 (GMT)
committerMarc Chevrier <marc.chevrier@gmail.com>2024-07-20 17:05:54 (GMT)
commitc1c4cf9545d17928c065fca344c48e03b80291f0 (patch)
tree1e39458e80ffaaa39dc2acfc7cb2aee24a2fc6cb /Modules/Compiler
parent587a3b41baaaa83e08714af5ca1acecee2970a83 (diff)
downloadCMake-c1c4cf9545d17928c065fca344c48e03b80291f0.zip
CMake-c1c4cf9545d17928c065fca344c48e03b80291f0.tar.gz
CMake-c1c4cf9545d17928c065fca344c48e03b80291f0.tar.bz2
Linker configuration: introduce a new architecture
A new set of files are dedicated to linker configuration. This set of files enable a fine-tuned configuration based of the linker type as identified during compiler detection. Fixes: #25360
Diffstat (limited to 'Modules/Compiler')
-rw-r--r--Modules/Compiler/GNU.cmake54
1 files changed, 0 insertions, 54 deletions
diff --git a/Modules/Compiler/GNU.cmake b/Modules/Compiler/GNU.cmake
index 3f705a9..83c818d 100644
--- a/Modules/Compiler/GNU.cmake
+++ b/Modules/Compiler/GNU.cmake
@@ -52,60 +52,6 @@ macro(__compiler_gnu lang)
set(CMAKE_DEPFILE_FLAGS_${lang} "-MD -MT <DEP_TARGET> -MF <DEP_FILE>")
endif()
- # define flags for linker depfile generation
- set(CMAKE_${lang}_LINKER_DEPFILE_FLAGS "LINKER:--dependency-file,<DEP_FILE>")
- set(CMAKE_${lang}_LINKER_DEPFILE_FORMAT gcc)
-
- if(NOT DEFINED CMAKE_${lang}_LINKER_DEPFILE_SUPPORTED)
- ## Ensure ninja tool is recent enough...
- if(CMAKE_GENERATOR MATCHES "^Ninja")
- # Ninja 1.10 or upper is required
- execute_process(COMMAND "${CMAKE_MAKE_PROGRAM}" --version
- OUTPUT_VARIABLE _ninja_version
- ERROR_VARIABLE _ninja_version)
- if (_ninja_version MATCHES "[0-9]+(\\.[0-9]+)*")
- set (_ninja_version "${CMAKE_MATCH_0}")
- endif()
- if (_ninja_version VERSION_LESS "1.10")
- set(CMAKE_${lang}_LINKER_DEPFILE_SUPPORTED FALSE)
- endif()
- unset(_ninja_version)
- endif()
-
- if (NOT DEFINED CMAKE_${lang}_LINKER_DEPFILE_SUPPORTED)
- ## check if this feature is supported by the linker
- if (CMAKE_${lang}_COMPILER_LINKER AND CMAKE_${lang}_COMPILER_LINKER_ID MATCHES "GNU|LLD")
- execute_process(COMMAND "${CMAKE_${lang}_COMPILER_LINKER}" --help
- OUTPUT_VARIABLE _linker_capabilities
- ERROR_VARIABLE _linker_capabilities)
- if(_linker_capabilities MATCHES "--dependency-file")
- set(CMAKE_${lang}_LINKER_DEPFILE_SUPPORTED TRUE)
- else()
- set(CMAKE_${lang}_LINKER_DEPFILE_SUPPORTED FALSE)
- endif()
- unset(_linker_capabilities)
- else()
- set(CMAKE_${lang}_LINKER_DEPFILE_SUPPORTED FALSE)
- endif()
- endif()
- endif()
- if (CMAKE_${lang}_LINKER_DEPFILE_SUPPORTED)
- set(CMAKE_${lang}_LINK_DEPENDS_USE_LINKER TRUE)
- else()
- set(CMAKE_${lang}_LINK_DEPENDS_USE_LINKER FALSE)
- endif()
-
- # Due to GNU binutils ld bug when LTO is enabled (see GNU bug
- # `30568 <https://sourceware.org/bugzilla/show_bug.cgi?id=30568>`_),
- # deactivate this feature if the version is less than 2.41.
- # For now, all known versions of gold linker have also this bug.
- if (CMAKE_${lang}_COMPILER_LINKER_ID
- AND (CMAKE_${lang}_COMPILER_LINKER_ID STREQUAL "GNUgold"
- OR (CMAKE_${lang}_COMPILER_LINKER_ID STREQUAL "GNU"
- AND CMAKE_${lang}_COMPILER_LINKER_VERSION VERSION_LESS "2.41")))
- set(CMAKE_${lang}_LINK_DEPENDS_USE_LINKER FALSE)
- endif()
-
# Initial configuration flags.
string(APPEND CMAKE_${lang}_FLAGS_INIT " ")
string(APPEND CMAKE_${lang}_FLAGS_DEBUG_INIT " -g")