diff --git a/base/lib/import/import-stdcxx.mk b/base/lib/import/import-stdcxx.mk index 14c96db2ef..003d15b3cc 100644 --- a/base/lib/import/import-stdcxx.mk +++ b/base/lib/import/import-stdcxx.mk @@ -15,6 +15,9 @@ INC_DIR += $(shell echo "int main() {return 0;}" |\ sed '/^\#include <\.\.\.> search starts here:/,/^End of search list/!d' |\ grep "c++") +# avoid multiple definition of type _mbstate_t +CC_CXX_OPT += -D_GLIBCXX_HAVE_MBSTATE_T + # # Link libstdc++ that comes with the tool chain # diff --git a/base/lib/mk/cxx.mk b/base/lib/mk/cxx.mk index ca1f9d1716..2185c7c389 100644 --- a/base/lib/mk/cxx.mk +++ b/base/lib/mk/cxx.mk @@ -15,7 +15,7 @@ LIBC_SYMBOLS += malloc free calloc realloc \ # # Symbols we wrap (see unwind.cc) # -EH_SYMBOLS = _Unwind_Resume +EH_SYMBOLS = _Unwind_Resume _Unwind_Complete _Unwind_DeleteException # # Additional functions for ARM diff --git a/base/src/base/cxx/unwind.cc b/base/src/base/cxx/unwind.cc index 41995c5e91..265387a38e 100644 --- a/base/src/base/cxx/unwind.cc +++ b/base/src/base/cxx/unwind.cc @@ -27,9 +27,13 @@ extern "C" { /* Unwind function found in all binaries */ void _cxx__Unwind_Resume(void *exc) __attribute__((weak)); - void __cxx__Unwind_Resume(void *exc) { + void __cxx__Unwind_Resume(void *exc) { _cxx__Unwind_Resume(exc); } + void _cxx__Unwind_DeleteException(void *exc) __attribute__((weak)); + void __cxx__Unwind_DeleteException(void *exc) { + _cxx__Unwind_DeleteException(exc); } + /* Special ARM-EABI personality functions */ #ifdef __ARM_EABI__ @@ -41,5 +45,9 @@ extern "C" { int __cxx___aeabi_unwind_cpp_pr1(int state, void *block, void *context) { return _cxx___aeabi_unwind_cpp_pr1(state, block, context); } + /* Unwind functions found in some binaries */ + void _cxx__Unwind_Complete(void *exc) __attribute__((weak)); + void __cxx__Unwind_Complete(void *exc) { + _cxx__Unwind_Complete(exc); } #endif } diff --git a/os/src/lib/ldso/symbol.map b/os/src/lib/ldso/symbol.map index 661abdb99a..ee7f741d9d 100644 --- a/os/src/lib/ldso/symbol.map +++ b/os/src/lib/ldso/symbol.map @@ -54,6 +54,8 @@ /* x86 */ __cxa*; + _Unwind_Complete; + _Unwind_DeleteException; _Unwind_Resume; __gxx_personality_v0;