[libcxx-commits] [libcxxabi] r373934 - [libc++abi] Remove redundant link flags on Apple platforms

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Mon Oct 7 11:12:10 PDT 2019


Author: ldionne
Date: Mon Oct  7 11:12:10 2019
New Revision: 373934

URL: http://llvm.org/viewvc/llvm-project?rev=373934&view=rev
Log:
[libc++abi] Remove redundant link flags on Apple platforms

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.

Modified:
    libcxxabi/trunk/src/CMakeLists.txt

Modified: libcxxabi/trunk/src/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/CMakeLists.txt?rev=373934&r1=373933&r2=373934&view=diff
==============================================================================
--- libcxxabi/trunk/src/CMakeLists.txt (original)
+++ libcxxabi/trunk/src/CMakeLists.txt Mon Oct  7 11:12:10 2019
@@ -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




More information about the libcxx-commits mailing list