This is the mail archive of the newlib@sources.redhat.com mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] : Correct build of newlib for ARC .


Hi,

This patch attempts to correct the build of newlib for ARC . The syscall functions needed to be renamed to the non-reentrant versions for even a simple program to get executed. This was visible when I attempted to run the GCC testsuite .

Ok to commit ?

cheers
Ramana


-- Ramana Radhakrishnan GNU Tools codito ergo sum (www.codito.com)

Index: libc/sys/arc/syscalls.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/sys/arc/syscalls.c,v
retrieving revision 1.1
diff -c -3 -p -r1.1 syscalls.c
*** libc/sys/arc/syscalls.c	19 Jan 2001 01:25:13 -0000	1.1
--- libc/sys/arc/syscalls.c	22 Mar 2005 20:11:19 -0000
***************
*** 8,14 ****
  #include <reent.h>
  
  _ssize_t
! _read_r (struct _reent *r, int fd, void *buf, size_t nbytes)
  {
    int err;
    _ssize_t rc;
--- 8,14 ----
  #include <reent.h>
  
  _ssize_t
! _read (struct _reent *r, int fd, void *buf, size_t nbytes)
  {
    int err;
    _ssize_t rc;
*************** _read_r (struct _reent *r, int fd, void 
*** 20,26 ****
  }
  
  _ssize_t
! _write_r (struct _reent *r, int fd, const void *buf, size_t nbytes)
  {
    int err;
    _ssize_t rc;
--- 20,26 ----
  }
  
  _ssize_t
! _write (struct _reent *r, int fd, const void *buf, size_t nbytes)
  {
    int err;
    _ssize_t rc;
*************** _write_r (struct _reent *r, int fd, cons
*** 35,41 ****
     but reent.h uses int.  */
  
  int
! _open_r (struct _reent *r, const char *buf, int flags, int mode)
  {
    int rc,err;
  #if 0
--- 35,41 ----
     but reent.h uses int.  */
  
  int
! _open (struct _reent *r, const char *buf, int flags, int mode)
  {
    int rc,err;
  #if 0
*************** _open_r (struct _reent *r, const char *b
*** 53,59 ****
  }
  
  int
! _close_r (struct _reent *r, int fd)
  {
    int rc,err;
  
--- 53,59 ----
  }
  
  int
! _close (struct _reent *r, int fd)
  {
    int rc,err;
  
*************** _close_r (struct _reent *r, int fd)
*** 64,70 ****
  }
  
  off_t
! _lseek_r (struct _reent *r, int fd,  off_t offset, int whence)
  {
    int err;
    off_t rc;
--- 64,70 ----
  }
  
  off_t
! _lseek (struct _reent *r, int fd,  off_t offset, int whence)
  {
    int err;
    off_t rc;
*************** _lseek_r (struct _reent *r, int fd,  off
*** 76,82 ****
  }
  
  int
! _fstat_r (struct _reent *r, int fd, struct stat *buf)
  {
    int rc,err;
  
--- 76,82 ----
  }
  
  int
! _fstat (struct _reent *r, int fd, struct stat *buf)
  {
    int rc,err;
  
*************** _time (time_t *timer)
*** 107,125 ****
  }
  
  int
! _creat_r (struct _reent *r, const char *path, int mode)
  {
    return _open_r (r, path, O_CREAT | O_TRUNC, mode);
  }
  
  int
! _getpid_r (struct _reent *r)
  {
    return 42;
  }
  
  int
! _kill_r (struct _reent *r, int pid, int sig)
  {
    int rc,err;
  
--- 107,125 ----
  }
  
  int
! _creat (struct _reent *r, const char *path, int mode)
  {
    return _open_r (r, path, O_CREAT | O_TRUNC, mode);
  }
  
  int
! _getpid (struct _reent *r)
  {
    return 42;
  }
  
  int
! _kill (struct _reent *r, int pid, int sig)
  {
    int rc,err;
  
2005-03-23  Ramana Radhakrishnan  <ramana.radhakrishnan@codito.com>

	* libc/sysdeps/arc/syscalls.c: Provide definitions for the non-
	reentrant equivalents in the backend. 
	(_open_r):Rename to _open
	(_read_r):Rename to _read
	(_fstat_r):Rename to _fstat
	(_creat_r):Rename to _creat
	(_getpid_r):Rename to _getpid
	(_kill_r):Rename to _kill
	(_lseek_r):Rename to _lseek
	


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]