Commit Graph

9 Commits

Author SHA1 Message Date
Dimitry Andric
7819a911ff Merge libcxxrt commit f2e55091e2e878386c9f7974d4922bbdc4faed84
Fix unlock in two-word version and add missing comment.

  Fixes #15
  Fixes #16

This should fix the hangs in __cxa_guard_acquire() reported on i386 (and
possibly other 32-bit platforms).

Obtained from:	https://github.com/libcxxrt/libcxxrt/commit/f2e5509
Fixes:		56aaed388b
MFC after:	2 weeks
2022-03-20 22:34:41 +01:00
Dimitry Andric
bfffb66e7f Reapply libcxxrt atomics cleanup commit, preparing for upstream fix
This reapplies upstream commit fd484be, as there is a follow-up fix for
the possible hangs in __cxa_guard_acquire() on i386:

  Atomics cleanup (#11)

  We need to test exception specifiers but they're gone in C++17 so
  compile the tests with an older version of the standard.

  Rewrite the guard logic to be more idiomatic C++ and more
  comprehensible and make sure that atomics are used where necessary.

Obtained from:	https://github.com/libcxxrt/libcxxrt/commit/fd484be
Fixes:		56aaed388b
MFC after:	2 weeks
2022-03-20 22:25:35 +01:00
Dimitry Andric
2548237983 Revert upstream libcxxrt commit which can cause hangs on i386
This reverts upstream commit fd484be:

  Atomics cleanup (#11)

  We need to test exception specifiers but they're gone in C++17 so
  compile the tests with an older version of the standard.

  Rewrite the guard logic to be more idiomatic C++ and more
  comprehensible and make sure that atomics are used where necessary.

It looks like there are some corner cases in the i386 and/or 32-bit
atomics handling, which can make __cxa_guard_acquire() hang in certain
situations.

Reported by:	antoine
Obtained from:	https://github.com/libcxxrt/libcxxrt/commit/fd484be
Fixes:		56aaed388b
MFC after:	2 weeks
2022-03-19 20:47:29 +01:00
Dimitry Andric
56aaed388b Merge libcxxrt master fd484be8d1e94a1fcf6bc5c67e5c07b65ada19b6
Interesting fixes:
47661d0 Match libc++abi/libsupc++ when demangling array types
e44a05c Fix unitialized variable in __cxa_demangle_gnu3 after #6 (#8)
5088b05 Remove some code duplication.
fd484be Atomics cleanup (#11)

MFC after:	2 weeks
2022-03-09 20:45:01 +01:00
Dimitry Andric
35b9ea3d09 Compile libcxxrt as C++11, since it is only really used in combination
with libc++, which is also C++11.  Also change one _Static_assert (which
is really C11) back into static_assert, like upstream.

This should help when compiling libcxxrt with newer versions of gcc,
which refuse to recognize any form of static assertions, if not
compiling for C++11 or higher.

While here, add -nostdinc++ to CFLAGS, to prevent picking up any C++
headers outside the source tree.
2016-03-27 00:37:54 +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
4bab9fd964 Import new libcxxrt / libc++. This brings some bug fixes, including a potential race condition for static initialisers. 2013-07-10 16:28:24 +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