From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1921) id 7CCEB385741C; Wed, 18 May 2022 05:57:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7CCEB385741C Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Sebastian Huber To: newlib-cvs@sourceware.org Subject: [newlib-cygwin] Add --enable-newlib-reent-binary-compat X-Act-Checkin: newlib-cygwin X-Git-Author: Sebastian Huber X-Git-Refname: refs/heads/master X-Git-Oldrev: 5c7af4227d324c2aa83e4fc4042a1b52147907f4 X-Git-Newrev: 065d77dd0232efb4a49494ff9d2797da9c537e28 Message-Id: <20220518055754.7CCEB385741C@sourceware.org> Date: Wed, 18 May 2022 05:57:54 +0000 (GMT) X-BeenThere: newlib-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib GIT logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2022 05:57:54 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D065d77dd023= 2efb4a49494ff9d2797da9c537e28 commit 065d77dd0232efb4a49494ff9d2797da9c537e28 Author: Sebastian Huber Date: Fri May 13 13:55:06 2022 +0200 Add --enable-newlib-reent-binary-compat =20 Add the --enable-newlib-reent-binary-compat configure option. This opt= ion is disabled by default. If enabled, then unused members in struct _reent = are preserved to maintain the structure layout. Diff: --- newlib/README | 6 ++++++ newlib/configure | 21 +++++++++++++++++++++ newlib/configure.ac | 15 +++++++++++++++ newlib/libc/include/sys/config.h | 6 ++++++ newlib/newlib.hin | 3 +++ 5 files changed, 51 insertions(+) diff --git a/newlib/README b/newlib/README index 97890b9d2..9de294e9c 100644 --- a/newlib/README +++ b/newlib/README @@ -310,6 +310,12 @@ One feature can be enabled by specifying `--enable-FEA= TURE=3Dyes' or Enable small reentrant struct support. Disabled by default. =20 +`--enable-newlib-reent-binary-compat' + Enable backward binary compatibility for struct _reent. If enabled, = then + unused members in struct _reent are preserved to maintain the structu= re + layout. + Disabled by default. + `--disable-newlib-fvwrite-in-streamio' NEWLIB implements the vector buffer mechanism to support stream IO buffering required by C standard. This feature is possibly diff --git a/newlib/configure b/newlib/configure index c83511da6..60cbc1fa8 100755 --- a/newlib/configure +++ b/newlib/configure @@ -972,6 +972,7 @@ enable_newlib_iconv_external_ccs enable_newlib_atexit_dynamic_alloc enable_newlib_global_atexit enable_newlib_reent_small +enable_newlib_reent_binary_compat enable_newlib_global_stdio_streams enable_newlib_fvwrite_in_streamio enable_newlib_fseek_optimization @@ -1639,6 +1640,7 @@ Optional Features: --disable-newlib-atexit-dynamic-alloc disable dynamic allocation of a= texit entries --enable-newlib-global-atexit enable atexit data structure as global --enable-newlib-reent-small enable small reentrant struct support + --enable-newlib-reent-binary-compat enable backward binary compatibili= ty for struct _reent --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 @@ -2390,6 +2392,19 @@ else newlib_reent_small=3D fi =20 +# Check whether --enable-newlib-reent-binary-compat was given. +if test "${enable_newlib_reent_binary_compat+set}" =3D set; then : + enableval=3D$enable_newlib_reent_binary_compat; if test "${newlib_reent_= binary_compat+set}" !=3D set; then + case "${enableval}" in + yes) newlib_reent_binary_compat=3Dyes ;; + no) newlib_reent_binary_compat=3Dno ;; + *) as_fn_error $? "bad value ${enableval} for newlib-enable-reent-bi= nary-compat option" "$LINENO" 5 ;; + esac + fi +else + newlib_reent_binary_compat=3Dno +fi + # Check whether --enable-newlib-global-stdio-streams was given. if test "${enable_newlib_global_stdio_streams+set}" =3D set; then : enableval=3D$enable_newlib_global_stdio_streams; case "${enableval}" in @@ -6418,6 +6433,12 @@ $as_echo "#define _WANT_REENT_SMALL 1" >>confdefs.h =20 fi =20 +if test "${newlib_reent_binary_compat}" =3D "yes"; then + +$as_echo "#define _WANT_REENT_BACKWARD_BINARY_COMPAT 1" >>confdefs.h + +fi + if test "${newlib_global_stdio_streams}" =3D "yes"; then =20 $as_echo "#define _WANT_REENT_GLOBAL_STDIO_STREAMS 1" >>confdefs.h diff --git a/newlib/configure.ac b/newlib/configure.ac index 195d336f2..12d52c262 100644 --- a/newlib/configure.ac +++ b/newlib/configure.ac @@ -162,6 +162,17 @@ AC_ARG_ENABLE(newlib-reent-small, *) AC_MSG_ERROR(bad value ${enableval} for newlib-reent-small option) = ;; esac], [newlib_reent_small=3D])dnl =20 +dnl Support --enable-newlib-reent-binary-compat +AC_ARG_ENABLE(newlib-reent-binary-compat, +[ --enable-newlib-reent-binary-compat enable backward binary compatibil= ity for struct _reent], +[if test "${newlib_reent_binary_compat+set}" !=3D set; then + case "${enableval}" in + yes) newlib_reent_binary_compat=3Dyes ;; + no) newlib_reent_binary_compat=3Dno ;; + *) AC_MSG_ERROR(bad value ${enableval} for newlib-enable-reent-binar= y-compat option) ;; + esac + fi], [newlib_reent_binary_compat=3Dno])dnl + dnl Support --enable-newlib-global-stdio-streams AC_ARG_ENABLE(newlib-global-stdio-streams, [ --enable-newlib-global-stdio-streams enable global stdio streams], @@ -420,6 +431,10 @@ if test "${newlib_reent_small}" =3D "yes"; then AC_DEFINE(_WANT_REENT_SMALL, 1, [Optional reentrant struct support. Use= d mostly on platforms with very restricted storage.]) fi =20 +if test "${newlib_reent_binary_compat}" =3D "yes"; then + AC_DEFINE(_WANT_REENT_BACKWARD_BINARY_COMPAT, 1, [Define to enable backw= ard binary compatibility for struct _reent.]) +fi + if test "${newlib_global_stdio_streams}" =3D "yes"; then AC_DEFINE(_WANT_REENT_GLOBAL_STDIO_STREAMS, 1, [Define to move the stdio stream FILE objects out of struct _reent an= d make them global. diff --git a/newlib/libc/include/sys/config.h b/newlib/libc/include/sys/con= fig.h index 61a6f95d8..b4d755957 100644 --- a/newlib/libc/include/sys/config.h +++ b/newlib/libc/include/sys/config.h @@ -299,6 +299,12 @@ #endif #endif =20 +#ifdef _WANT_REENT_BACKWARD_BINARY_COMPAT +#ifndef _REENT_BACKWARD_BINARY_COMPAT +#define _REENT_BACKWARD_BINARY_COMPAT +#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 b52bc7460..4a9614970 100644 --- a/newlib/newlib.hin +++ b/newlib/newlib.hin @@ -402,6 +402,9 @@ /* Positional argument support in printf functions enabled. */ #undef _WANT_IO_POS_ARGS =20 +/* Define to enable backward binary compatibility for struct _reent. */ +#undef _WANT_REENT_BACKWARD_BINARY_COMPAT + /* Define to move the stdio stream FILE objects out of struct _reent and m= ake them global. The stdio stream pointers of struct _reent are initialized= to point to the global stdio FILE stream objects. */