Skip to content

Commit

Permalink
COMP: Remove gold linker support
Browse files Browse the repository at this point in the history
Deprecated and does conflicts with LTO. Closes #1952
  • Loading branch information
thewtex authored and hjmjohnson committed Nov 29, 2020
1 parent f38b88f commit 214328c
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions CMake/ITKSetStandardCompilerFlags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -328,29 +328,6 @@ macro(check_compiler_platform_flags)
set(ITK_REQUIRED_CXX_FLAGS "${ITK_REQUIRED_CXX_FLAGS} -Wno-array-bounds")
endif()

if("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
set(_safe_cmake_required_flags "${CMAKE_REQUIRED_FLAGS}")
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -fuse-ld=gold")
CHECK_CXX_SOURCE_COMPILES("int main() { return 0;}" have_gold)
set(CMAKE_REQUIRED_FLAGS "${_safe_cmake_required_flags}")
if(have_gold)
set(_use_gold_linker_default ON)
set(_gold_linker_failure_condition_0 "${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS "4.9.0")
set(_gold_linker_failure_condition_1 NOT BUILD_SHARED_LIBS AND "${CMAKE_CXX_COMPILER_VERSION}" VERSION_EQUAL "4.9.0")
if( (${_gold_linker_failure_condition_0}) OR (${_gold_linker_failure_condition_1}) )
set(_use_gold_linker_default OFF)
endif()
option(ITK_USE_GOLD_LINKER "Use the gold linker instead of ld." ${_use_gold_linker_default})
mark_as_advanced(ITK_USE_GOLD_LINKER)
# The gold linker is approximately 3X faster.
if(ITK_USE_GOLD_LINKER)
set(CMAKE_EXE_LINKER_FLAGS "-fuse-ld=gold ${CMAKE_EXE_LINKER_FLAGS}")
set(CMAKE_MODULE_LINKER_FLAGS "-fuse-ld=gold ${CMAKE_MODULE_LINKER_FLAGS}")
set(CMAKE_SHARED_LINKER_FLAGS "-fuse-ld=gold ${CMAKE_SHARED_LINKER_FLAGS}")
endif()
endif()
endif()

if(APPLE)
option(ITK_USE_64BITS_APPLE_TRUNCATION_WARNING "Turn on warnings on 64bits to 32bits truncations." OFF)
mark_as_advanced(ITK_USE_64BITS_APPLE_TRUNCATION_WARNING)
Expand Down

0 comments on commit 214328c

Please sign in to comment.