Force disable LTO for GCC 11.1

This commit is contained in:
Luke Street 2021-05-20 02:04:30 -04:00
parent 0003d8a578
commit b8fee5c2ac
1 changed files with 5 additions and 0 deletions

View File

@ -283,6 +283,11 @@ if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
else()
option(USE_LTO "Enable LTO" OFF)
endif()
# FIXME GCC 11.1 -flto is completely broken
if(CMAKE_COMPILER_IS_GNUCC AND CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 11.1.0)
message(NOTICE "Working around GCC 11.1 bug; disabling LTO")
set(USE_LTO OFF)
endif()
else()
option(USE_LD_LLD "Link with LLD" OFF)
option(USE_LD_GOLD "Link with GNU Gold" OFF)