Skip to content

Commit

Permalink
[CMake] Error when LTO and lld are enabled on Darwin
Browse files Browse the repository at this point in the history
lld on Darwin does not currently support LTO.

Differential Revision: https://reviews.llvm.org/D26715

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287256 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
petrhosek committed Nov 17, 2016
1 parent 48bbdf7 commit 2545ab0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmake/modules/HandleLLVMOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ set(LTDL_SHLIB_EXT ${CMAKE_SHARED_LIBRARY_SUFFIX})
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()
Expand Down

0 comments on commit 2545ab0

Please sign in to comment.