[llvm-branch-commits] [libcxx] Prepare libcxx and libcxxabi for pointer field protection. (PR #151651)
Peter Collingbourne via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Thu Dec 4 14:49:30 PST 2025
================
@@ -300,7 +300,7 @@ class _LIBCPP_EXPORTED_FROM_ABI _LIBCPP_TYPE_INFO_VTABLE_POINTER_AUTH type_info
protected:
typedef __type_info_implementations::__impl __impl;
- __impl::__type_name_t __type_name;
+ _LIBCPP_NO_PFP __impl::__type_name_t __type_name;
----------------
pcc wrote:
That would have the following downsides:
1. More complexity in the compiler for no real benefit.
2. The names of the fields would become part of the ABI, i.e. all ABI implementations would need to use the same names in order to avoid mismatches with clang-generated code. Fortunately it looks like gcc is using the same field names here, so maybe that doesn't matter.
3. Would no longer be able to link a PFP libc++ and a non-PFP libc++ into the same program, because the libc++abi implementations would expect different ABIs (the PFP side would expect these fields to be signed).
That being said, I don't feel strongly about it, so if it doesn't take too much time I guess I don't mind doing it.
https://github.com/llvm/llvm-project/pull/151651
More information about the llvm-branch-commits
mailing list