Page MenuHomePhabricator

[libc++abi] Add option to enable definitions for the new/delete overloads.

Authored by EricWF on Mar 1 2017, 4:45 PM.



Currently both libc++ and libc++abi provide definitions for operator new/delete. However I believe this is incorrect and that one or the other should offer them.

This patch adds the CMake option -DLIBCXXABI_ENABLE_NEW_DELETE_DEFINITIONS which defaults to OFF unless otherwise specified. This means that by default
only libc++ provides the new/delete definitions.

Diff Detail

Event Timeline

mehdi_amini accepted this revision.Mar 1 2017, 8:58 PM



It is unrelated to this change, but I'm wondering about the LIBCXXABI_BUILD_EXTERNAL_THREAD_LIBRARY condition. I see undefined reference to libc symbols.
That said we're linking to libSystem which provided everything, so I'm not even sure why dynamic_lookup is needed at all?

This revision is now accepted and ready to land.Mar 1 2017, 8:58 PM



The external thread library configuration is not something you have to worry about. The issue this configuration handles is that in unable to link to libc++external_threads.a, and instead expects the user to manually link libc++external_threads.a or it expects libc++ to handle the linking and undefined symbols later.

Once again you're never going to run into this since you don't use an externalized threading library.

EricWF closed this revision.Mar 2 2017, 11:46 AM