Hi! On 2022-12-20T09:03:51+0100, I wrote: > Minor change in the attached > "nvptx: Support global constructors/destructors via 'collect2'": for > 'atexit', add '#include ' to 'libgcc/config/nvptx/crt0.c'. Turns out, it's not that easy. ;-) Pushed to devel/omp/gcc-12 branch commit d90a8a5685c8bd3657892feac01739fe87a457a5 "Make 'libgcc/config/nvptx/crt0.c' build '--without-headers'", see attached. Please consider that one 'fixup'ed into the GCC master branch submission. Grüße Thomas > --- a/libgcc/config/nvptx/crt0.c > +++ b/libgcc/config/nvptx/crt0.c > @@ -19,6 +19,9 @@ > see the files COPYING3 and COPYING.RUNTIME respectively. If not, see > . */ > > +#include > +#include "gbl-ctors.h" > + > int *__exitval_ptr; > > extern void __attribute__((noreturn)) exit (int status); > @@ -47,5 +50,8 @@ __main (int *rval_ptr, int argc, void **argv) > __nvptx_stacks[0] = stack + sizeof stack; > __nvptx_uni[0] = 0; > > + __do_global_ctors (); > + atexit (__do_global_dtors); > + > exit (main (argc, argv)); > } ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955