Commit Graph

9 Commits

Author SHA1 Message Date
Dimitry Andric
72df847a94 Remove compat hacks from libcxxrt's _Unwind_Exception
This reverts 9097e3cbca, which was in itself a revert of upstream
libcxxrt commits 88bdf6b290da ("Specify double-word alignment for ARM
unwind") and b96169641f79 ("Updated Itanium unwind"), and a
reapplication of our commit 3c4fd2463b ("libcxxrt: add padding in
__cxa_allocate_* to fix alignment").

The editors/libreoffice port will be patched to be able to cope with the
standards-compliant alignment of _Unwind_Exception and consequently,
that of __cxa_exception. The layouts and sizes of these structures
should then be completely the same for libcxxrt, libunwind and
libc++abi.

PR:		262008
Reviewed by:	emaste, jhb, theraven
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D34488
2022-03-09 18:25:18 +01:00
Dimitry Andric
9097e3cbca Partially revert libcxxrt changes to avoid _Unwind_Exception change
(Note I am also applying this to main and stable/13, to restore the old
libcxxrt ABI and to avoid having to maintain a compat library.)

After the recent cherry-picking of libcxxrt commits 0ee0dbfb0d and
d2b3fadf2d, users reported that editors/libreoffice packages from the
official package builders did not start anymore. It turns out that the
combination of these commits subtly changes the ABI, requiring all
applications that depend on internal details of struct _Unwind_Exception
(available via unwind-arm.h and unwind-itanium.h) to be recompiled.

However, the FreeBSD package builders always use -RELEASE jails, so
these still use the old declaration of struct _Unwind_Exception, which
is not entirely compatible. In particular, LibreOffice uses this struct
in its internal "uno bridge" component, where it attempts to setup its
own exception handling mechanism.

To fix this incompatibility, go back to the old declarations of struct
_Unwind_Exception, and restore the __LP64__ specific workaround we had
in place before (which was to cope with yet another, older ABI bug).

Effectively, this reverts upstream libcxxrt commits 88bdf6b290da
("Specify double-word alignment for ARM unwind") and b96169641f79
("Updated Itanium unwind"), and reapplies our commit 3c4fd2463b
("libcxxrt: add padding in __cxa_allocate_* to fix alignment").

PR:		253840
2021-03-13 14:54:24 +01:00
Dimitry Andric
0ee0dbfb0d Merge libcxxrt master 8049924686b8414d8e652cbd2a52c763b48e8456
Interesting fixes:
b3c73ba libelftc_dem_gnu3: Sync with elftoolchain r3877
7b2335c Mostly fix __cxa_demangle after #3

Reported by:	arichardson
PR:		253226
MFC after:	3 days
2021-02-18 22:30:27 +01:00
Dimitry Andric
7b01d357a2 Include <stdint.h> in unwind-arm.h, since it uses uint32_t and uint64_t
in various declarations.

Otherwise, depending on how unwind-arm.h is included from other source
files, the compiler may complain that uint32_t and uint64_t are unknown
types.

MFC after:	3 days
2019-09-13 21:00:19 +00:00
Dimitry Andric
8795828371 Add _US_ACTION_MASK to libcxxrt's arm-specific unwind header. This
value is used in newer versions of compiler-rt.

MFC after:	3 days
2016-09-04 21:48:58 +00:00
Dimitry Andric
fb48e1d39c Since newer versions of compiler-rt require unwind.h, and we want to use
the copy in libcxxrt for it, fix the arm-specific header to define the
_Unwind_Action type.

Submitted by:	andrew
MFC after:	3 days
2015-02-26 07:42:16 +00:00
Dimitry Andric
f2dc4184d2 Import libcxxrt master 00bc29eb6513624824a6d7db2ebc768a4216a604.
Interesting fixes:
76584a0  Reorganize code to use only 32bit atomic ops for 32bit platforms
30d2ae5  Implement __cxa_throw_bad_array_new_length

Reviewed by:	bapt
MFC after:	1 month
Differential Revision: https://reviews.freebsd.org/D1390
2014-12-30 20:01:06 +00:00
David Chisnall
94e3ee44c3 Import new versions of libcxxrt and libc++.
Please tests any C++ code you care about with -stdlib=libc++!

Approved by:	dim (mentor)
2012-03-14 00:09:36 +00:00
David Chisnall
7a98470824 Import libc++ / libcxxrt into base. Not build by default yet (use
MK_LIBCPLUSPLUS=yes to enable).  This is a work-in-progress.  It works for
me, but is not guaranteed to work for anyone else and may eat your dog.

To build C++ using libc++, add -stdlib=libc++ to your CXX and LD flags.

Bug reports welcome, bug fixes even more welcome...

Approved by:	dim (mentor)
2011-11-25 20:59:04 +00:00