]> sourceware.org Git - newlib-cygwin.git/commitdiff
* acconfig.h (_UNBUF_STREAM_OPT): Undefine.
authorCorinna Vinschen <corinna@vinschen.de>
Wed, 19 Jun 2013 15:58:50 +0000 (15:58 +0000)
committerCorinna Vinschen <corinna@vinschen.de>
Wed, 19 Jun 2013 15:58:50 +0000 (15:58 +0000)
* newlib.hin (_UNBUF_STREAM_OPT): Undefine.
* configure.in (--enable-newlib-unbuf-stream-opt): New option.
* configure: Regenerate.
* libc/stdio/vfprintf.c (_VFPRINTF_R): Don't do optimization on
unbuffered stream files.
* libc/stdio/vfwprintf.c (_VFWPRINTF_R): Likewise.
* README: Add description about the option.
* newlib.hin (_UNBUF_STREAM_OPT): Undefine.
* configure.in (--enable-newlib-unbuf-stream-opt): New option.
* configure: Regenerate.
* libc/stdio/vfprintf.c (_VFPRINTF_R): Don't do optimization on
unbuffered stream files.
* libc/stdio/vfwprintf.c (_VFWPRINTF_R): Likewise.
* README: Add description about the option.

newlib/ChangeLog
newlib/README
newlib/acconfig.h
newlib/configure
newlib/configure.in
newlib/libc/stdio/vfprintf.c
newlib/libc/stdio/vfwprintf.c
newlib/newlib.hin

index 0a819332a3af945a39599a7bb49d01c2f33d97bf..c55bef835cb6acc5f43ef538bf86540e4f4b2bf6 100644 (file)
@@ -1,3 +1,21 @@
+2013-06-19  Bin Cheng  <bin.cheng@arm.com>
+
+       * acconfig.h (_UNBUF_STREAM_OPT): Undefine.
+       * newlib.hin (_UNBUF_STREAM_OPT): Undefine.
+       * configure.in (--enable-newlib-unbuf-stream-opt): New option.
+       * configure: Regenerate.
+       * libc/stdio/vfprintf.c (_VFPRINTF_R): Don't do optimization on
+       unbuffered stream files.
+       * libc/stdio/vfwprintf.c (_VFWPRINTF_R): Likewise.
+       * README: Add description about the option.
+       * newlib.hin (_UNBUF_STREAM_OPT): Undefine.
+       * configure.in (--enable-newlib-unbuf-stream-opt): New option.
+       * configure: Regenerate.
+       * libc/stdio/vfprintf.c (_VFPRINTF_R): Don't do optimization on
+       unbuffered stream files.
+       * libc/stdio/vfwprintf.c (_VFWPRINTF_R): Likewise.
+       * README: Add description about the option.
+
 2013-06-19  Terraneo Federico  <fede.tft@hotmail.it>
 
        * libc/posix/readdir_r.c: Fix potential read past dirp->dd_buf.
index 80bd0665ca20ef68aff9c719d3314bd4a255f57f..d1753fcc91bb8ed5303af50ae7f1d1aa7b216203 100644 (file)
@@ -321,6 +321,13 @@ One feature can be enabled by specifying `--enable-FEATURE=yes' or
      support `--enable-malloc-debugging' any more.
      Disabled by default.
 
+`--disable-newlib-unbuf-stream-opt'
+     NEWLIB does optimization when `fprintf to write only unbuffered unix
+     file'.  It creates a temorary buffer to do the optimization that
+     increases stack consumption by about `BUFSIZ' bytes.  This option
+     disables the optimization and saves size of text and stack.
+     Enabled by default.
+
 `--enable-multilib'
      Build many library versions.
      Enabled by default.
index 71d163bdb5aaec6610adb5204d7e10149d7f4459..e51eba3d40e03879e43f9cdb4db32d91c835d43b 100644 (file)
@@ -64,6 +64,9 @@
 /* Define if wide char orientation is supported.  */
 #undef  _WIDE_ORIENT
 
+/* Define if unbuffered stream file optimization is supported.  */
+#undef _UNBUF_STREAM_OPT
+
 @BOTTOM@
 /*
  * Iconv encodings enabled ("to" direction)
index fe55eb115f5bff4364e59c55b394c40c13f49dd5..7f6155d54468998f365b692727f529ab6f6169d5 100755 (executable)
@@ -793,6 +793,7 @@ enable_newlib_fvwrite_in_streamio
 enable_newlib_fseek_optimization
 enable_newlib_wide_orient
 enable_newlib_nano_malloc
+enable_newlib_unbuf_stream_opt
 enable_multilib
 enable_target_optspace
 enable_malloc_debugging
@@ -1460,6 +1461,7 @@ Optional Features:
   --disable-newlib-fseek-optimization    disable fseek optimization
   --disable-newlib-wide-orient    Turn off wide orientation in streamio
   --enable-newlib-nano-malloc    use small-footprint nano-malloc implementation
+  --disable-newlib-unbuf-stream-opt    disable unbuffered stream optimization in streamio
   --enable-multilib         build many library versions (default)
   --enable-target-optspace  optimize for space
   --enable-malloc-debugging indicate malloc debugging requested
@@ -2410,6 +2412,19 @@ else
   newlib_nano_malloc=no
 fi
 
+# Check whether --enable-newlib-unbuf-stream-opt was given.
+if test "${enable_newlib_unbuf_stream_opt+set}" = set; then :
+  enableval=$enable_newlib_unbuf_stream_opt; if test "${newlib_unbuf_stream_opt+set}" != set; then
+  case "${enableval}" in
+    yes) newlib_unbuf_stream_opt=yes ;;
+    no)  newlib_unbuf_stream_opt=no  ;;
+    *)   as_fn_error $? "bad value ${enableval} for newlib-unbuf-stream-opt option" "$LINENO" 5 ;;
+  esac
+ fi
+else
+  newlib_unbuf_stream_opt=yes
+fi
+
 
 # Make sure we can run config.sub.
 $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
 
 if test "${newlib_nano_malloc}" = "yes"; then
 cat >>confdefs.h <<_ACEOF
-#define NEWLIB_NANO_MALLOC 1
+#define _NANO_MALLOC 1
+_ACEOF
+
+fi
+
+if test "${newlib_unbuf_stream_opt}" = "yes"; then
+cat >>confdefs.h <<_ACEOF
+#define _UNBUF_STREAM_OPT 1
 _ACEOF
 
 fi
index 5646d64d0b93ccd554da08f1810d26853d943d0b..db1c6b1baad9231b9c56f34c001fe4515ab34490 100644 (file)
@@ -170,6 +170,17 @@ AC_ARG_ENABLE(newlib-nano-malloc,
   esac
  fi], [newlib_nano_malloc=no])dnl
 
+dnl Support --disable-newlib-unbuf-stream-opt
+AC_ARG_ENABLE(newlib-unbuf-stream-opt,
+[  --disable-newlib-unbuf-stream-opt    disable unbuffered stream optimization in streamio],
+[if test "${newlib_unbuf_stream_opt+set}" != set; then
+  case "${enableval}" in
+    yes) newlib_unbuf_stream_opt=yes ;;
+    no)  newlib_unbuf_stream_opt=no  ;;
+    *)   AC_MSG_ERROR(bad value ${enableval} for newlib-unbuf-stream-opt option) ;;
+  esac
+ fi], [newlib_unbuf_stream_opt=yes])dnl
+
 NEWLIB_CONFIGURE(.)
 
 dnl We have to enable libtool after NEWLIB_CONFIGURE because if we try and
@@ -375,6 +386,10 @@ if test "${newlib_nano_malloc}" = "yes"; then
 AC_DEFINE_UNQUOTED(_NANO_MALLOC)
 fi
 
+if test "${newlib_unbuf_stream_opt}" = "yes"; then
+AC_DEFINE_UNQUOTED(_UNBUF_STREAM_OPT)
+fi
+
 dnl
 dnl Parse --enable-newlib-iconv-encodings option argument
 dnl
index e5fcb03315144181a5e75f9c9440605fbc09e0fa..dd9c22a6da3b134a004c4b70298615cf631af148 100644 (file)
@@ -447,6 +447,7 @@ int __sfputs_r (struct _reent *, FILE *, _CONST char *buf, size_t);
 int __sprint_r (struct _reent *, FILE *, register struct __suio *);
 #endif /* !INTEGER_ONLY */
 
+#ifdef _UNBUF_STREAM_OPT
 /*
  * Helper function for `fprintf to unbuffered unix file': creates a
  * temporary buffer.  We only work on write-only files; this avoids
@@ -492,6 +493,7 @@ _DEFUN(__sbprintf, (rptr, fp, fmt, ap),
 #endif
        return (ret);
 }
+#endif /* _UNBUF_STREAM_OPT */
 #endif /* !STRING_ONLY */
 
 
@@ -865,12 +867,14 @@ _DEFUN(_VFPRINTF_R, (data, fp, fmt0, ap),
                return (EOF);
        }
 
+#ifdef _UNBUF_STREAM_OPT
        /* optimise fprintf(stderr) (and other unbuffered Unix files) */
        if ((fp->_flags & (__SNBF|__SWR|__SRW)) == (__SNBF|__SWR) &&
            fp->_file >= 0) {
                _newlib_flockfile_exit (fp);
                return (__sbprintf (data, fp, fmt0, ap));
        }
+#endif
 #else /* STRING_ONLY */
         /* Create initial buffer if we are called by asprintf family.  */
         if (fp->_flags & __SMBF && !fp->_bf._base)
index 5860147ec06756af12281e50f015a0b20ba02459..4788add23aa3bfc54cfcce699c62c157b47e2dee 100644 (file)
@@ -166,6 +166,7 @@ int _EXFUN(__SPRINT, (struct _reent *, FILE *, register struct __suio *));
 int _EXFUN(__SPRINT, (struct _reent *, FILE *, _CONST char *, size_t));
 #endif
 #ifndef STRING_ONLY
+#ifdef _UNBUF_STREAM_OPT
 /*
  * Helper function for `fprintf to unbuffered unix file': creates a
  * temporary buffer.  We only work on write-only files; this avoids
@@ -209,6 +210,7 @@ _DEFUN(__sbwprintf, (rptr, fp, fmt, ap),
 #endif
        return (ret);
 }
+#endif /* _UNBUF_STREAM_OPT */
 #endif /* !STRING_ONLY */
 
 
@@ -599,12 +601,14 @@ _DEFUN(_VFWPRINTF_R, (data, fp, fmt0, ap),
                return (EOF);
        }
 
+#ifdef _UNBUF_STREAM_OPT
        /* optimise fwprintf(stderr) (and other unbuffered Unix files) */
        if ((fp->_flags & (__SNBF|__SWR|__SRW)) == (__SNBF|__SWR) &&
            fp->_file >= 0) {
                _newlib_flockfile_exit (fp);
                return (__sbwprintf (data, fp, fmt0, ap));
        }
+#endif
 #else /* STRING_ONLY */
         /* Create initial buffer if we are called by asprintf family.  */
         if (fp->_flags & __SMBF && !fp->_bf._base)
index 030d514190f5192be595f225f2d7f953d9ddd78a..c6637cbd47f14a4726521e7e67035978fc948fd6 100644 (file)
@@ -67,6 +67,9 @@
 /* Define if wide char orientation is supported.  */
 #undef  _WIDE_ORIENT
 
+/* Define if unbuffered stream file optimization is supported.  */
+#undef _UNBUF_STREAM_OPT
+
 /*
  * Iconv encodings enabled ("to" direction)
  */
This page took 0.072502 seconds and 5 git commands to generate.