From: Jeff Law Date: Sun, 3 Dec 2023 04:54:36 +0000 (-0700) Subject: [committed] Fix frv build after C99 changes X-Git-Tag: basepoints/gcc-15~4055 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=870b63fe71607b94c0e5b0c6e61cd807e0216ddd;p=thirdparty%2Fgcc.git [committed] Fix frv build after C99 changes Two issues prevent the frv-elf port from building after the C99 changes. First the trampoline code emitted into libgcc has calls to exit, but no prototype. Adding a trivial prototype for exit() into the macro fixes that little goof. Second, frvbegin.c has a call to atexit, so a quick prototype is added into frvbegin.c to fix that problem. That's enough to get the compiler building again. gcc/ * config/frv/frv.h (TRANSFER_FROM_TRAMPOLINE): Add prototype for exit. libgcc/ * config/frv/frvbegin.c (atexit): Add prototype. --- diff --git a/gcc/config/frv/frv.h b/gcc/config/frv/frv.h index 979561126f81..93a7c6d0fccc 100644 --- a/gcc/config/frv/frv.h +++ b/gcc/config/frv/frv.h @@ -1241,6 +1241,7 @@ typedef struct frv_stack { #if ! __FRV_FDPIC__ #define TRANSFER_FROM_TRAMPOLINE \ extern int Twrite (int, const void *, unsigned); \ +extern void exit (int); \ \ void \ __trampoline_setup (short * addr, int size, int fnaddr, int sc) \ @@ -1284,6 +1285,7 @@ __asm__("\n" \ #else #define TRANSFER_FROM_TRAMPOLINE \ extern int Twrite (int, const void *, unsigned); \ +extern void exit (int); \ \ void \ __trampoline_setup (addr, size, fnaddr, sc) \ diff --git a/libgcc/config/frv/frvbegin.c b/libgcc/config/frv/frvbegin.c index 76b40ec46c6a..24ea06b1ae72 100644 --- a/libgcc/config/frv/frvbegin.c +++ b/libgcc/config/frv/frvbegin.c @@ -119,6 +119,7 @@ __do_global_dtors (void) } } +int atexit (void (*)(void)); /* Run the global constructors. */ void __do_global_ctors (void)