From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2119) id CBC8F3858D33; Sat, 23 Dec 2023 04:30:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CBC8F3858D33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1703305831; bh=W5KGLmXoNqsk4YVqTWzYJGPBQacEvQ80DWw3WbW1+/s=; h=From:To:Subject:Date:From; b=N+ffity8oNDzVGIn1m2CQKOjaxOLaI2PK/B82iXewVuSarkf29BSEKe3dO1zOSgYk 5p1I4YYDePysaWgYJcBLqYaGHzPypicwJvdwHyILjV51+UXe/wquAm6JNmPwLcN+gG E/Jooc4K2ZoQSfZFS1mcLf41VG+8v5vpwbNGvU0U= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Jeff Law To: newlib-cvs@sourceware.org Subject: [newlib-cygwin] Fix epiphany libgloss for c99/gcc-14 X-Act-Checkin: newlib-cygwin X-Git-Author: Jeff Law X-Git-Refname: refs/heads/master X-Git-Oldrev: 5e79655f380488eb99dd9cc39c30d7c2927fd998 X-Git-Newrev: 1df8f9f09b0999e04bc0bbd7170ac7dbfa278213 Message-Id: <20231223043031.CBC8F3858D33@sourceware.org> Date: Sat, 23 Dec 2023 04:30:31 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D1df8f9f09b0= 999e04bc0bbd7170ac7dbfa278213 commit 1df8f9f09b0999e04bc0bbd7170ac7dbfa278213 Author: Jeff Law Date: Fri Dec 22 21:29:56 2023 -0700 Fix epiphany libgloss for c99/gcc-14 =20 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 ty= pe. Finally the asm_syscall interface expects a pointer as its first argume= nt. In a few cases we've actually got an int (file descriptor) which we just c= ast to a void *. =20 It's slightly more than Jeff J's pre-approval, but I think still reason= able. Diff: --- libgloss/epiphany/_isatty.c | 1 + libgloss/epiphany/epiphany-syscalls.c | 2 +- libgloss/epiphany/epiphany-syscalls.h | 2 ++ libgloss/epiphany/fstat.c | 3 ++- libgloss/epiphany/gettimeofday.c | 1 + libgloss/epiphany/link.c | 1 + libgloss/epiphany/lseek.c | 3 ++- libgloss/epiphany/stat.c | 1 + libgloss/epiphany/unlink.c | 1 + 9 files changed, 12 insertions(+), 3 deletions(-) diff --git a/libgloss/epiphany/_isatty.c b/libgloss/epiphany/_isatty.c index cfb1bf6e4..f05aba3c3 100644 --- a/libgloss/epiphany/_isatty.c +++ b/libgloss/epiphany/_isatty.c @@ -18,6 +18,7 @@ =20 #include #include +#include "epiphany-syscalls.h" =20 int _isatty (int fd) diff --git a/libgloss/epiphany/epiphany-syscalls.c b/libgloss/epiphany/epip= hany-syscalls.c index e6ebcee24..4c03fe291 100644 --- a/libgloss/epiphany/epiphany-syscalls.c +++ b/libgloss/epiphany/epiphany-syscalls.c @@ -253,7 +253,7 @@ int __attribute__ ((section ("libgloss_epiphany"))) e_= raise(int signum) { __asm__ __volatile__ ("wand"); //ilatst =3D 1 << WAND_IVT_N; //break; - return; + return 0; =20 case SIG_USR1: ilatst =3D 1 << USR_SOFT_IVT_N; diff --git a/libgloss/epiphany/epiphany-syscalls.h b/libgloss/epiphany/epip= hany-syscalls.h index 3af1c6f7b..b46587573 100644 --- a/libgloss/epiphany/epiphany-syscalls.h +++ b/libgloss/epiphany/epiphany-syscalls.h @@ -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); + =20 #endif diff --git a/libgloss/epiphany/fstat.c b/libgloss/epiphany/fstat.c index 5a20b57f3..d126c2de8 100644 --- a/libgloss/epiphany/fstat.c +++ b/libgloss/epiphany/fstat.c @@ -31,6 +31,7 @@ =20 #include #include +#include "epiphany-syscalls.h" =20 =20 /* -----------------------------------------------------------------------= -- */ @@ -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); =20 } /* _fstat () */ diff --git a/libgloss/epiphany/gettimeofday.c b/libgloss/epiphany/gettimeof= day.c index e169385ea..36f17b8b0 100644 --- a/libgloss/epiphany/gettimeofday.c +++ b/libgloss/epiphany/gettimeofday.c @@ -31,6 +31,7 @@ #include #include #include "syscall.h" +#include "epiphany-syscalls.h" =20 int _gettimeofday (struct timeval *tp, void *tzp) diff --git a/libgloss/epiphany/link.c b/libgloss/epiphany/link.c index d87637e39..fd0d8b9cb 100644 --- a/libgloss/epiphany/link.c +++ b/libgloss/epiphany/link.c @@ -31,6 +31,7 @@ =20 #include #include +#include "epiphany-syscalls.h" =20 =20 /* -----------------------------------------------------------------------= -- */ diff --git a/libgloss/epiphany/lseek.c b/libgloss/epiphany/lseek.c index 64ffcdd28..65d7e52da 100644 --- a/libgloss/epiphany/lseek.c +++ b/libgloss/epiphany/lseek.c @@ -30,6 +30,7 @@ =20 #include #include +#include "epiphany-syscalls.h" =20 /* -----------------------------------------------------------------------= -- */ /*!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 () */ diff --git a/libgloss/epiphany/stat.c b/libgloss/epiphany/stat.c index 988f28dba..f9a3872a8 100644 --- a/libgloss/epiphany/stat.c +++ b/libgloss/epiphany/stat.c @@ -31,6 +31,7 @@ =20 #include #include +#include "epiphany-syscalls.h" =20 =20 /* -----------------------------------------------------------------------= -- */ diff --git a/libgloss/epiphany/unlink.c b/libgloss/epiphany/unlink.c index c78af284d..653f24b95 100644 --- a/libgloss/epiphany/unlink.c +++ b/libgloss/epiphany/unlink.c @@ -31,6 +31,7 @@ =20 #include #include +#include "epiphany-syscalls.h" =20 =20 /* -----------------------------------------------------------------------= -- */