[libcxx] r282524 - Revert r282483 - [cmake] Add linker option "-Wl, -z, defs" in standalone build

Michal Gorny via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 27 11:54:03 PDT 2016


Author: mgorny
Date: Tue Sep 27 13:54:02 2016
New Revision: 282524

URL: http://llvm.org/viewvc/llvm-project?rev=282524&view=rev
Log:
Revert r282483 - [cmake] Add linker option "-Wl,-z,defs" in standalone build

Revert r282483 as it causes build failures due to missing symbols when
not linking to -lgcc_s (i.e. doing pure LLVM stack build). The patch can
be reintroduced when the build system is fixed to add all needed
libraries (libunwind, compiler-rt).

Modified:
    libcxx/trunk/CMakeLists.txt

Modified: libcxx/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/CMakeLists.txt?rev=282524&r1=282523&r2=282524&view=diff
==============================================================================
--- libcxx/trunk/CMakeLists.txt (original)
+++ libcxx/trunk/CMakeLists.txt Tue Sep 27 13:54:02 2016
@@ -319,18 +319,6 @@ remove_flags(-stdlib=libc++ -stdlib=libs
 # 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 ==============================================================
 set(LIBCXX_STANDARD_VER c++11 CACHE INTERNAL "internal option to change build dialect")
 add_compile_flags_if_supported(-std=${LIBCXX_STANDARD_VER})




More information about the cfe-commits mailing list