4
0
mirror of git://sourceware.org/git/newlib-cygwin.git synced 2025-02-21 00:07:36 +08:00

Fix epiphany libgloss for c99/gcc-14

So in this case we mostly need to include an internal header
(epiphany-syscalls.h).  In a few cases an explicit prototype is added.  We've
also got a return with no value in a function with a non-void return type.
Finally the asm_syscall interface expects a pointer as its first argument.  In
a few cases we've actually got an int (file descriptor) which we just cast to a
void *.

It's slightly more than Jeff J's pre-approval, but I think still reasonable.
This commit is contained in:
Jeff Law 2023-12-22 21:29:56 -07:00
parent 5e79655f38
commit 1df8f9f09b
9 changed files with 12 additions and 3 deletions

View File

@ -18,6 +18,7 @@
#include <sys/stat.h>
#include <errno.h>
#include "epiphany-syscalls.h"
int
_isatty (int fd)

View File

@ -253,7 +253,7 @@ int __attribute__ ((section ("libgloss_epiphany"))) e_raise(int signum) {
__asm__ __volatile__ ("wand");
//ilatst = 1 << WAND_IVT_N;
//break;
return;
return 0;
case SIG_USR1:
ilatst = 1 << USR_SOFT_IVT_N;

View File

@ -35,5 +35,7 @@ int asm_open(const char* FILE, int FLAGS, int MODE);
void asm_exit(int STATUS);
int asm_close(int CHAN);
int asm_syscall(void *P1, void *P2, void *P3, int SUBFUN);
int _fstat (int, struct stat *st);
#endif

View File

@ -31,6 +31,7 @@
#include <sys/stat.h>
#include <syscall.h>
#include "epiphany-syscalls.h"
/* ------------------------------------------------------------------------- */
@ -44,6 +45,6 @@
int __attribute__ ((section ("libgloss_epiphany")))
_fstat (int fildes, struct stat *st)
{
return asm_syscall (fildes, st, NULL, SYS_fstat);
return asm_syscall ((void *)fildes, st, NULL, SYS_fstat);
} /* _fstat () */

View File

@ -31,6 +31,7 @@
#include <errno.h>
#include <sys/time.h>
#include "syscall.h"
#include "epiphany-syscalls.h"
int
_gettimeofday (struct timeval *tp, void *tzp)

View File

@ -31,6 +31,7 @@
#include <unistd.h>
#include <syscall.h>
#include "epiphany-syscalls.h"
/* ------------------------------------------------------------------------- */

View File

@ -30,6 +30,7 @@
#include <syscall.h>
#include <sys/types.h>
#include "epiphany-syscalls.h"
/* ------------------------------------------------------------------------- */
/*!Set a position in a file
@ -43,5 +44,5 @@
off_t __attribute__ ((section ("libgloss_epiphany")))
_lseek (int fildes, off_t offset, int whence)
{
return asm_syscall (fildes, offset, whence, SYS_lseek);
return asm_syscall ((void *)fildes, (void *)offset, (void *)whence, SYS_lseek);
} /* _lseek () */

View File

@ -31,6 +31,7 @@
#include <sys/stat.h>
#include <syscall.h>
#include "epiphany-syscalls.h"
/* ------------------------------------------------------------------------- */

View File

@ -31,6 +31,7 @@
#include <unistd.h>
#include <syscall.h>
#include "epiphany-syscalls.h"
/* ------------------------------------------------------------------------- */