[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
Tue Oct 1 07:11:00 PDT 2019
ldionne added a comment.
So, it turns out that even with GCC 9, this will cause errors like this (on my Linux Docker vm):
<...>lib/libc++abi.so: undefined reference to `operator delete(void*)'
<...>lib/libc++abi.so: undefined reference to `operator new[](unsigned long)'
<...>lib/libc++abi.so: undefined reference to `operator delete[](void*)'
<...>lib/libc++abi.so: undefined reference to `operator delete(void*, unsigned long)'
I see three solutions:
1. By default, provide new/delete in libc++abi but not in libc++. I'm not sure I like that.
2. Require that libc++abi be built with `-DLIBCXXABI_ENABLE_NEW_DELETE_DEFINITIONS=ON` on GCC. This means we need to change the CI builders to add that option.
3. "Fix" GCC and wait multiple years for GCC 9 not to be supported anymore before we switch the default.
I don't care whether we do (1) or (2) -- at Apple we specify `-DLIBCXXABI_ENABLE_NEW_DELETE_DEFINITIONS=ON` explicitly when we build libc++abi anyway. However, we need to align libc++abi and libc++ regarding who provides new/delete in the default LLVM configuration.
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