]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[committed] Fix frv build after C99 changes
authorJeff Law <jlaw@ventanamicro.com>
Sun, 3 Dec 2023 04:54:36 +0000 (21:54 -0700)
committerJeff Law <jlaw@ventanamicro.com>
Sun, 3 Dec 2023 04:54:36 +0000 (21:54 -0700)
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.

gcc/config/frv/frv.h
libgcc/config/frv/frvbegin.c

index 979561126f81c5312a8dc089a90e8cefabcfa803..93a7c6d0fcccbf1fb626b3f6d8db87cc782accef 100644 (file)
@@ -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)                            \
index 76b40ec46c6a5e70fcb8073a866482cc439b5771..24ea06b1ae7248795a0c900106944925802f03b5 100644 (file)
@@ -119,6 +119,7 @@ __do_global_dtors (void)
     }
 }
 
+int atexit (void (*)(void));
 /* Run the global constructors.  */
 void
 __do_global_ctors (void)