Index: llvm/trunk/cmake/modules/HandleLLVMOptions.cmake =================================================================== --- llvm/trunk/cmake/modules/HandleLLVMOptions.cmake +++ llvm/trunk/cmake/modules/HandleLLVMOptions.cmake @@ -96,6 +96,9 @@ set(LLVM_PLUGIN_EXT ${CMAKE_SHARED_LIBRARY_SUFFIX}) if(APPLE) + if(LLVM_ENABLE_LLD AND LLVM_ENABLE_LTO) + message(FATAL_ERROR "lld does not support LTO on Darwin") + endif() # Darwin-specific linker flags for loadable modules. set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,-flat_namespace -Wl,-undefined -Wl,suppress") endif()