Skip to content

Commit f385a38

Browse files
committed
[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. llvm-svn: 373934
1 parent 29f7e17 commit f385a38

File tree

1 file changed

+1
-18
lines changed

1 file changed

+1
-18
lines changed

libcxxabi/src/CMakeLists.txt

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -103,23 +103,7 @@ endif ()
103103
# Setup flags.
104104
add_link_flags_if_supported(-nodefaultlibs)
105105

106-
set(LIBCXXABI_SHARED_LINK_FLAGS)
107-
108106
if ( APPLE )
109-
if ( CMAKE_OSX_DEPLOYMENT_TARGET STREQUAL "10.6" )
110-
list(APPEND LIBCXXABI_COMPILE_FLAGS "-U__STRICT_ANSI__")
111-
list(APPEND LIBCXXABI_SHARED_LINK_FLAGS
112-
"-compatibility_version 1"
113-
"-current_version 1"
114-
"-install_name /usr/lib/libc++abi.1.dylib")
115-
list(APPEND LIBCXXABI_LINK_FLAGS
116-
"/usr/lib/libSystem.B.dylib")
117-
else()
118-
list(APPEND LIBCXXABI_SHARED_LINK_FLAGS
119-
"-compatibility_version 1"
120-
"-install_name /usr/lib/libc++abi.1.dylib")
121-
endif()
122-
123107
if (LLVM_USE_SANITIZER)
124108
if (("${LLVM_USE_SANITIZER}" STREQUAL "Address") OR
125109
("${LLVM_USE_SANITIZER}" STREQUAL "Address;Undefined") OR
@@ -148,7 +132,6 @@ endif()
148132

149133
split_list(LIBCXXABI_COMPILE_FLAGS)
150134
split_list(LIBCXXABI_LINK_FLAGS)
151-
split_list(LIBCXXABI_SHARED_LINK_FLAGS)
152135

153136
# FIXME: libc++abi.so will not link when modules are enabled because it depends
154137
# on symbols defined in libc++.so which has not yet been built.
@@ -187,7 +170,7 @@ if (LIBCXXABI_ENABLE_SHARED)
187170
COMPILE_FLAGS
188171
"${LIBCXXABI_COMPILE_FLAGS}"
189172
LINK_FLAGS
190-
"${LIBCXXABI_LINK_FLAGS} ${LIBCXXABI_SHARED_LINK_FLAGS}"
173+
"${LIBCXXABI_LINK_FLAGS}"
191174
OUTPUT_NAME
192175
"c++abi"
193176
SOVERSION

0 commit comments

Comments
 (0)