Skip to content

Commit 5e3ed77

Browse files
authored
Update libcxx and libcxxabi to LLVM 19.1.4 (#22994)
This updates libcxx and libcxxabi to LLVM 19.1.4: https://github.com/llvm/llvm-project/releases/tag/llvmorg-19.1.4 The initial update was done using `update_libcxx.py` and `update_libcxxabi.py`, and subsequent fixes were made in indidual commits. The commit history here is kind of messy because of CI testing so not all individual commits are noteworthy. Additional changes: - Build libcxx and libcxxabi with C++23: 8b0bfdf https://github.com/llvm/llvm-project/blob/aadaa00de76ed0c4987b97450dd638f63a385bed/libcxx/src/expected.cpp was added in llvm/llvm-project#87390 and this file assumes C++23 to be compiled. Apparently libc++ sources are always built with C++23 so they don't guard things against it in `src/`: llvm/llvm-project#87390 (comment) This commit also builds libc++abi with C++23 because it doesn't seem there's any downside to it. - Exclude newly added `compiler_rt_shims.cpp`: 5bbcbf0 We have excluded files in https://github.com/emscripten-core/emscripten/tree/main/system/lib/libcxx/src/support/win32. This is a new file added in this directory in llvm/llvm-project#83575. - Disable time zone support: a5f2cbe We disabled C++20 time zone support in LLVM 18 update (#21638): df9af64 The list of source files related to time zone support has changed in llvm/llvm-project#74928, so this commit reflects it. - Re-add + update `__assertion_handler` from `default_assertion_handler.in`: 41f8037 This file was added as a part of LLVM 18 update (#21638) in 8d51927 and mistakenly deleted when I ran `update_libcxx.py`. This file was copied from https://github.com/llvm/llvm-project/blob/aadaa00de76ed0c4987b97450dd638f63a385bed/libcxx/vendor/llvm/default_assertion_handler.in, so this also updates the file with the newest `default_assertion_handler.in`. - `_LIBCPP_PSTL_CPU_BACKEND_SERIAL` -> `_LIBCPP_PSTL_BACKEND_SERIAL`: 4b969c3 The name changed in this update, so reflecting it on our `__config_site`. - Directly include `pthread.h` from `emscripten/val.h`: a5a76c3 Due to file rearrangements happened, this was necessary. --- Other things to note: - `std::basic_string<unsigned_char>` is not supported anymore The support for `std::basic_string<unsigned_char>`, which was being used by embind, is removed in this version.#23070 removes the uses from embind. - libcxxabi uses `__FILE__` in more places llvm/llvm-project#80689 started to use `_LIBCXXABI_ASSERT`, which [uses](https://github.com/llvm/llvm-project/blob/aadaa00de76ed0c4987b97450dd638f63a385bed/libcxxabi/src/abort_message.h#L22) `__FILE__`, in `private_typeinfo.cpp`. `__FILE__` macro produces different paths depending on the local directory names and how the file is given to clang in the command line, and this file is included in the result of one of our code size tests, `other.test_minimal_runtime_code_size_hello_embind`, which caused the result of the test to vary depending on the CI bots and how the library is built (e.g., whether by embuilder, ninja, or neither). Even though this was brought to surface during this LLVM 19 update, `__FILE__` macro could be a problem for producing reproducible builds anyway. We discussed this problem in #23195, and the fixes landed in #23222, #23225, and #23256.
1 parent c040578 commit 5e3ed77

File tree

701 files changed

+21207
-16575
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

701 files changed

+21207
-16575
lines changed

ChangeLog.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ See docs/process.md for more on how version tagging works.
2020

2121
3.1.75 (in development)
2222
-----------------------
23-
- compiler-rt was updated to LLVM 19.1.4. (#22937)
23+
- compiler-rt, libcxx, and libcxxabi were updated to LLVM 19.1.4. (#22937 and
24+
#22994)
2425
- The Wasm nontrapping-fptoint feature has been enabled by default. clang will
2526
generate nontrapping (saturating) float-to-int conversion instructions for
2627
C typecasts. This should have no effect on programs that do not have

system/include/emscripten/val.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include <cstdint> // uintptr_t
1919
#include <vector>
2020
#include <type_traits>
21+
#include <pthread.h>
2122
#if __cplusplus >= 202002L
2223
#include <coroutine>
2324
#include <variant>

system/lib/libcxx/include/__algorithm/adjacent_find.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ _LIBCPP_PUSH_MACROS
2626
_LIBCPP_BEGIN_NAMESPACE_STD
2727

2828
template <class _Iter, class _Sent, class _BinaryPredicate>
29-
_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Iter
29+
_LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Iter
3030
__adjacent_find(_Iter __first, _Sent __last, _BinaryPredicate&& __pred) {
3131
if (__first == __last)
3232
return __first;
@@ -40,13 +40,13 @@ __adjacent_find(_Iter __first, _Sent __last, _BinaryPredicate&& __pred) {
4040
}
4141

4242
template <class _ForwardIterator, class _BinaryPredicate>
43-
_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator
43+
_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator
4444
adjacent_find(_ForwardIterator __first, _ForwardIterator __last, _BinaryPredicate __pred) {
4545
return std::__adjacent_find(std::move(__first), std::move(__last), __pred);
4646
}
4747

4848
template <class _ForwardIterator>
49-
_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator
49+
_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator
5050
adjacent_find(_ForwardIterator __first, _ForwardIterator __last) {
5151
return std::adjacent_find(std::move(__first), std::move(__last), __equal_to());
5252
}

system/lib/libcxx/include/__algorithm/all_of.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
_LIBCPP_BEGIN_NAMESPACE_STD
2020

2121
template <class _InputIterator, class _Predicate>
22-
_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool
22+
_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool
2323
all_of(_InputIterator __first, _InputIterator __last, _Predicate __pred) {
2424
for (; __first != __last; ++__first)
2525
if (!__pred(*__first))

system/lib/libcxx/include/__algorithm/any_of.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
_LIBCPP_BEGIN_NAMESPACE_STD
2020

2121
template <class _InputIterator, class _Predicate>
22-
_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool
22+
_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool
2323
any_of(_InputIterator __first, _InputIterator __last, _Predicate __pred) {
2424
for (; __first != __last; ++__first)
2525
if (__pred(*__first))

system/lib/libcxx/include/__algorithm/binary_search.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@
2222
_LIBCPP_BEGIN_NAMESPACE_STD
2323

2424
template <class _ForwardIterator, class _Tp, class _Compare>
25-
_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool
25+
_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool
2626
binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value, _Compare __comp) {
2727
__first = std::lower_bound<_ForwardIterator, _Tp, __comp_ref_type<_Compare> >(__first, __last, __value, __comp);
2828
return __first != __last && !__comp(__value, *__first);
2929
}
3030

3131
template <class _ForwardIterator, class _Tp>
32-
_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool
32+
_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool
3333
binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value) {
3434
return std::binary_search(__first, __last, __value, __less<>());
3535
}

system/lib/libcxx/include/__algorithm/clamp.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
2121

2222
#if _LIBCPP_STD_VER >= 17
2323
template <class _Tp, class _Compare>
24-
_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI constexpr const _Tp&
24+
[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI constexpr const _Tp&
2525
clamp(_LIBCPP_LIFETIMEBOUND const _Tp& __v,
2626
_LIBCPP_LIFETIMEBOUND const _Tp& __lo,
2727
_LIBCPP_LIFETIMEBOUND const _Tp& __hi,
@@ -31,7 +31,7 @@ clamp(_LIBCPP_LIFETIMEBOUND const _Tp& __v,
3131
}
3232

3333
template <class _Tp>
34-
_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI constexpr const _Tp&
34+
[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI constexpr const _Tp&
3535
clamp(_LIBCPP_LIFETIMEBOUND const _Tp& __v,
3636
_LIBCPP_LIFETIMEBOUND const _Tp& __lo,
3737
_LIBCPP_LIFETIMEBOUND const _Tp& __hi) {

system/lib/libcxx/include/__algorithm/comp.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
#define _LIBCPP___ALGORITHM_COMP_H
1111

1212
#include <__config>
13-
#include <__type_traits/integral_constant.h>
14-
#include <__type_traits/operation_traits.h>
13+
#include <__type_traits/desugars_to.h>
1514

1615
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
1716
# pragma GCC system_header
@@ -27,7 +26,7 @@ struct __equal_to {
2726
};
2827

2928
template <class _Tp, class _Up>
30-
struct __desugars_to<__equal_tag, __equal_to, _Tp, _Up> : true_type {};
29+
inline const bool __desugars_to_v<__equal_tag, __equal_to, _Tp, _Up> = true;
3130

3231
// The definition is required because __less is part of the ABI, but it's empty
3332
// because all comparisons should be transparent.
@@ -42,6 +41,9 @@ struct __less<void, void> {
4241
}
4342
};
4443

44+
template <class _Tp>
45+
inline const bool __desugars_to_v<__less_tag, __less<>, _Tp, _Tp> = true;
46+
4547
_LIBCPP_END_NAMESPACE_STD
4648

4749
#endif // _LIBCPP___ALGORITHM_COMP_H

system/lib/libcxx/include/__algorithm/comp_ref_type.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ struct __debug_less {
4141
}
4242

4343
template <class _LHS, class _RHS>
44-
_LIBCPP_CONSTEXPR_SINCE_CXX14 inline _LIBCPP_HIDE_FROM_ABI decltype((void)std::declval<_Compare&>()(
45-
std::declval<_LHS&>(), std::declval<_RHS&>()))
46-
__do_compare_assert(int, _LHS& __l, _RHS& __r) {
44+
_LIBCPP_CONSTEXPR_SINCE_CXX14 inline
45+
_LIBCPP_HIDE_FROM_ABI decltype((void)std::declval<_Compare&>()(std::declval<_LHS&>(), std::declval<_RHS&>()))
46+
__do_compare_assert(int, _LHS& __l, _RHS& __r) {
4747
_LIBCPP_ASSERT_SEMANTIC_REQUIREMENT(!__comp_(__l, __r), "Comparator does not induce a strict weak ordering");
4848
(void)__l;
4949
(void)__r;

system/lib/libcxx/include/__algorithm/copy.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ template <class, class _InIter, class _Sent, class _OutIter>
3232
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_InIter, _OutIter> __copy(_InIter, _Sent, _OutIter);
3333

3434
template <class _AlgPolicy>
35-
struct __copy_loop {
35+
struct __copy_impl {
3636
template <class _InIter, class _Sent, class _OutIter>
3737
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_InIter, _OutIter>
3838
operator()(_InIter __first, _Sent __last, _OutIter __result) const {
@@ -94,9 +94,7 @@ struct __copy_loop {
9494
__local_first = _Traits::__begin(++__segment_iterator);
9595
}
9696
}
97-
};
9897

99-
struct __copy_trivial {
10098
// At this point, the iterators have been unwrapped so any `contiguous_iterator` has been unwrapped to a pointer.
10199
template <class _In, class _Out, __enable_if_t<__can_lower_copy_assignment_to_memmove<_In, _Out>::value, int> = 0>
102100
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_In*, _Out*>
@@ -108,7 +106,7 @@ struct __copy_trivial {
108106
template <class _AlgPolicy, class _InIter, class _Sent, class _OutIter>
109107
pair<_InIter, _OutIter> inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
110108
__copy(_InIter __first, _Sent __last, _OutIter __result) {
111-
return std::__dispatch_copy_or_move<_AlgPolicy, __copy_loop<_AlgPolicy>, __copy_trivial>(
109+
return std::__copy_move_unwrap_iters<__copy_impl<_AlgPolicy> >(
112110
std::move(__first), std::move(__last), std::move(__result));
113111
}
114112

0 commit comments

Comments
 (0)