From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 128854 invoked by alias); 29 Jun 2017 12:25:41 -0000 Mailing-List: contact newlib-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: newlib-owner@sourceware.org Received: (qmail 128765 invoked by uid 89); 29 Jun 2017 12:25:40 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.6 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: dedi548.your-server.de Received: from dedi548.your-server.de (HELO dedi548.your-server.de) (85.10.215.148) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 29 Jun 2017 12:25:38 +0000 Received: from [88.198.220.130] (helo=sslproxy01.your-server.de) by dedi548.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.85_2) (envelope-from ) id 1dQYQX-0008Ju-Kn for newlib@sourceware.org; Thu, 29 Jun 2017 14:20:05 +0200 Received: from [82.135.62.35] (helo=mail.embedded-brains.de) by sslproxy01.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dQYQW-0002Kh-RU for newlib@sourceware.org; Thu, 29 Jun 2017 14:20:05 +0200 Received: from localhost (localhost.localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id DDE722A160A for ; Thu, 29 Jun 2017 14:20:05 +0200 (CEST) Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id zbXiFUJz0yGS for ; Thu, 29 Jun 2017 14:20:05 +0200 (CEST) Received: from localhost (localhost.localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id 6E0EB2A167C for ; Thu, 29 Jun 2017 14:20:05 +0200 (CEST) Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id VABpjOMJooBP for ; Thu, 29 Jun 2017 14:20:05 +0200 (CEST) Received: from huber-linux.eb.localhost (unknown [192.168.96.129]) by mail.embedded-brains.de (Postfix) with ESMTP id 5215C2A167B for ; Thu, 29 Jun 2017 14:20:05 +0200 (CEST) From: Sebastian Huber To: newlib@sourceware.org Subject: [PATCH v3 5/5] Add --enable-newlib-global-stdio-streams Date: Thu, 29 Jun 2017 12:25:00 -0000 Message-Id: <20170629122002.25614-5-sebastian.huber@embedded-brains.de> In-Reply-To: <20170629122002.25614-1-sebastian.huber@embedded-brains.de> References: <20170629122002.25614-1-sebastian.huber@embedded-brains.de> X-IsSubscribed: yes X-SW-Source: 2017/txt/msg00517.txt.bz2 Signed-off-by: Sebastian Huber --- newlib/README | 6 ++++++ newlib/configure | 24 ++++++++++++++++++++++-- newlib/configure.in | 13 +++++++++++++ newlib/libc/include/sys/config.h | 6 ++++++ newlib/newlib.hin | 5 +++++ 5 files changed, 52 insertions(+), 2 deletions(-) diff --git a/newlib/README b/newlib/README index ed8fb3540..78f4de846 100644 --- a/newlib/README +++ b/newlib/README @@ -297,6 +297,12 @@ One feature can be enabled by specifying `--enable-FEATURE=yes' or is not referenced. Disabled by default. +`--enable-newlib-global-stdio-streams' + Enable to move the stdio stream FILE objects out of struct _reent and make + them global. The stdio stream pointers of struct _reent are initialized + to point to the global stdio FILE stream objects. + Disabled by default. + `--enable-newlib-reent-small' Enable small reentrant struct support. Disabled by default. diff --git a/newlib/configure b/newlib/configure index de28c25b3..b2f0b3340 100755 --- a/newlib/configure +++ b/newlib/configure @@ -795,6 +795,7 @@ enable_newlib_iconv_external_ccs enable_newlib_atexit_dynamic_alloc enable_newlib_global_atexit enable_newlib_reent_small +enable_newlib_global_stdio_streams enable_newlib_fvwrite_in_streamio enable_newlib_fseek_optimization enable_newlib_wide_orient @@ -1467,6 +1468,7 @@ Optional Features: --disable-newlib-atexit-dynamic-alloc disable dynamic allocation of atexit entries --enable-newlib-global-atexit enable atexit data structure as global --enable-newlib-reent-small enable small reentrant struct support + --enable-newlib-global-stdio-streams enable global stdio streams --disable-newlib-fvwrite-in-streamio disable iov in streamio --disable-newlib-fseek-optimization disable fseek optimization --disable-newlib-wide-orient Turn off wide orientation in streamio @@ -2387,6 +2389,17 @@ else newlib_reent_small= fi +# Check whether --enable-newlib-global-stdio-streams was given. +if test "${enable_newlib_global_stdio_streams+set}" = set; then : + enableval=$enable_newlib_global_stdio_streams; case "${enableval}" in + yes) newlib_global_stdio_streams=yes;; + no) newlib_global_stdio_streams=no ;; + *) as_fn_error $? "bad value ${enableval} for newlib-global-stdio-streams option" "$LINENO" 5 ;; + esac +else + newlib_global_stdio_streams= +fi + # Check whether --enable-newlib-fvwrite-in-streamio was given. if test "${enable_newlib_fvwrite_in_streamio+set}" = set; then : enableval=$enable_newlib_fvwrite_in_streamio; if test "${newlib_fvwrite_in_streamio+set}" != set; then @@ -11794,7 +11807,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11797 "configure" +#line 11810 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11900,7 +11913,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11903 "configure" +#line 11916 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -12347,6 +12360,13 @@ _ACEOF fi +if test "${newlib_global_stdio_streams}" = "yes"; then +cat >>confdefs.h <<_ACEOF +#define _WANT_REENT_GLOBAL_STDIO_STREAMS 1 +_ACEOF + +fi + if test "${newlib_mb}" = "yes"; then cat >>confdefs.h <<_ACEOF #define _MB_CAPABLE 1 diff --git a/newlib/configure.in b/newlib/configure.in index 354c07ca5..5b86ee800 100644 --- a/newlib/configure.in +++ b/newlib/configure.in @@ -136,6 +136,15 @@ AC_ARG_ENABLE(newlib-reent-small, no) newlib_reent_small=no ;; *) AC_MSG_ERROR(bad value ${enableval} for newlib-reent-small option) ;; esac], [newlib_reent_small=])dnl + +dnl Support --enable-newlib-global-stdio-streams +AC_ARG_ENABLE(newlib-global-stdio-streams, +[ --enable-newlib-global-stdio-streams enable global stdio streams], +[case "${enableval}" in + yes) newlib_global_stdio_streams=yes;; + no) newlib_global_stdio_streams=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for newlib-global-stdio-streams option) ;; + esac], [newlib_global_stdio_streams=])dnl dnl Support --disable-newlib-fvwrite-in-streamio AC_ARG_ENABLE(newlib-fvwrite-in-streamio, @@ -400,6 +409,10 @@ if test "${newlib_reent_small}" = "yes"; then AC_DEFINE_UNQUOTED(_WANT_REENT_SMALL) fi +if test "${newlib_global_stdio_streams}" = "yes"; then +AC_DEFINE_UNQUOTED(_WANT_REENT_GLOBAL_STDIO_STREAMS) +fi + if test "${newlib_mb}" = "yes"; then AC_DEFINE_UNQUOTED(_MB_CAPABLE) AC_DEFINE_UNQUOTED(_MB_LEN_MAX,8) diff --git a/newlib/libc/include/sys/config.h b/newlib/libc/include/sys/config.h index ae8caff7b..e45aa5417 100644 --- a/newlib/libc/include/sys/config.h +++ b/newlib/libc/include/sys/config.h @@ -276,6 +276,12 @@ #endif #endif +#ifdef _WANT_REENT_GLOBAL_STDIO_STREAMS +#ifndef _REENT_GLOBAL_STDIO_STREAMS +#define _REENT_GLOBAL_STDIO_STREAMS +#endif +#endif + /* If _MB_EXTENDED_CHARSETS_ALL is set, we want all of the extended charsets. The extended charsets add a few functions and a couple of tables of a few K each. */ diff --git a/newlib/newlib.hin b/newlib/newlib.hin index 397bc9b96..45c683187 100644 --- a/newlib/newlib.hin +++ b/newlib/newlib.hin @@ -79,6 +79,11 @@ /* Define if declare atexit data as global. */ #undef _REENT_GLOBAL_ATEXIT +/* Define to move the stdio stream FILE objects out of struct _reent and make + them global. The stdio stream pointers of struct _reent are initialized to + point to the global stdio FILE stream objects. */ +#undef _WANT_REENT_GLOBAL_STDIO_STREAMS + /* Define if small footprint nano-formatted-IO implementation used. */ #undef _NANO_FORMATTED_IO -- 2.12.3