From 60564a959a27bf24743d49d359c2db3550d99b82 Mon Sep 17 00:00:00 2001 From: Alexey Sokolov Date: Sat, 24 Oct 2020 21:28:50 +0100 Subject: [PATCH] Don't override default AR and RANLIB without LTO `ar` is not always available, and when it is, it's not always correct, e.g. during cross-compilation. https://bugs.gentoo.org/732096 --- CMakeLists.txt | 6 ------ 1 file changed, 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 115a76db934b..d21894b89ee2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -421,12 +421,6 @@ if(ENABLE_LTO) find_program(LTO_RANLIB NAMES gcc-ranlib) set(CMAKE_AR "${LTO_AR}" CACHE STRING "Supports LTO" FORCE) set(CMAKE_RANLIB "${LTO_RANLIB}" CACHE STRING "Supports LTO" FORCE) -else() - MESSAGE("Using ar, ranlib, and default linker") - find_program(NON_LTO_AR NAMES ar) - find_program(NON_LTO_RANLIB NAMES ranlib) - set(CMAKE_AR "${NON_LTO_AR}" CACHE STRING "Does not support LTO" FORCE) - set(CMAKE_RANLIB "${NON_LTO_RANLIB}" CACHE STRING "Does not support LTO" FORCE) endif() MARK_AS_ADVANCED(LTO_AR LTO_RANLIB NON_LTO_AR NON_LTO_RANLIB)