[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:45:13 PDT 2019


ldionne added a comment.

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.

The alternative would be to only provide new/delete inside libc++abi, not in libc++ (by default). So, vendors (@phosek @srhines @danalbert @dim @emaste), are you OK with the default becoming that libc++abi provides new/delete, and libc++ DOES NOT (by default). If you want to keep shipping new/delete as part of libc++, you'll need to specify `-DLIBCXX_ENABLE_NEW_DELETE_DEFINITIONS=ON` at CMake configure time.

Side note: I don't care which way we go, because at Apple we specify both `LIBCXX_ENABLE_NEW_DELETE_DEFINITIONS=OFF` and `LIBCXXABI_ENABLE_NEW_DELETE_DEFINITIONS=ON` explicitly anyway. What I care about is that by default, we provide the symbols in exactly one place, because that will allow me to do interesting simplifications without breaking the default configuration in upstream LLVM.


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