Skip to content

Commit 09221eb

Browse files
Get exceptions working as they were before.
This no longer uses headers from libcxxabi and in fact uses libcxxabi a bit less than before. This no longer lets some new C++11 stuff such as exception_ptr work as the support for that relies upon libcxxabi code.
1 parent ff1ba5d commit 09221eb

File tree

6 files changed

+104
-344
lines changed

6 files changed

+104
-344
lines changed

emcc

+3-9
Original file line numberDiff line numberDiff line change
@@ -1102,6 +1102,7 @@ try:
11021102
o_s = []
11031103
libc_files = [
11041104
'dlmalloc.c',
1105+
os.path.join('libcxx', 'new.cpp'),
11051106
os.path.join('libc', 'stdlib', 'getopt_long.c'),
11061107
os.path.join('libc', 'gen', 'err.c'),
11071108
os.path.join('libc', 'gen', 'errx.c'),
@@ -1165,8 +1166,7 @@ try:
11651166
'ios.cpp',
11661167
'locale.cpp',
11671168
'regex.cpp',
1168-
'strstream.cpp',
1169-
'typeinfo.cpp'
1169+
'strstream.cpp'
11701170
]
11711171
for src in libcxx_files:
11721172
o = in_temp(src + '.o')
@@ -1189,14 +1189,8 @@ try:
11891189
if DEBUG: print >> sys.stderr, 'emcc: building libcxxabi for cache'
11901190
os = []
11911191
libcxxabi_files = [
1192-
'abort_message.cpp',
1193-
'private_typeinfo.cpp',
11941192
'typeinfo.cpp',
1195-
'cxa_new_delete.cpp',
1196-
'cxa_handlers.cpp',
1197-
'stdexcept.cpp',
1198-
'exception.cpp',
1199-
'cxa_exception_storage.cpp']:
1193+
'private_typeinfo.cpp'
12001194
]
12011195
for src in libcxxabi_files:
12021196
o = in_temp(src + '.o')

system/lib/libc.symbols

+30
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,33 @@
1+
_ZNKSt20bad_array_new_length4whatEv
2+
_ZNKSt9bad_alloc4whatEv
3+
_ZNSt20bad_array_new_lengthC1Ev
4+
_ZNSt20bad_array_new_lengthC2Ev
5+
_ZNSt20bad_array_new_lengthD0Ev
6+
_ZNSt20bad_array_new_lengthD1Ev
7+
_ZNSt20bad_array_new_lengthD2Ev
8+
_ZNSt9bad_allocC1Ev
9+
_ZNSt9bad_allocC2Ev
10+
_ZNSt9bad_allocD0Ev
11+
_ZNSt9bad_allocD1Ev
12+
_ZNSt9bad_allocD2Ev
13+
_ZSt15get_new_handlerv
14+
_ZSt15set_new_handlerPFvvE
15+
_ZSt17__throw_bad_allocv
16+
_ZSt7nothrow
17+
_ZTISt20bad_array_new_length
18+
_ZTISt9bad_alloc
19+
_ZTSSt20bad_array_new_length
20+
_ZTSSt9bad_alloc
21+
_ZTVSt20bad_array_new_length
22+
_ZTVSt9bad_alloc
23+
_ZdaPv
24+
_ZdaPvRKSt9nothrow_t
25+
_ZdlPv
26+
_ZdlPvRKSt9nothrow_t
27+
_Znaj
28+
_ZnajRKSt9nothrow_t
29+
_Znwj
30+
_ZnwjRKSt9nothrow_t
131
_err
232
_errx
333
_verr

system/lib/libcxx/exception.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ get_terminate() _NOEXCEPT
7777
return __sync_fetch_and_add(&__terminate_handler, (terminate_handler)0);
7878
}
7979

80+
#ifndef EMSCRIPTEN // We provide this in JS
8081
_LIBCPP_NORETURN
8182
void
8283
terminate() _NOEXCEPT
@@ -97,9 +98,10 @@ terminate() _NOEXCEPT
9798
}
9899
#endif // _LIBCPP_NO_EXCEPTIONS
99100
}
101+
#endif // !EMSCRIPTEN
100102
#endif // !defined(LIBCXXRT) && !defined(_LIBCPPABI_VERSION)
101103

102-
#if !defined(LIBCXXRT) && !defined(__GLIBCXX__)
104+
#if !defined(LIBCXXRT) && !defined(__GLIBCXX__) && !defined(EMSCRIPTEN)
103105
bool uncaught_exception() _NOEXCEPT
104106
{
105107
#if __APPLE__ || defined(_LIBCPPABI_VERSION)

0 commit comments

Comments
 (0)