[libcxx-commits] [PATCH] D73838: [libcxxabi] Fix layout of __cxa_exception for win64, fixing static assert failures

Martin Storsjö via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sat Feb 1 23:19:03 PST 2020


mstorsjo added a comment.

In D73838#1853443 <https://reviews.llvm.org/D73838#1853443>, @steven_wu wrote:

> Looks like this is an ABI change for WIN64. If that is intended then LGTM


I think that's ok - I don't think it's worth complicating this further to preserve compatibility with a previous binary layout which was accidental (using !LP64 layout on a platform with 64 bit pointers).

I presume this is a break for cases where an exception is thrown across libraries that have statically linked different versions of libcxxabi?

For cases where libcxxabi is linked in dynamically, all modules would be using the same copy of libcxxabi (either old or new) and it'd be consistent? I presume the `__cxa_exception` offsets don't end up in the calling application's binary anywhere, unless statically linked?

Is the layout of `__cxa_exception` supposed to match that of libgcc/libstdc++/libsupc++? Because they don't have e.g. the reference count stuck in a padding hole for 32 bit architectures.

In D73838#1853450 <https://reviews.llvm.org/D73838#1853450>, @rjmccall wrote:

> There's a Windows-based target that uses libUnwind-based exceptions?


MinGW toolchains normally use libgcc/libstdc++, but one can build a toolchain that uses libunwind/libcxxabi/libcxx instead; I distribute such a toolchain at https://github.com/mstorsjo/llvm-mingw. But I don't really give any ABI guarantees; I've e.g. switched unwinding mechanisms (between dwarf, sjlj and SEH) before, to avoid bugs until they're fixed properly.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D73838/new/

https://reviews.llvm.org/D73838





More information about the libcxx-commits mailing list