diff --git a/cmake/BuildParameters.cmake b/cmake/BuildParameters.cmake index 0c318dcf31..29b9459c9d 100644 --- a/cmake/BuildParameters.cmake +++ b/cmake/BuildParameters.cmake @@ -332,13 +332,19 @@ elseif (USE_GCC) endif() if (USE_LTO) + message(WARNING "LTO has not been thoroughly tested. It should work fine, but a bug is not impossible.") #gcc --print-file-name=liblto_plugin.so #set(LTO_FLAGS "-fuse-linker-plugin -flto=4 --plugin=/usr/lib/gcc/x86_64-linux-gnu/4.9/liblto_plugin.so") #set(LTO_FLAGS "-fuse-linker-plugin -fuse-ld=gold -flto=4 --plugin=/usr/lib/gcc/x86_64-linux-gnu/4.9/liblto_plugin.so") - set(LTO_FLAGS "-fuse-linker-plugin -fuse-ld=gold -flto=4") + set(LTO_FLAGS "-fuse-linker-plugin -flto=4") #set(LINK_FLAGS "--plugin=/usr/lib/gcc/x86_64-linux-gnu/4.9/liblto_plugin.so") - set(USER_CMAKE_LD_FLAGS "--plugin /usr/lib/gcc/x86_64-linux-gnu/4.9/liblto_plugin.so") set(DBG "") # not supported with LTO + message(STATUS "Using \"gcc-ar\" instead of \"ar\"") + set(CMAKE_AR /usr/bin/gcc-ar CACHE STRING "Archiver" FORCE) + message(STATUS "Using \"gcc-ranlib\" instead of \"ranlib\"") + set(CMAKE_RANLIB /usr/bin/gcc-ranlib CACHE STRING "ranlib" FORCE) + message(STATUS "Using \"gcc-nm\" instead of \"nm\"") + set(CMAKE_NM /usr/bin/gcc-nm CACHE STRING "nm" FORCE) else() set(LTO_FLAGS "") endif()