[libcxx-commits] [PATCH] D68269: [libc++abi] Do not define new/delete by default

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Oct 4 12:54:22 PDT 2019


ldionne added a comment.

In D68269#1695159 <https://reviews.llvm.org/D68269#1695159>, @thakis wrote:

> In D68269#1695143 <https://reviews.llvm.org/D68269#1695143>, @ldionne wrote:
>
> > So, the problem with this patch as it stands is that it introduces a link-time dependency from libc++abi back to libc++, because libc++abi needs the definition of `new` and `delete` (which would be in libc++ only with this patch). This is what I'm working around in the tests by re-adding `-lc++` after `-lc++abi` on the compiler command line. This isn't a problem on Apple platforms IIUC since the order of command-line `-l<xxx>` arguments doesn't matter, but it does for linkers on most other platforms.
>
>
> We (Chromium) currently statically link libc++ on all platforms, but use the platform default abi library. If I read the thread here right, this means we currently get operator new from libc++ but going forward we'd get it from the platform abi libraries -- but at the moment none (except darwin) have it yet. So that'd likely be an issue for us.


This means that you folks need to keep shipping new/delete in libc++.a, which entails that you'd configure it with `-DLIBCXX_ENABLE_NEW_DELETE_DEFINITIONS=ON` at CMake-configure time. If you don't use CMake to build libc++, none of this matters to you.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68269/new/

https://reviews.llvm.org/D68269





More information about the libcxx-commits mailing list