Index: dist/gcc/ginclude/unwind-arm-common.h =================================================================== RCS file: /cvsroot/src/external/gpl3/gcc/dist/gcc/ginclude/unwind-arm-common.h,v retrieving revision 1.5 diff -p -u -u -r1.5 unwind-arm-common.h --- dist/gcc/ginclude/unwind-arm-common.h 19 Jan 2019 12:10:08 -0000 1.5 +++ dist/gcc/ginclude/unwind-arm-common.h 5 Feb 2019 21:51:18 -0000 @@ -27,7 +27,9 @@ #ifndef UNWIND_ARM_COMMON_H #define UNWIND_ARM_COMMON_H +#ifndef __NetBSD__ #define __ARM_EABI_UNWINDER__ 1 +#endif #ifdef __cplusplus extern "C" { @@ -45,6 +47,7 @@ extern "C" { { _URC_OK = 0, /* operation completed successfully */ _URC_FOREIGN_EXCEPTION_CAUGHT = 1, + _URC_FATAL_PHASE1_ERROR = 3, _URC_END_OF_STACK = 5, _URC_HANDLER_FOUND = 6, _URC_INSTALL_CONTEXT = 7, Index: dist/libobjc/exception.c =================================================================== RCS file: /cvsroot/src/external/gpl3/gcc/dist/libobjc/exception.c,v retrieving revision 1.1.1.5 diff -p -u -u -r1.1.1.5 exception.c --- dist/libobjc/exception.c 19 Jan 2019 10:14:40 -0000 1.1.1.5 +++ dist/libobjc/exception.c 5 Feb 2019 21:51:18 -0000 @@ -83,7 +83,7 @@ objc_setUncaughtExceptionHandler (objc_u -#ifdef __ARM_EABI_UNWINDER__ +#if defined(__ARM_EABI_UNWINDER__) || (defined(__arm__) && defined(__NetBSD__)) const _Unwind_Exception_Class __objc_exception_class = {'G', 'N', 'U', 'C', 'O', 'B', 'J', 'C'}; @@ -289,7 +289,7 @@ PERSONALITY_FUNCTION (int version, #else /* !__ARM_EABI_UNWINDER. */ /* Interface version check. */ if (version != 1) - return _URC_FATAL_PHASE1_ERROR; + return _URC_FAILURE; foreign_exception = (exception_class != __objc_exception_class); #endif Index: dist/libstdc++-v3/libsupc++/unwind-cxx.h =================================================================== RCS file: /cvsroot/src/external/gpl3/gcc/dist/libstdc++-v3/libsupc++/unwind-cxx.h,v retrieving revision 1.6 diff -p -u -u -r1.6 unwind-cxx.h --- dist/libstdc++-v3/libsupc++/unwind-cxx.h 19 Jan 2019 12:10:14 -0000 1.6 +++ dist/libstdc++-v3/libsupc++/unwind-cxx.h 5 Feb 2019 21:51:18 -0000 @@ -235,7 +235,7 @@ __get_dependent_exception_from_ue (_Unwi return reinterpret_cast<__cxa_dependent_exception *>(exc + 1) - 1; } -#ifdef __ARM_EABI_UNWINDER__ +#if defined(__ARM_EABI_UNWINDER__) || (defined(__arm__) && defined(__NetBSD__)) static inline bool __is_gxx_exception_class(_Unwind_Exception_Class c) { @@ -310,12 +310,7 @@ __GXX_INIT_FORCED_UNWIND_CLASS(_Unwind_E c[7] = '\0'; } -static inline void* -__gxx_caught_object(_Unwind_Exception* eo) -{ - return (void*)eo->barrier_cache.bitpattern[0]; -} -#else // !__ARM_EABI_UNWINDER__ +#else // !(__ARM_EABI_UNWINDER__ || (__arm__ && __NetBSD__)) // This is the primary exception class we report -- "GNUCC++\0". const _Unwind_Exception_Class __gxx_primary_exception_class = ((((((((_Unwind_Exception_Class) 'G' @@ -367,7 +362,15 @@ extern "C" _Unwind_Reason_Code __gxx_per extern "C" _Unwind_Reason_Code __gxx_personality_sj0 (int, _Unwind_Action, _Unwind_Exception_Class, struct _Unwind_Exception *, struct _Unwind_Context *); +#endif // !(__ARM_EABI_UNWINDER__ || (__arm__ && __NetBSD__)) +#ifdef __ARM_EABI_UNWINDER__ +static inline void* +__gxx_caught_object(_Unwind_Exception* eo) +{ + return (void*)eo->barrier_cache.bitpattern[0]; +} +#else // __ARM_EABI_UNWINDER__ static inline void* __gxx_caught_object(_Unwind_Exception* eo) {