From 84479e3a4cebbf2914f748cb363c054abfd47cb6 Mon Sep 17 00:00:00 2001 From: John David Anglin Date: Sat, 18 Jan 2020 10:30:29 -0500 Subject: [PATCH] Fix compilation of crtstuff.c when DEFAULT_USE_CXA_ATEXIT is false PR libgcc/92988 * crtstuff.c (__do_global_dtors_aux): Only call __cxa_finalize if DEFAULT_USE_CXA_ATEXIT is true. --- libgcc/ChangeLog | 6 ++++++ libgcc/crtstuff.c | 2 ++ 2 files changed, 8 insertions(+) diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 5ad3ac12ec3..a0c1e30c5a7 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,9 @@ +2020-01-18 John David Anglin + + PR libgcc/92988 + * crtstuff.c (__do_global_dtors_aux): Only call __cxa_finalize if + DEFAULT_USE_CXA_ATEXIT is true. + 2020-01-16 Mihail-Calin Ionescu Thomas Preud'homme diff --git a/libgcc/crtstuff.c b/libgcc/crtstuff.c index 956b84310dd..3f769a1c660 100644 --- a/libgcc/crtstuff.c +++ b/libgcc/crtstuff.c @@ -382,10 +382,12 @@ __do_global_dtors_aux (void) if (__builtin_expect (completed, 0)) return; +#if DEFAULT_USE_CXA_ATEXIT #ifdef CRTSTUFFS_O if (__cxa_finalize) __cxa_finalize (__dso_handle); #endif +#endif #ifdef FINI_ARRAY_SECTION_ASM_OP /* If we are using .fini_array then destructors will be run via that -- 2.30.2