From 116ad3bfc444abfb9e0cf2594801ab03e96c70b8 Mon Sep 17 00:00:00 2001 From: Dave Murphy Date: Tue, 10 Feb 2015 10:53:08 +0000 Subject: [PATCH] restore _wrapup_reent --- dkppc/patches/newlib-2.2.0.patch | 88 ++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) diff --git a/dkppc/patches/newlib-2.2.0.patch b/dkppc/patches/newlib-2.2.0.patch index 63a1a27..7f5a70a 100644 --- a/dkppc/patches/newlib-2.2.0.patch +++ b/dkppc/patches/newlib-2.2.0.patch @@ -6680,6 +6680,94 @@ diff -NBaur newlib-2.2.0/newlib/libc/misc/init.c newlib-2.2.0-ppc/newlib/libc/mi +#error why am I not defined + #endif +diff -NBaur newlib-2.2.0/newlib/libc/reent/Makefile.am newlib-2.2.0-ppc/newlib/libc/reent/Makefile.am +--- newlib-2.2.0/newlib/libc/reent/Makefile.am 2009-08-12 19:22:38.000000000 +0100 ++++ newlib-2.2.0-ppc/newlib/libc/reent/Makefile.am 2015-02-10 10:43:33.490220000 +0000 +@@ -52,6 +52,7 @@ + statr.c \ + timesr.c \ + unlinkr.c \ ++ wrapupreent.c \ + writer.c + + libreent_la_LDFLAGS = -Xcompiler -nostdlib +diff -NBaur newlib-2.2.0/newlib/libc/reent/Makefile.in newlib-2.2.0-ppc/newlib/libc/reent/Makefile.in +--- newlib-2.2.0/newlib/libc/reent/Makefile.in 2012-12-20 21:10:05.000000000 +0000 ++++ newlib-2.2.0-ppc/newlib/libc/reent/Makefile.in 2015-02-10 10:43:33.490220000 +0000 +@@ -82,7 +82,7 @@ + lib_a-signalr.$(OBJEXT) lib_a-signgam.$(OBJEXT) \ + lib_a-sbrkr.$(OBJEXT) lib_a-statr.$(OBJEXT) \ + lib_a-timesr.$(OBJEXT) lib_a-unlinkr.$(OBJEXT) \ +- lib_a-writer.$(OBJEXT) ++ lib_a-wrapupreent.$(OBJEXT) lib_a-writer.$(OBJEXT) + @HAVE_STDIO64_DIR_TRUE@am__objects_2 = lib_a-fstat64r.$(OBJEXT) \ + @HAVE_STDIO64_DIR_TRUE@ lib_a-lseek64r.$(OBJEXT) \ + @HAVE_STDIO64_DIR_TRUE@ lib_a-stat64r.$(OBJEXT) \ +@@ -102,7 +102,8 @@ + am__objects_6 = closer.lo reent.lo impure.lo fcntlr.lo fstatr.lo \ + getreent.lo gettimeofdayr.lo isattyr.lo linkr.lo lseekr.lo \ + mkdirr.lo openr.lo readr.lo renamer.lo signalr.lo signgam.lo \ +- sbrkr.lo statr.lo timesr.lo unlinkr.lo writer.lo ++ sbrkr.lo statr.lo timesr.lo unlinkr.lo wrapupreent.lo \ ++ writer.lo + @HAVE_STDIO64_DIR_TRUE@am__objects_7 = fstat64r.lo lseek64r.lo \ + @HAVE_STDIO64_DIR_TRUE@ stat64r.lo open64r.lo + am__objects_8 = $(am__objects_7) +@@ -324,6 +325,7 @@ + statr.c \ + timesr.c \ + unlinkr.c \ ++ wrapupreent.c \ + writer.c + + libreent_la_LDFLAGS = -Xcompiler -nostdlib +@@ -548,6 +550,12 @@ + lib_a-unlinkr.obj: unlinkr.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-unlinkr.obj `if test -f 'unlinkr.c'; then $(CYGPATH_W) 'unlinkr.c'; else $(CYGPATH_W) '$(srcdir)/unlinkr.c'; fi` + ++lib_a-wrapupreent.o: wrapupreent.c ++ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wrapupreent.o `test -f 'wrapupreent.c' || echo '$(srcdir)/'`wrapupreent.c ++ ++lib_a-wrapupreent.obj: wrapupreent.c ++ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wrapupreent.obj `if test -f 'wrapupreent.c'; then $(CYGPATH_W) 'wrapupreent.c'; else $(CYGPATH_W) '$(srcdir)/wrapupreent.c'; fi` ++ + lib_a-writer.o: writer.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-writer.o `test -f 'writer.c' || echo '$(srcdir)/'`writer.c + +diff -NBaur newlib-2.2.0/newlib/libc/reent/wrapupreent.c newlib-2.2.0-ppc/newlib/libc/reent/wrapupreent.c +--- newlib-2.2.0/newlib/libc/reent/wrapupreent.c 1970-01-01 01:00:00.000000000 +0100 ++++ newlib-2.2.0-ppc/newlib/libc/reent/wrapupreent.c 2015-02-10 10:43:34.966220000 +0000 +@@ -0,0 +1,30 @@ ++#include ++#include ++ ++/* ++ * Do atexit() processing and cleanup ++ * ++ * NOTE: This is to be executed at task exit. It does not tear anything ++ * down which is used on a global basis. ++ */ ++ ++void ++_DEFUN (_wrapup_reent, (ptr), struct _reent *ptr) ++{ ++ register struct _atexit *p; ++ register int n; ++ ++ if (ptr == NULL) ++ ptr = _REENT; ++ ++#ifdef _REENT_SMALL ++ for (p = ptr->_atexit, n = p ? p->_ind : 0; --n >= 0;) ++ (*p->_fns[n]) (); ++#else ++ for (p = ptr->_atexit; p; p = p->_next) ++ for (n = p->_ind; --n >= 0;) ++ (*p->_fns[n]) (); ++#endif ++ if (ptr->__cleanup) ++ (*ptr->__cleanup) (ptr); ++} diff -NBaur newlib-2.2.0/newlib/libc/stdio/findfp.c newlib-2.2.0-ppc/newlib/libc/stdio/findfp.c --- newlib-2.2.0/newlib/libc/stdio/findfp.c 2014-09-05 10:42:15.000000000 +0100 +++ newlib-2.2.0-ppc/newlib/libc/stdio/findfp.c 2015-02-04 10:54:39.018220000 +0000