From c181fdc6a9d8da26f64de1e06cffe0b17f543035 Mon Sep 17 00:00:00 2001 From: alexey-milovidov Date: Tue, 10 Dec 2019 23:14:57 +0300 Subject: [PATCH] Update tools.cmake --- cmake/tools.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmake/tools.cmake b/cmake/tools.cmake index ebbb97cad16..3a17b47ae15 100644 --- a/cmake/tools.cmake +++ b/cmake/tools.cmake @@ -27,8 +27,13 @@ option (LINKER_NAME "Linker name or full path") find_program (LLD_PATH NAMES "ld.lld" "lld" "lld-${COMPILER_VERSION_MAJOR}") find_program (GOLD_PATH NAMES "ld.gold" "gold") +# We prefer LLD linker over Gold or BFD. + if (NOT LINKER_NAME) if (LLD_PATH) + # GCC driver requires one of supported linker names like "lld". + # Clang driver simply allows full linker path. + if (COMPILER_GCC) get_filename_component(LLD_BASE_NAME ${LLD_PATH} NAME) if (LLD_BASE_NAME STREQUAL ld.lld)