maintainer-feedback requested: [Bug 263596] editors/libreoffice: make robust against __cxa_exception ABI changes

From: <bugzilla-noreply_at_freebsd.org>
Date: Tue, 26 Apr 2022 19:51:09 UTC
Bugzilla Automation <bugzilla@FreeBSD.org> has asked FreeBSD Office Team
<office@FreeBSD.org> for maintainer-feedback:
Bug 263596: editors/libreoffice: make robust against __cxa_exception ABI
changes
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=263596



--- Description ---
Patch libreoffice to replace __cxa_get_globals()->caughtExceptions,
which is a pointer to the start of a struct __cxa_exception, with
__cxa_current_primary_exception(), which is a pointer to the end.  This
allows struct __cxa_exception to be extended at the start as was
recently done in FreeBSD main and stable/13 on 64-bit architectures.

Recently on FreeBSD main and stable/13 __attribute__((__aligned__)) was
added to struct _Unwind_Exception which changes its size on 32-bit
architectures, and that of __cxa_exception as well.  Patch libreoffice
to detect this so packages built on 13.0 still work on 13.1.

Change the LIB_DEPENDS on libunwind to a BUILD_DEPENDS because we only
need unwind.h (for FreeBSD 13.0 and older where that header is hidden
in /usr/include/c++/v1).

I've build and run tested on i386 and I'll test on amd64 as well but it would
be nice if others could test aarch64 and powerpc.  Note that this patch depends
on the one in bug 263370.