From 925ece4c25636b6492b9d0563a82daa11139948f Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Wed, 14 Jan 2026 19:14:50 +0000 Subject: [PATCH 1/4] Always use LLD to link when using clang to build All recent distributions of clang also include lld, and it links much faster than most other linkers. --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c01472a475a..fe7ce1f40f2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -221,11 +221,14 @@ if(NOT MSVC AND NOT EMSCRIPTEN) endif() endif() +if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + add_link_flag("-fuse-ld=lld") +endif() + if(BYN_ENABLE_LTO) if(NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang") message(FATAL_ERROR "ThinLTO is only supported by clang") endif() - add_link_flag("-fuse-ld=lld") set_property(GLOBAL APPEND PROPERTY JOB_POOLS link_job_pool=2) set(CMAKE_JOB_POOL_LINK link_job_pool) add_compile_flag("-flto=thin") From 6af266a2e8949fe737de430423b987649de95bef Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Wed, 14 Jan 2026 19:35:33 +0000 Subject: [PATCH 2/4] Exclude macOS --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fe7ce1f40f2..df7e3ffffe9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -221,7 +221,7 @@ if(NOT MSVC AND NOT EMSCRIPTEN) endif() endif() -if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") +if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND (LINUX OR WINDOWS)) add_link_flag("-fuse-ld=lld") endif() From 20cb7e298acaa420031e0e17c400860ed11185ee Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Wed, 14 Jan 2026 13:41:16 -0800 Subject: [PATCH 3/4] Add Mac comment. --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index df7e3ffffe9..370d39b67a5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -221,6 +221,7 @@ if(NOT MSVC AND NOT EMSCRIPTEN) endif() endif() +# The version of clang currently on our Mac bot's doesn't seem to support this flag. if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND (LINUX OR WINDOWS)) add_link_flag("-fuse-ld=lld") endif() From 81048bdb556ef06508e9b4b57197b798d9dc8e1a Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Wed, 14 Jan 2026 14:40:49 -0800 Subject: [PATCH 4/4] Update CMakeLists.txt --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 370d39b67a5..d171a677591 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -221,7 +221,7 @@ if(NOT MSVC AND NOT EMSCRIPTEN) endif() endif() -# The version of clang currently on our Mac bot's doesn't seem to support this flag. +# The version of clang currently on our Mac bots doesn't seem to support this flag. if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND (LINUX OR WINDOWS)) add_link_flag("-fuse-ld=lld") endif()