[libc++abi] Remove redundant link flags on Apple platforms
authorLouis Dionne <ldionne@apple.com>
Mon, 7 Oct 2019 18:12:10 +0000 (18:12 +0000)
committerLouis Dionne <ldionne@apple.com>
Mon, 7 Oct 2019 18:12:10 +0000 (18:12 +0000)
These flags are already set when we create the cxxabi_shared target
using the SOVERSION and VERSION target properties, and the install_name
was already being overriden to '@rpath/libc++abi.1.dylib' by CMake
because no 'CMAKE_INSTALL_NAME_DIR' option was specified. So this is
effectively a removal of dead code with no intended functionality change.

The only think we're losing here is that we used to link against
libSystem.B.dylib instead of libSystem.dylib when building libc++abi
for macOS 10.6 -- however, I strongly suspect nobody's building
libc++abi from source for that target anymore.

llvm-svn: 373934

libcxxabi/src/CMakeLists.txt

index cbf4b21..8d4eb79 100644 (file)
@@ -103,23 +103,7 @@ endif ()
 # Setup flags.
 add_link_flags_if_supported(-nodefaultlibs)
 
-set(LIBCXXABI_SHARED_LINK_FLAGS)
-
 if ( APPLE )
-  if ( CMAKE_OSX_DEPLOYMENT_TARGET STREQUAL "10.6" )
-    list(APPEND LIBCXXABI_COMPILE_FLAGS "-U__STRICT_ANSI__")
-    list(APPEND LIBCXXABI_SHARED_LINK_FLAGS
-      "-compatibility_version 1"
-      "-current_version 1"
-      "-install_name /usr/lib/libc++abi.1.dylib")
-    list(APPEND LIBCXXABI_LINK_FLAGS
-        "/usr/lib/libSystem.B.dylib")
-  else()
-    list(APPEND LIBCXXABI_SHARED_LINK_FLAGS
-      "-compatibility_version 1"
-      "-install_name /usr/lib/libc++abi.1.dylib")
-  endif()
-
   if (LLVM_USE_SANITIZER)
     if (("${LLVM_USE_SANITIZER}" STREQUAL "Address") OR
         ("${LLVM_USE_SANITIZER}" STREQUAL "Address;Undefined") OR
@@ -148,7 +132,6 @@ endif()
 
 split_list(LIBCXXABI_COMPILE_FLAGS)
 split_list(LIBCXXABI_LINK_FLAGS)
-split_list(LIBCXXABI_SHARED_LINK_FLAGS)
 
 # FIXME: libc++abi.so will not link when modules are enabled because it depends
 # on symbols defined in libc++.so which has not yet been built.
@@ -187,7 +170,7 @@ if (LIBCXXABI_ENABLE_SHARED)
                           COMPILE_FLAGS
                             "${LIBCXXABI_COMPILE_FLAGS}"
                           LINK_FLAGS
-                            "${LIBCXXABI_LINK_FLAGS} ${LIBCXXABI_SHARED_LINK_FLAGS}"
+                            "${LIBCXXABI_LINK_FLAGS}"
                           OUTPUT_NAME
                             "c++abi"
                           SOVERSION