You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
libshit/ebuilds/sys-libs/libcxx/files/libcxx-3.9-cmake-link-flags...

24 lines
1014 B
Diff

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