diff -urP newlib-1.8.1/Makefile.in newlib-1.8.1-eota/Makefile.in
--- newlib-1.8.1/Makefile.in	Thu Jun  4 04:55:08 1998
+++ newlib-1.8.1-eota/Makefile.in	Thu Jan 10 15:23:58 2002
@@ -77,7 +77,7 @@
 
 # These flag values are normally overridden by the configure script.
 CFLAGS = -g
-CXXFLAGS = -g -O2
+CXXFLAGS = -g -O
 
 LIBCFLAGS = $(CFLAGS)
 CFLAGS_FOR_TARGET = $(CFLAGS)
diff -urP newlib-1.8.1/config/mt-eota newlib-1.8.1-eota/config/mt-eota
--- newlib-1.8.1/config/mt-eota	Thu Jan  1 09:00:00 1970
+++ newlib-1.8.1-eota/config/mt-eota	Sat Jul 22 20:35:58 2000
@@ -0,0 +1,4 @@
+CC_FOR_TARGET = gcc
+AS_FOR_TARGET = as
+AR_FOR_TARGET = ar
+RANLIB_FOR_TARGET = true
diff -urP newlib-1.8.1/config.sub newlib-1.8.1-eota/config.sub
--- newlib-1.8.1/config.sub	Tue Jun  2 00:52:44 1998
+++ newlib-1.8.1-eota/config.sub	Tue May  1 12:41:58 2001
@@ -782,6 +782,10 @@
 		basic_machine=a29k-nyu
 		os=-sym1
 		;;
+	eota)					# CYGNUS LOCAL
+		basic_machine=i486-eota
+		os=-none
+		;;
 	v810 | necv810)					# CYGNUS LOCAL
 		basic_machine=v810-nec
 		os=-none
diff -urP newlib-1.8.1/configure newlib-1.8.1-eota/configure
--- newlib-1.8.1/configure	Tue Jun  2 00:53:01 1998
+++ newlib-1.8.1-eota/configure	Thu Jan 10 15:25:44 2002
@@ -953,11 +953,11 @@
 	CC="gcc"
 	echo 'void f(){}' > conftest.c
 	if test -z "`${CC} -g -c conftest.c 2>&1`"; then
-	  CFLAGS=${CFLAGS-"-g -O2"}
-	  CXXFLAGS=${CXXFLAGS-"-g -O2"}
+	  CFLAGS=${CFLAGS-"-g -O"}
+	  CXXFLAGS=${CXXFLAGS-"-g -O"}
 	else
-	  CFLAGS=${CFLAGS-"-O2"}
-	  CXXFLAGS=${CXXFLAGS-"-O2"}
+	  CFLAGS=${CFLAGS-"-O"}
+	  CXXFLAGS=${CXXFLAGS-"-O"}
 	fi
 	rm -f conftest*
 	break
@@ -969,7 +969,7 @@
 
   CXX=${CXX-"c++"}
   CFLAGS=${CFLAGS-"-g"}
-  CXXFLAGS=${CXXFLAGS-"-g -O2"}
+  CXXFLAGS=${CXXFLAGS-"-g -O"}
 fi
 
 export CC
diff -urP newlib-1.8.1/configure.in newlib-1.8.1-eota/configure.in
--- newlib-1.8.1/configure.in	Thu Jun  4 04:55:32 1998
+++ newlib-1.8.1-eota/configure.in	Tue May  1 12:41:27 2001
@@ -308,6 +308,9 @@
 # per-target:
 
 case "${target}" in
+  *eota*)
+    target_makefile_frag="${target_makefile_frag} config/mt-eota"
+    ;;
   v810*)
     target_makefile_frag="${target_makefile_frag} config/mt-v810"
     ;;
diff -urP newlib-1.8.1/mt-frag newlib-1.8.1-eota/mt-frag
--- newlib-1.8.1/mt-frag	Thu Jan  1 09:00:00 1970
+++ newlib-1.8.1-eota/mt-frag	Sat Apr 12 18:47:08 2003
@@ -0,0 +1,4 @@
+CC_FOR_TARGET = gcc
+AS_FOR_TARGET = as
+AR_FOR_TARGET = ar
+RANLIB_FOR_TARGET = true
diff -urP newlib-1.8.1/newlib/configure.in newlib-1.8.1-eota/newlib/configure.in
--- newlib-1.8.1/newlib/configure.in	Tue Jun  2 00:51:08 1998
+++ newlib-1.8.1-eota/newlib/configure.in	Thu Jan 10 15:26:20 2002
@@ -50,6 +50,9 @@
   :m32r-* |  :d10v-*)
     target_cflags="-Os"
     ;;
+  :*eota*)
+    target_cflags="-O"
+    ;;
   no:* | :*)
     target_cflags="-O2"
     ;;
@@ -109,6 +112,7 @@
 	# Don't use for these since they provide their own setjmp.
 	case ${target} in
 	*-*-go32 | *-*-sco* | *-*-cygwin32) machine_dir= ;;
+	# *-eota-*) machine_dir= ;;
 	*) machine_dir=i386 ;;
 	esac
 	;;
@@ -254,6 +258,10 @@
   v70-nec-*)
 	sys_dir=sysvnecv70
 	;;
+  *-eota-*)
+	sys_dir=syseota
+	posix_dir=posix
+	;;
   v810-*-*)
 	sys_dir=sysnec810
 	;;
@@ -397,6 +405,10 @@
 	target_cflags="${target_cflags} -DARM_RDP_MONITOR"
 #	target_cflags="${target_cflags} -DARM_RDI_MONITOR"
 	;;
+#  *-eota-*)
+#	target_cflags="${target_cflags} -DHAVE_BLKSIZE -DMISSING_SYSCALL_NAMES"
+#	syscall_dir=
+#        ;;
   v850-*-*)
 	syscall_dir=syscalls
 	;;
diff -urP newlib-1.8.1/newlib/libc/posix/Makefile.in newlib-1.8.1-eota/newlib/libc/posix/Makefile.in
--- newlib-1.8.1/newlib/libc/posix/Makefile.in	Sat May 30 07:03:11 1998
+++ newlib-1.8.1-eota/newlib/libc/posix/Makefile.in	Thu Nov  8 20:06:33 2001
@@ -25,9 +25,12 @@
 #### Host, target, and site specific Makefile fragments come in here.
 ###
 
-OFILES = closedir.o opendir.o readdir.o rewinddir.o scandir.o seekdir.o \
-	telldir.o execl.o execle.o execlp.o execv.o execve.o execvp.o \
-	popen.o creat.o isatty.o
+#OFILES = closedir.o opendir.o readdir.o rewinddir.o scandir.o seekdir.o \
+#	telldir.o execl.o execle.o execlp.o execv.o execve.o execvp.o \
+#	popen.o creat.o isatty.o
+OFILES = closedir.o opendir.o readdir.o rewinddir.o seekdir.o \
+	telldir.o execl.o execle.o execlp.o execv.o execvp.o \
+	popen.o isatty.o
 
 all: lib.a
 
diff -urP newlib-1.8.1/newlib/libc/posix/opendir.c newlib-1.8.1-eota/newlib/libc/posix/opendir.c
--- newlib-1.8.1/newlib/libc/posix/opendir.c	Sat May 30 07:03:12 1998
+++ newlib-1.8.1-eota/newlib/libc/posix/opendir.c	Sun Nov 11 14:52:39 2001
@@ -54,11 +54,18 @@
 
 	if ((fd = open(name, 0)) == -1)
 		return NULL;
+#if 0
 	if (fcntl(fd, F_SETFD, 1) == -1 ||
 	    (dirp = (DIR *)malloc(sizeof(DIR))) == NULL) {
 		close (fd);
 		return NULL;
 	}
+#else
+	if ((dirp = (DIR *)malloc(sizeof(DIR))) == NULL) {
+		close (fd);
+		return NULL;
+	}
+#endif
 	/*
 	 * If CLSIZE is an exact multiple of DIRBLKSIZ, use a CLSIZE
 	 * buffer that it cluster boundary aligned.
diff -urP newlib-1.8.1/newlib/libc/posix/readdir.c newlib-1.8.1-eota/newlib/libc/posix/readdir.c
--- newlib-1.8.1/newlib/libc/posix/readdir.c	Sat May 30 07:03:12 1998
+++ newlib-1.8.1-eota/newlib/libc/posix/readdir.c	Sun Nov 11 14:52:49 2001
@@ -38,6 +38,7 @@
 #endif /* LIBC_SCCS and not lint */
 
 #include <dirent.h>
+#include <unistd.h>
 
 /*
  * get next entry in a directory.
@@ -61,14 +62,18 @@
       continue;
     }
     dp = (struct dirent *)(dirp->dd_buf + dirp->dd_loc);
+#if 0
     if ((int)dp & 03)	/* bogus pointer check */
       return NULL;
+#endif
     if (dp->d_reclen <= 0 ||
 	dp->d_reclen > dirp->dd_len + 1 - dirp->dd_loc)
       return NULL;
     dirp->dd_loc += dp->d_reclen;
+#if 0
     if (dp->d_ino == 0)
       continue;
+#endif
     return (dp);
   }
 }
diff -urP newlib-1.8.1/newlib/libc/sys/syseota/Makefile.in newlib-1.8.1-eota/newlib/libc/sys/syseota/Makefile.in
--- newlib-1.8.1/newlib/libc/sys/syseota/Makefile.in	Thu Jan  1 09:00:00 1970
+++ newlib-1.8.1-eota/newlib/libc/sys/syseota/Makefile.in	Tue May  1 12:53:06 2001
@@ -0,0 +1,57 @@
+# Makefile for newlib/libc/sys/syseota.
+# Copyright (c) 2001, Tomohide Naniwa
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms are permitted
+# provided that the above copyright notice and this paragraph are
+# duplicated in all such forms and that any documentation,
+# advertising materials, and other materials related to such
+# distribution and use acknowledge that the software was developed
+# at Cygnus Support, Inc.  Cygnus Support, Inc. may not be used to
+# endorse or promote products derived from this software without
+# specific prior written permission.
+# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+
+srcdir = .
+
+SHELL = /bin/sh
+
+TOP = ../../..
+SRCTOP = ../../..
+TARGETDOC = ../../targetdep.tex
+
+OFILES=crt0.o sbrk.o misc.o wait.o
+
+#### Host, target, and site specific Makefile fragments come in here.
+###
+
+all: lib.a crt0.o
+lib.a: $(OFILES)
+	rm -f $@
+	$(AR) $(AR_FLAGS) $@ $(OFILES) 
+
+doc:	
+	true
+#	cat $(srcdir)/sysvnecv70.tex >> $(TARGETDOC)
+
+clean:
+	$(RM) $(OFILES) $(COPYOFILES) crt0.o lib.a
+
+distclean maintainer-clean realclean: clean
+	rm -f Makefile config.status
+
+Makefile: Makefile.in $(host_makefile_frag) $(target_makefile_frag)
+	$(SHELL) config.status
+
+.s.o:
+	$(AS) -o $*.o $<
+
+# to support SunOS VPATH
+crt0.o: crt0.c
+#io.o: io.s
+#write.o: write.c
+sbrk.o: sbrk.c
+misc.o: misc.c
+wait.o: wait.c
diff -urP newlib-1.8.1/newlib/libc/sys/syseota/crt0.c newlib-1.8.1-eota/newlib/libc/sys/syseota/crt0.c
--- newlib-1.8.1/newlib/libc/sys/syseota/crt0.c	Thu Jan  1 09:00:00 1970
+++ newlib-1.8.1-eota/newlib/libc/sys/syseota/crt0.c	Sun Apr  6 18:59:37 2003
@@ -0,0 +1,12 @@
+extern int main(int argc, char **argv, char **envp);
+
+char **environ;
+extern int errno;
+
+int _start(int argc, char **argv, char **envp)
+{
+  errno = 0;
+  environ = envp;
+  main(argc, argv, envp);
+  _exit(0);
+}
diff -urP newlib-1.8.1/newlib/libc/sys/syseota/misc.c newlib-1.8.1-eota/newlib/libc/sys/syseota/misc.c
--- newlib-1.8.1/newlib/libc/sys/syseota/misc.c	Thu Jan  1 09:00:00 1970
+++ newlib-1.8.1-eota/newlib/libc/sys/syseota/misc.c	Fri Jan 25 16:37:50 2002
@@ -0,0 +1,28 @@
+#include <_ansi.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/time.h>
+
+#if 0
+int
+isatty() {
+  return 1;
+}
+#endif
+
+int stat(char *file, struct stat *st)
+{
+  int fd, ret;
+
+  if ((fd = open(file, 0, 0)) < 0) {
+    return -1;
+  }
+  ret = fstat(fd, st);
+  close(fd);
+  return ret;
+}
+
+int _execve (const char *path, char * const argv[], char * const envp[])
+{
+  return execve (path, argv, envp);
+}
diff -urP newlib-1.8.1/newlib/libc/sys/syseota/sbrk.c newlib-1.8.1-eota/newlib/libc/sys/syseota/sbrk.c
--- newlib-1.8.1/newlib/libc/sys/syseota/sbrk.c	Thu Jan  1 09:00:00 1970
+++ newlib-1.8.1-eota/newlib/libc/sys/syseota/sbrk.c	Sat Jul 22 20:35:58 2000
@@ -0,0 +1,21 @@
+#include "errno.h"
+
+extern int brk(char *);
+extern int errno;
+static char *end_of_data = (char *) 0x10000000;
+
+void *sbrk (int delta)
+{
+  void *ptr = (void *) end_of_data;
+  int err;
+  
+  if (delta == 0) return ptr;
+  err = brk(end_of_data + delta);
+  if (err) {
+    errno = ENOMEM;
+    return (void *) -1;
+  }
+  end_of_data += delta;
+  return ptr;
+}
+
diff -urP newlib-1.8.1/newlib/libc/sys/syseota/sys/dirent.h newlib-1.8.1-eota/newlib/libc/sys/syseota/sys/dirent.h
--- newlib-1.8.1/newlib/libc/sys/syseota/sys/dirent.h	Thu Jan  1 09:00:00 1970
+++ newlib-1.8.1-eota/newlib/libc/sys/syseota/sys/dirent.h	Sun Nov 11 13:54:21 2001
@@ -0,0 +1,22 @@
+#ifndef _SYS_DIRENT_H
+# define _SYS_DIRENT_H
+
+typedef struct _dirdesc {
+	int	dd_fd;
+	long	dd_loc;
+	long	dd_size;
+	char	*dd_buf;
+	int	dd_len;
+	long	dd_seek;
+} DIR;
+
+struct dirent
+{
+  long			d_ino;
+  unsigned long		d_off;
+  unsigned short	d_reclen;
+  char			d_name[1];
+};
+
+#include <sys/types.h>
+#endif
diff -urP newlib-1.8.1/newlib/libc/sys/syseota/sys/errno.h newlib-1.8.1-eota/newlib/libc/sys/syseota/sys/errno.h
--- newlib-1.8.1/newlib/libc/sys/syseota/sys/errno.h	Thu Jan  1 09:00:00 1970
+++ newlib-1.8.1-eota/newlib/libc/sys/syseota/sys/errno.h	Sat Apr 12 18:57:03 2003
@@ -0,0 +1,47 @@
+#ifndef __ERRNO_H__
+#define __ERRNO_H__	1
+
+/*
+ * POSIX 環境で定義している error 番号
+ */
+#define E2BIG		1	/* Arg list too long */
+#define EACCESS		2	/* Permission denied */
+#define EAGAIN		3	/* Resouce temporarily unavailable */
+#define EBADF		4	/* Bad file descriptor */
+#define EBUSY		5	/* Resouce busy */
+#define ECHILD		6	/* No child process */
+#define EDEADLK		7	/* Resouce deadlock avoided */
+#define EDOM		8	/* Domain error */
+#define EEXIST		9	/* File exists */
+#define EFAULT		10	/* Bad address */
+#define EFBIG		11	/* File too large */
+#define EINTR		12	/* Interrupted function call */
+#define EINVAL		13	/* Invalid argument */
+#define EIO		14	/* Input/output error */
+#define EISDIR		15	/* Is a directory */
+#define EMFILE		16	/* Too many open files */
+#define EMLINK		17	/* Too many links */
+#define ENAMETOOLONG	18	/* Filename too long */
+#define ENFILE		19	/* Too many open files in system */
+#define ENODEV		20	/* No such device */
+#define ENOENT		21	/* No such file or directory */
+#define ENOEXEC		22	/* Exec format error */
+#define ENOLCK		23	/* No locks available */
+#define ENOMEM		24	/* Not enough space */
+#define ENOSPC		25	/* No space left on device */
+#define ENOSYS		26	/* Function not implemented */
+#define ENOTDIR		27	/* Not a directory */
+#define ENOTEMPTY	28	/* Directory not empty */
+#define ENOTTY		29	/* Inappropriate I/O control operation */
+#define ENXIO		30	/* No such device or address */
+#define EPERM		31	/* Operation not permitted */
+#define EPIPE		32	/* Broken pipe */
+#define ERANGE		33	/* Result too large */
+#define EROFS		34	/* Read-only file system */
+#define ESPIPE		35	/* Invalid seek */
+#define ESRCH		36	/* No such process */
+#define EXDEV		37	/* Improper link */
+
+extern int errno;
+
+#endif /* __ERRNO_H__ */
diff -urP newlib-1.8.1/newlib/libc/sys/syseota/sys/fcntl.h newlib-1.8.1-eota/newlib/libc/sys/syseota/sys/fcntl.h
--- newlib-1.8.1/newlib/libc/sys/syseota/sys/fcntl.h	Thu Jan  1 09:00:00 1970
+++ newlib-1.8.1-eota/newlib/libc/sys/syseota/sys/fcntl.h	Wed Jan 30 02:24:21 2002
@@ -0,0 +1,43 @@
+#define O_RDONLY	0x00
+#define O_WRONLY	0x01
+#define O_RDWR		0x02
+#define O_CREAT		0x08
+#define O_APPEND	0x10
+#define	O_TRUNC		0x0200
+
+/* not yet implemented */
+#define O_EXCL		0x0400
+#define	O_NONBLOCK	0x0800	/* non blocking I/O (POSIX style) */
+
+#if 0
+/* XXX close on exec request; must match UF_EXCLOSE in user.h */
+#define	FD_CLOEXEC	1	/* posix */
+
+/* fcntl(2) requests */
+#define	F_DUPFD		0	/* Duplicate fildes */
+#define	F_GETFD		1	/* Get fildes flags (close on exec) */
+#define	F_SETFD		2	/* Set fildes flags (close on exec) */
+#ifdef notdef
+#define	F_GETFL		3	/* Get file flags */
+#define	F_SETFL		4	/* Set file flags */
+#define	F_GETOWN 	5	/* Get owner - for ASYNC */
+#define	F_SETOWN 	6	/* Set owner - for ASYNC */
+#endif
+#define	F_GETLK  	7	/* Get record-locking information */
+#define	F_SETLK  	8	/* Set or Clear a record-lock (Non-Blocking) */
+#define	F_SETLKW 	9	/* Set or Clear a record-lock (Blocking) */
+#ifdef notdef
+#define	F_RGETLK 	10	/* Test a remote lock to see if it is blocked */
+#define	F_RSETLK 	11	/* Set or unlock a remote lock */
+#define	F_CNVT 		12	/* Convert a fhandle to an open fd */
+#define	F_RSETLKW 	13	/* Set or Clear remote record-lock(Blocking) */
+#endif
+
+/* fcntl(2) flags (l_type field of flock structure) */
+#define	F_RDLCK		1	/* read lock */
+#define	F_WRLCK		2	/* write lock */
+#define	F_UNLCK		3	/* remove lock(s) */
+#ifdef notdef
+#define	F_UNLKSYS	4	/* remove remote locks for a given system */
+#endif
+#endif
diff -urP newlib-1.8.1/newlib/libc/sys/syseota/sys/stat.h newlib-1.8.1-eota/newlib/libc/sys/syseota/sys/stat.h
--- newlib-1.8.1/newlib/libc/sys/syseota/sys/stat.h	Thu Jan  1 09:00:00 1970
+++ newlib-1.8.1-eota/newlib/libc/sys/syseota/sys/stat.h	Fri Jan 25 00:15:17 2002
@@ -0,0 +1,68 @@
+#ifndef _STAT_H_
+#define _STAT_H_
+
+struct stat
+{
+  unsigned long            st_dev;
+  unsigned long            st_ino;
+  unsigned long            st_mode;
+  unsigned long            st_nlink;
+  unsigned long            st_uid;
+  unsigned long            st_gid;
+  unsigned long            st_rdev;
+  unsigned long            st_size;
+  unsigned long            st_blksize;
+  unsigned long            st_blocks;
+  unsigned long            st_atime;
+  unsigned long            st_mtime;
+  unsigned long            st_ctime;
+};
+
+#define		_IFMT	0170000	/* type of file */
+#define		_IFDIR	0040000	/* directory */
+#define		_IFCHR	0020000	/* character special */
+#define		_IFBLK	0060000	/* block special */
+#define		_IFREG	0100000	/* regular */
+
+#define		_IFLNK	0120000	/* symbolic link */
+#define		_IFSOCK	0140000	/* socket */
+#define		_IFIFO	0110000	/* fifo */
+
+#define	S_ISUID		0004000	/* set user id on execution */
+#define	S_ISGID		0002000	/* set group id on execution */
+#define	S_ISVTX		0001000	/* save swapped text even after use */
+#define	S_IREAD		0000400	/* read permission, owner */
+#define	S_IWRITE 	0000200	/* write permission, owner */
+#define	S_IEXEC		0000100	/* execute/search permission, owner */
+
+#define	S_IFMT		_IFMT
+#define	S_IFDIR		_IFDIR
+#define	S_IFCHR		_IFCHR
+#define	S_IFBLK		_IFBLK
+#define	S_IFREG		_IFREG
+#define	S_IFLNK		_IFLNK
+#define	S_IFSOCK	_IFSOCK
+#define	S_IFIFO		_IFIFO
+
+#define	S_IRWXU 	0000700	/* rwx, owner */
+#define	S_IRUSR		0000400	/* read permission, owner */
+#define	S_IWUSR		0000200	/* write permission, owner */
+#define	S_IXUSR		0000100	/* execute/search permission, owner */
+#define	S_IRWXG		0000070	/* rwx, group */
+#define	S_IRGRP		0000040	/* read permission, group */
+#define	S_IWGRP		0000020	/* write permission, grougroup */
+#define	S_IXGRP		0000010	/* execute/search permission, group */
+#define	S_IRWXO		0000007	/* rwx, other */
+#define	S_IROTH		0000004	/* read permission, other */
+#define	S_IWOTH		0000002	/* write permission, other */
+#define	S_IXOTH		0000001	/* execute/search permission, other */
+
+#define	S_ISBLK(m)	(((m)&_IFMT) == _IFBLK)
+#define	S_ISCHR(m)	(((m)&_IFMT) == _IFCHR)
+#define	S_ISDIR(m)	(((m)&_IFMT) == _IFDIR)
+#define	S_ISFIFO(m)	(((m)&_IFMT) == _IFIFO)
+#define	S_ISREG(m)	(((m)&_IFMT) == _IFREG)
+#define	S_ISLNK(m)	(((m)&_IFMT) == _IFLNK)
+#define	S_ISSOCK(m)	(((m)&_IFMT) == _IFSOCK)
+
+#endif
diff -urP newlib-1.8.1/newlib/libc/sys/syseota/wait.c newlib-1.8.1-eota/newlib/libc/sys/syseota/wait.c
--- newlib-1.8.1/newlib/libc/sys/syseota/wait.c	Thu Jan  1 09:00:00 1970
+++ newlib-1.8.1-eota/newlib/libc/sys/syseota/wait.c	Thu Aug  3 11:15:57 2000
@@ -0,0 +1,7 @@
+int
+wait (statusp)
+     int *statusp;
+{
+  return waitpid(-1, statusp, 0);
+}
+
