[libcxx-commits] [PATCH] D68269: [libc++] Define new/delete in libc++abi only by default

Dimitry Andric via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Oct 9 11:05:54 PDT 2020


dim accepted this revision.
dim added a comment.

In D68269#2322295 <https://reviews.llvm.org/D68269#2322295>, @ldionne wrote:

> In D68269#2322291 <https://reviews.llvm.org/D68269#2322291>, @dim wrote:
>
>> In D68269#2322151 <https://reviews.llvm.org/D68269#2322151>, @ldionne wrote:
>>
>>> Ping. Please take a look. I'll ship this in a week if nobody cares.
>>
>> On FreeBSD we replaced (quite a while ago now) libsupc++ with libcxxrt.  Currently this also provides new and delete operators, but not all that are provided by libc++ (as of ~11.0.0 rc5):
>>
>> [...]
>>
>> That said, both libcxxrt and libc++ mark their implementations as weak, so it's good guess which one wins... I'm actually not completely sure, except for the variants that libcxxrt doesn't implement. :)
>>
>> In any case, we'd at least have to add the variants with `align_val_t` and with the const `nothrow_t` to libcxxrt, to make it backwards compatible.  Another option would be to switch to libc++abi, but that is quite a lot more work.
>
> The other option, which I would argue is the least amount of work, is for you to configure CMake with `-DLIBCXX_ENABLE_NEW_DELETE_DEFINITIONS=ON`. The libc++ produced with that option should match what you have today.

Ah of course, silly me! I was under the impression that you were going to throw out all the operators, but you added a configure-time option instead. That would indeed be just fine for FreeBSD, at least for the time being.  (Still it's probably better to update libcxxrt or switch to libc++abi at some point.)


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