From 46d29063324eb61ac2e26d2492db6079eda133ba Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Wed, 3 Jul 2024 13:27:56 +0200 Subject: [PATCH] build(macos): disable deduplication in link step Problem: Apple Clang 16 comes with a new deduplication algorithm that is enabled by default in release builds (https://developer.apple.com/documentation/xcode-release-notes/xcode-16-release-notes#New-Features-in-Xcode-16-Beta) which breaks the built nvim binary (locks and spins at 100% CPU). Solution: Disable deduplication on macOS. Tested on Clang 15 as well and seems to make no difference to binary size anyway. (cherry picked from commit 7e099cf3eb1fd338a3aa50cf23f1b0a1f461f988) --- src/nvim/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/nvim/CMakeLists.txt b/src/nvim/CMakeLists.txt index 61103f245b..a100e733d8 100644 --- a/src/nvim/CMakeLists.txt +++ b/src/nvim/CMakeLists.txt @@ -158,6 +158,9 @@ elseif(CMAKE_SYSTEM_NAME MATCHES "Darwin") # ENABLE_EXPORTS is set to true. See # https://github.com/neovim/neovim/issues/25295 target_link_options(nvim_bin PRIVATE "-Wl,-export_dynamic") + # Apple Clang 16's new deduplication pass leads to lock-up on start + # TODO(clason): verify that problem remains after release or remove + target_link_options(nvim_bin PRIVATE "-Wl,-no_deduplicate") elseif(CMAKE_SYSTEM_NAME MATCHES "OpenBSD") target_link_libraries(main_lib INTERFACE pthread c++abi) elseif(CMAKE_SYSTEM_NAME STREQUAL "SunOS")