[PATCH] D31272: Do not pass an explicit reexported symbol list when building libc++ dylib if also defining new/delete

Mehdi AMINI via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 27 21:32:14 PDT 2017


mehdi_amini added a comment.

In https://reviews.llvm.org/D31272#711804, @EricWF wrote:

> I'm a bit confused by the description of this change. Libc++ has been enabling the new/delete definitions in its dylib since forever and I've never experienced a link error. Did you mean to say the link error occurs only when libc++abi doesn't define them?


Most people have the "command line tools" package installed on macOS, and it means that you're taking this condition:

`if (DEFINED CMAKE_OSX_SYSROOT AND NOT CMAKE_OSX_SYSROOT STREQUAL "")`

which leads you to:

`-Wl,-reexport_library,${CMAKE_OSX_SYSROOT}/usr/lib/libc++abi.dylib`

While the GreenDragon bots don't have the command line tools, so CMAKE_OSX_SYSROOT is defined by cmake and then this is used instead:

`set(OSX_RE_EXPORT_LINE "/usr/lib/libc++abi.dylib -Wl,-reexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/libc++abi${LIBCXX_LIBCPPABI_VERSION}.exp")`


https://reviews.llvm.org/D31272





More information about the cfe-commits mailing list