libcxx-3.9-cmake-link-flags.patch 1014 B

123456789101112131415161718192021222324
  1. diff --git a/CMakeLists.txt b/CMakeLists.txt
  2. index d618e83..0e76525 100644
  3. --- a/CMakeLists.txt
  4. +++ b/CMakeLists.txt
  5. @@ -293,6 +293,18 @@ remove_flags(-DNDEBUG -UNDEBUG -D_DEBUG
  6. # so they don't get transformed into -Wno and -errors respectivly.
  7. remove_flags(-Wno-pedantic -pedantic-errors -pedantic)
  8. +# FIXME: this is cribbed from HandleLLVMOptions.cmake.
  9. +if(LIBCXX_STANDALONE_BUILD)
  10. + # Pass -Wl,-z,defs. This makes sure all symbols are defined. Otherwise a DSO
  11. + # build might work on ELF but fail on MachO/COFF.
  12. + if(NOT (${CMAKE_SYSTEM_NAME} MATCHES "Darwin" OR WIN32 OR CYGWIN OR
  13. + ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD" OR
  14. + ${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD") AND
  15. + NOT LLVM_USE_SANITIZER)
  16. + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,defs")
  17. + endif()
  18. +endif()
  19. +
  20. # Required flags ==============================================================
  21. add_compile_flags_if_supported(-std=c++11)
  22. if (NOT MSVC AND NOT LIBCXX_SUPPORTS_STD_EQ_CXX11_FLAG)