Skip to content

Commit 1bc4900

Browse files
authored
Update llvm libraries to 15.0.6 (#18328)
1 parent 515e349 commit 1bc4900

File tree

8 files changed

+48
-66
lines changed

8 files changed

+48
-66
lines changed

system/lib/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6703,7 +6703,7 @@ INTERCEPTOR(int, sem_init, __sanitizer_sem_t *s, int pshared, unsigned value) {
67036703
COMMON_INTERCEPTOR_ENTER(ctx, sem_init, s, pshared, value);
67046704
// Workaround a bug in glibc's "old" semaphore implementation by
67056705
// zero-initializing the sem_t contents. This has to be done here because
6706-
// interceptors bind to the lowest symbols version by default, hitting the
6706+
// interceptors bind to the lowest version before glibc 2.36, hitting the
67076707
// buggy code path while the non-sanitized build of the same code works fine.
67086708
REAL(memset)(s, 0, sizeof(*s));
67096709
int res = REAL(sem_init)(s, pshared, value);

system/lib/libcxx/include/__config

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,21 @@
2222
# pragma GCC system_header
2323
#endif
2424

25+
#if defined(__apple_build_version__)
26+
# define _LIBCPP_COMPILER_CLANG_BASED
27+
# define _LIBCPP_APPLE_CLANG_VER (__apple_build_version__ / 10000)
28+
#elif defined(__clang__)
29+
# define _LIBCPP_COMPILER_CLANG_BASED
30+
# define _LIBCPP_CLANG_VER (__clang_major__ * 100 + __clang_minor__)
31+
#elif defined(__GNUC__)
32+
# define _LIBCPP_COMPILER_GCC
33+
#elif defined(_MSC_VER)
34+
# define _LIBCPP_COMPILER_MSVC
35+
#endif
36+
2537
#ifdef __cplusplus
2638

27-
# define _LIBCPP_VERSION 15000
39+
# define _LIBCPP_VERSION 15006
2840

2941
# define _LIBCPP_CONCAT_IMPL(_X, _Y) _X##_Y
3042
# define _LIBCPP_CONCAT(_X, _Y) _LIBCPP_CONCAT_IMPL(_X, _Y)
@@ -199,18 +211,6 @@
199211
# define __has_include(...) 0
200212
# endif
201213

202-
# if defined(__apple_build_version__)
203-
# define _LIBCPP_COMPILER_CLANG_BASED
204-
# define _LIBCPP_APPLE_CLANG_VER (__apple_build_version__ / 10000)
205-
# elif defined(__clang__)
206-
# define _LIBCPP_COMPILER_CLANG_BASED
207-
# define _LIBCPP_CLANG_VER (__clang_major__ * 100 + __clang_minor__)
208-
# elif defined(__GNUC__)
209-
# define _LIBCPP_COMPILER_GCC
210-
# elif defined(_MSC_VER)
211-
# define _LIBCPP_COMPILER_MSVC
212-
# endif
213-
214214
# if !defined(_LIBCPP_COMPILER_CLANG_BASED) && __cplusplus < 201103L
215215
# error "libc++ only supports C++03 with Clang-based compilers. Please enable C++11"
216216
# endif
@@ -1102,6 +1102,13 @@ _LIBCPP_BEGIN_NAMESPACE_STD _LIBCPP_END_NAMESPACE_STD
11021102
# define _LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION
11031103
# endif // _LIBCPP_ENABLE_CXX17_REMOVED_FEATURES
11041104

1105+
// Leave the deprecation notices in by default, but don't remove unary_function and
1106+
// binary_function entirely just yet. That way, folks will have one release to act
1107+
// on the deprecation warnings.
1108+
# ifndef _LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION
1109+
# define _LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION
1110+
# endif
1111+
11051112
# if defined(_LIBCPP_ENABLE_CXX20_REMOVED_FEATURES)
11061113
# define _LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS
11071114
# define _LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_VOID_SPECIALIZATION

system/lib/libcxx/include/__functional/function.h

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -883,7 +883,7 @@ template <class _Rp, class... _ArgTypes> class __policy_func<_Rp(_ArgTypes...)>
883883
#endif // _LIBCPP_NO_RTTI
884884
};
885885

886-
#if defined(_LIBCPP_HAS_BLOCKS_RUNTIME) && !defined(_LIBCPP_HAS_OBJC_ARC)
886+
#if defined(_LIBCPP_HAS_BLOCKS_RUNTIME)
887887

888888
extern "C" void *_Block_copy(const void *);
889889
extern "C" void _Block_release(const void *);
@@ -898,14 +898,22 @@ class __func<_Rp1(^)(_ArgTypes1...), _Alloc, _Rp(_ArgTypes...)>
898898
public:
899899
_LIBCPP_INLINE_VISIBILITY
900900
explicit __func(__block_type const& __f)
901+
#ifdef _LIBCPP_HAS_OBJC_ARC
902+
: __f_(__f)
903+
#else
901904
: __f_(reinterpret_cast<__block_type>(__f ? _Block_copy(__f) : nullptr))
905+
#endif
902906
{ }
903907

904908
// [TODO] add && to save on a retain
905909

906910
_LIBCPP_INLINE_VISIBILITY
907911
explicit __func(__block_type __f, const _Alloc& /* unused */)
912+
#ifdef _LIBCPP_HAS_OBJC_ARC
913+
: __f_(__f)
914+
#else
908915
: __f_(reinterpret_cast<__block_type>(__f ? _Block_copy(__f) : nullptr))
916+
#endif
909917
{ }
910918

911919
virtual __base<_Rp(_ArgTypes...)>* __clone() const {
@@ -921,8 +929,10 @@ class __func<_Rp1(^)(_ArgTypes1...), _Alloc, _Rp(_ArgTypes...)>
921929
}
922930

923931
virtual void destroy() _NOEXCEPT {
932+
#ifndef _LIBCPP_HAS_OBJC_ARC
924933
if (__f_)
925934
_Block_release(__f_);
935+
#endif
926936
__f_ = 0;
927937
}
928938

@@ -950,7 +960,7 @@ class __func<_Rp1(^)(_ArgTypes1...), _Alloc, _Rp(_ArgTypes...)>
950960
#endif // _LIBCPP_NO_RTTI
951961
};
952962

953-
#endif // _LIBCPP_HAS_EXTENSION_BLOCKS && !_LIBCPP_HAS_OBJC_ARC
963+
#endif // _LIBCPP_HAS_EXTENSION_BLOCKS
954964

955965
} // namespace __function
956966

system/lib/libcxx/include/atomic

Lines changed: 9 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1113,6 +1113,12 @@ _Tp kill_dependency(_Tp __y) _NOEXCEPT
11131113
# define ATOMIC_POINTER_LOCK_FREE __GCC_ATOMIC_POINTER_LOCK_FREE
11141114
#endif
11151115

1116+
template <class _Tp>
1117+
struct __libcpp_is_always_lock_free {
1118+
// __atomic_always_lock_free is available in all Standard modes
1119+
static const bool __value = __atomic_always_lock_free(sizeof(_Tp), 0);
1120+
};
1121+
11161122
#ifdef _LIBCPP_ATOMIC_ONLY_USE_BUILTINS
11171123

11181124
template<typename _Tp>
@@ -1404,42 +1410,8 @@ _Tp __cxx_atomic_fetch_xor(__cxx_atomic_lock_impl<_Tp>* __a,
14041410
return __old;
14051411
}
14061412

1407-
#ifdef __cpp_lib_atomic_is_always_lock_free
1408-
1409-
template<typename _Tp> struct __cxx_is_always_lock_free {
1410-
enum { __value = __atomic_always_lock_free(sizeof(_Tp), 0) }; };
1411-
1412-
#else
1413-
1414-
template<typename _Tp> struct __cxx_is_always_lock_free { enum { __value = false }; };
1415-
// Implementations must match the C ATOMIC_*_LOCK_FREE macro values.
1416-
template<> struct __cxx_is_always_lock_free<bool> { enum { __value = 2 == ATOMIC_BOOL_LOCK_FREE }; };
1417-
template<> struct __cxx_is_always_lock_free<char> { enum { __value = 2 == ATOMIC_CHAR_LOCK_FREE }; };
1418-
template<> struct __cxx_is_always_lock_free<signed char> { enum { __value = 2 == ATOMIC_CHAR_LOCK_FREE }; };
1419-
template<> struct __cxx_is_always_lock_free<unsigned char> { enum { __value = 2 == ATOMIC_CHAR_LOCK_FREE }; };
1420-
#ifndef _LIBCPP_HAS_NO_CHAR8_T
1421-
template<> struct __cxx_is_always_lock_free<char8_t> { enum { __value = 2 == ATOMIC_CHAR8_T_LOCK_FREE }; };
1422-
#endif
1423-
template<> struct __cxx_is_always_lock_free<char16_t> { enum { __value = 2 == ATOMIC_CHAR16_T_LOCK_FREE }; };
1424-
template<> struct __cxx_is_always_lock_free<char32_t> { enum { __value = 2 == ATOMIC_CHAR32_T_LOCK_FREE }; };
1425-
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
1426-
template<> struct __cxx_is_always_lock_free<wchar_t> { enum { __value = 2 == ATOMIC_WCHAR_T_LOCK_FREE }; };
1427-
#endif
1428-
template<> struct __cxx_is_always_lock_free<short> { enum { __value = 2 == ATOMIC_SHORT_LOCK_FREE }; };
1429-
template<> struct __cxx_is_always_lock_free<unsigned short> { enum { __value = 2 == ATOMIC_SHORT_LOCK_FREE }; };
1430-
template<> struct __cxx_is_always_lock_free<int> { enum { __value = 2 == ATOMIC_INT_LOCK_FREE }; };
1431-
template<> struct __cxx_is_always_lock_free<unsigned int> { enum { __value = 2 == ATOMIC_INT_LOCK_FREE }; };
1432-
template<> struct __cxx_is_always_lock_free<long> { enum { __value = 2 == ATOMIC_LONG_LOCK_FREE }; };
1433-
template<> struct __cxx_is_always_lock_free<unsigned long> { enum { __value = 2 == ATOMIC_LONG_LOCK_FREE }; };
1434-
template<> struct __cxx_is_always_lock_free<long long> { enum { __value = 2 == ATOMIC_LLONG_LOCK_FREE }; };
1435-
template<> struct __cxx_is_always_lock_free<unsigned long long> { enum { __value = 2 == ATOMIC_LLONG_LOCK_FREE }; };
1436-
template<typename _Tp> struct __cxx_is_always_lock_free<_Tp*> { enum { __value = 2 == ATOMIC_POINTER_LOCK_FREE }; };
1437-
template<> struct __cxx_is_always_lock_free<std::nullptr_t> { enum { __value = 2 == ATOMIC_POINTER_LOCK_FREE }; };
1438-
1439-
#endif //__cpp_lib_atomic_is_always_lock_free
1440-
14411413
template <typename _Tp,
1442-
typename _Base = typename conditional<__cxx_is_always_lock_free<_Tp>::__value,
1414+
typename _Base = typename conditional<__libcpp_is_always_lock_free<_Tp>::__value,
14431415
__cxx_atomic_base_impl<_Tp>,
14441416
__cxx_atomic_lock_impl<_Tp> >::type>
14451417
#else
@@ -1561,7 +1533,7 @@ struct __atomic_base // false
15611533
mutable __cxx_atomic_impl<_Tp> __a_;
15621534

15631535
#if defined(__cpp_lib_atomic_is_always_lock_free)
1564-
static _LIBCPP_CONSTEXPR bool is_always_lock_free = __atomic_always_lock_free(sizeof(__a_), 0);
1536+
static _LIBCPP_CONSTEXPR bool is_always_lock_free = __libcpp_is_always_lock_free<__cxx_atomic_impl<_Tp> >::__value;
15651537
#endif
15661538

15671539
_LIBCPP_INLINE_VISIBILITY
@@ -2664,7 +2636,7 @@ typedef atomic<uintmax_t> atomic_uintmax_t;
26642636
// atomic_*_lock_free : prefer the contention type most highly, then the largest lock-free type
26652637

26662638
#ifdef __cpp_lib_atomic_is_always_lock_free
2667-
# define _LIBCPP_CONTENTION_LOCK_FREE __atomic_always_lock_free(sizeof(__cxx_contention_t), 0)
2639+
# define _LIBCPP_CONTENTION_LOCK_FREE ::std::__libcpp_is_always_lock_free<__cxx_contention_t>::__value
26682640
#else
26692641
# define _LIBCPP_CONTENTION_LOCK_FREE false
26702642
#endif

system/lib/libcxx/include/stdatomic.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ using std::atomic_signal_fence // see below
121121
# pragma GCC system_header
122122
#endif
123123

124-
#if _LIBCPP_STD_VER > 20
124+
#if defined(__cplusplus) && _LIBCPP_STD_VER > 20
125125

126126
#include <atomic>
127127
#include <version>
@@ -230,6 +230,6 @@ using std::atomic_thread_fence _LIBCPP_USING_IF_EXISTS;
230230
# include_next <stdatomic.h>
231231
# endif
232232

233-
#endif // _LIBCPP_STD_VER > 20
233+
#endif // defined(__cplusplus) && _LIBCPP_STD_VER > 20
234234

235235
#endif // _LIBCPP_STDATOMIC_H

system/lib/libcxx/include/version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ __cpp_lib_void_t 201411L <type_traits>
332332
# undef __cpp_lib_execution
333333
// # define __cpp_lib_execution 201902L
334334
# if !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_format) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT)
335-
# define __cpp_lib_format 202106L
335+
// # define __cpp_lib_format 202106L
336336
# endif
337337
# define __cpp_lib_generic_unordered_lookup 201811L
338338
# define __cpp_lib_int_pow2 202002L

system/lib/libcxx/readme.txt

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
11
llvm's libcxx
22
-------------
33

4-
These files are from the llvm-project based on release 14.0.0.
4+
These files are from the llvm-project based on release 15.0.0.
55

66
We maintain a local fork of llvm-project that contains any emscripten
77
specific patches:
88

99
https://github.com/emscripten-core/llvm-project
1010

11-
The current patch is based on:
12-
13-
tag: llvmorg-14.0.0
14-
git: 329fda39c507e8740978d10458451dcdb21563be
11+
The current patch is based on the emscripten-libs-15.0.0 tag.
1512

1613
Update Instructions
1714
-------------------
@@ -23,4 +20,4 @@ Modifications
2320

2421
For a list of changes from upstream see the libcxx files that are part of:
2522

26-
https://github.com/llvm/llvm-project/compare/llvmorg-14.0.0...emscripten-core:emscripten-libs-14.0.0
23+
https://github.com/llvm/llvm-project/compare/llvmorg-15.0.0...emscripten-core:emscripten-libs-15.0.0

test/test_browser.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3295,10 +3295,6 @@ def test_cocos2d_hello(self):
32953295
self.btest('cocos2d_hello.cpp', reference='cocos2d_hello.png', reference_slack=1,
32963296
args=['-sUSE_COCOS2D=3', '-sERROR_ON_UNDEFINED_SYMBOLS=0',
32973297
'-Wno-js-compiler',
3298-
# cocos2d uses std::binary_function which was removing in C++17.
3299-
# We could pass `-std=c++14` here but that doesn't currently work for btest
3300-
# since we compile a C file (report_result.c) in the same command.
3301-
'-D_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION',
33023298
'--preload-file', preload_file, '--use-preload-plugins',
33033299
'-Wno-inconsistent-missing-override',
33043300
'-Wno-deprecated-declarations'])

0 commit comments

Comments
 (0)