diff options
Diffstat (limited to 'libgcc/config/gcn')
-rw-r--r-- | libgcc/config/gcn/crt0.c | 32 | ||||
-rw-r--r-- | libgcc/config/gcn/unwind-gcn.c | 6 |
2 files changed, 38 insertions, 0 deletions
diff --git a/libgcc/config/gcn/crt0.c b/libgcc/config/gcn/crt0.c index dbd6749..cc23e21 100644 --- a/libgcc/config/gcn/crt0.c +++ b/libgcc/config/gcn/crt0.c @@ -24,6 +24,28 @@ typedef long long size_t; /* Provide an entry point symbol to silence a linker warning. */ void _start() {} + +#define PR119369_fixed 0 + + +/* Host/device compatibility: '__cxa_finalize'. Dummy; if necessary, + overridden via libgomp 'target-cxa-dso-dtor.c'. */ + +#if PR119369_fixed +extern void __GCC_offload___cxa_finalize (void *) __attribute__((weak)); +#else +void __GCC_offload___cxa_finalize (void *) __attribute__((weak)); + +void __attribute__((weak)) +__GCC_offload___cxa_finalize (void *dso_handle __attribute__((unused))) +{ +} +#endif + +/* There are no DSOs; this is the main program. */ +static void * const __dso_handle = 0; + + #ifdef USE_NEWLIB_INITFINI extern void __libc_init_array (void) __attribute__((weak)); @@ -38,6 +60,11 @@ void _init_array() __attribute__((amdgpu_hsa_kernel ())) void _fini_array() { +#if PR119369_fixed + if (__GCC_offload___cxa_finalize) +#endif + __GCC_offload___cxa_finalize (__dso_handle); + __libc_fini_array (); } @@ -70,6 +97,11 @@ void _init_array() __attribute__((amdgpu_hsa_kernel ())) void _fini_array() { +#if PR119369_fixed + if (__GCC_offload___cxa_finalize) +#endif + __GCC_offload___cxa_finalize (__dso_handle); + size_t count; size_t i; diff --git a/libgcc/config/gcn/unwind-gcn.c b/libgcc/config/gcn/unwind-gcn.c index eae741c..97e22c0 100644 --- a/libgcc/config/gcn/unwind-gcn.c +++ b/libgcc/config/gcn/unwind-gcn.c @@ -38,6 +38,12 @@ _Unwind_DeleteException (struct _Unwind_Exception *exc) (*exc->exception_cleanup) (_URC_FOREIGN_EXCEPTION_CAUGHT, exc); } +void +_Unwind_Resume (struct _Unwind_Exception *exc __attribute__ ((__unused__))) +{ + __builtin_abort (); +} + _Unwind_Reason_Code _Unwind_Resume_or_Rethrow (struct _Unwind_Exception *exc __attribute__ ((__unused__))) { |