Its not clear whether bugs were actually in gcc < 4.7.2 or in the bfl ld version ...
example of related bugs : http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53780 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52900
Disabling flto when ld is too old is one of the possible fixes, as ld 2.24 doesn't triggers these bugs.
endif()
endif()
+exec_program("${CMAKE_LINKER} --version" OUTPUT_VARIABLE "LINKER_VERSION")
+string(REGEX MATCH "[0-9].[0-9]*" LINKER_VERSION "${LINKER_VERSION}")
+
string(REGEX MATCH "cl.exe" VBC "${CMAKE_C_COMPILER}")
if(VBC)
message(FATAL_ERROR "VB is not yet supported by Simgrid.")
endif()
else()
# On non-windows, 4.6 is enough for that
- if(COMPILER_C_VERSION_MAJOR_MINOR STRGREATER "4.5")
+ if(COMPILER_C_VERSION_MAJOR_MINOR STRGREATER "4.5" AND LINKER_VERSION STRGREATER "2.22")
set(optCFLAGS "${optCFLAGS} -flto ")
endif()
endif()