Skip to content

Commit

Permalink
Get exceptions working as they were before.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
waywardmonkeys committed Mar 25, 2013
1 parent ff1ba5d commit 09221eb
Show file tree
Hide file tree
Showing 6 changed files with 104 additions and 344 deletions.
12 changes: 3 additions & 9 deletions emcc
Original file line number Diff line number Diff line change
Expand Up @@ -1102,6 +1102,7 @@ try:
o_s = []
libc_files = [
'dlmalloc.c',
os.path.join('libcxx', 'new.cpp'),
os.path.join('libc', 'stdlib', 'getopt_long.c'),
os.path.join('libc', 'gen', 'err.c'),
os.path.join('libc', 'gen', 'errx.c'),
Expand Down Expand Up @@ -1165,8 +1166,7 @@ try:
'ios.cpp',
'locale.cpp',
'regex.cpp',
'strstream.cpp',
'typeinfo.cpp'
'strstream.cpp'
]
for src in libcxx_files:
o = in_temp(src + '.o')
Expand All @@ -1189,14 +1189,8 @@ try:
if DEBUG: print >> sys.stderr, 'emcc: building libcxxabi for cache'
os = []
libcxxabi_files = [
'abort_message.cpp',
'private_typeinfo.cpp',
'typeinfo.cpp',
'cxa_new_delete.cpp',
'cxa_handlers.cpp',
'stdexcept.cpp',
'exception.cpp',
'cxa_exception_storage.cpp']:
'private_typeinfo.cpp'
]
for src in libcxxabi_files:
o = in_temp(src + '.o')
Expand Down
30 changes: 30 additions & 0 deletions system/lib/libc.symbols
Original file line number Diff line number Diff line change
@@ -1,3 +1,33 @@
_ZNKSt20bad_array_new_length4whatEv
_ZNKSt9bad_alloc4whatEv
_ZNSt20bad_array_new_lengthC1Ev
_ZNSt20bad_array_new_lengthC2Ev
_ZNSt20bad_array_new_lengthD0Ev
_ZNSt20bad_array_new_lengthD1Ev
_ZNSt20bad_array_new_lengthD2Ev
_ZNSt9bad_allocC1Ev
_ZNSt9bad_allocC2Ev
_ZNSt9bad_allocD0Ev
_ZNSt9bad_allocD1Ev
_ZNSt9bad_allocD2Ev
_ZSt15get_new_handlerv
_ZSt15set_new_handlerPFvvE
_ZSt17__throw_bad_allocv
_ZSt7nothrow
_ZTISt20bad_array_new_length
_ZTISt9bad_alloc
_ZTSSt20bad_array_new_length
_ZTSSt9bad_alloc
_ZTVSt20bad_array_new_length
_ZTVSt9bad_alloc
_ZdaPv
_ZdaPvRKSt9nothrow_t
_ZdlPv
_ZdlPvRKSt9nothrow_t
_Znaj
_ZnajRKSt9nothrow_t
_Znwj
_ZnwjRKSt9nothrow_t
_err
_errx
_verr
Expand Down
4 changes: 3 additions & 1 deletion system/lib/libcxx/exception.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ get_terminate() _NOEXCEPT
return __sync_fetch_and_add(&__terminate_handler, (terminate_handler)0);
}

#ifndef EMSCRIPTEN // We provide this in JS
_LIBCPP_NORETURN
void
terminate() _NOEXCEPT
Expand All @@ -97,9 +98,10 @@ terminate() _NOEXCEPT
}
#endif // _LIBCPP_NO_EXCEPTIONS
}
#endif // !EMSCRIPTEN
#endif // !defined(LIBCXXRT) && !defined(_LIBCPPABI_VERSION)

#if !defined(LIBCXXRT) && !defined(__GLIBCXX__)
#if !defined(LIBCXXRT) && !defined(__GLIBCXX__) && !defined(EMSCRIPTEN)
bool uncaught_exception() _NOEXCEPT
{
#if __APPLE__ || defined(_LIBCPPABI_VERSION)
Expand Down
Loading

0 comments on commit 09221eb

Please sign in to comment.