diff --git a/CMakeLists.txt b/CMakeLists.txt index 3d47f5264..ace80388c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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)