From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dedi548.your-server.de (dedi548.your-server.de [85.10.215.148]) by sourceware.org (Postfix) with ESMTPS id 317BF3858407 for ; Mon, 16 May 2022 06:56:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 317BF3858407 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embedded-brains.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embedded-brains.de Received: from sslproxy01.your-server.de ([78.46.139.224]) by dedi548.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nqUeC-0007ot-0v for newlib@sourceware.org; Mon, 16 May 2022 08:56:04 +0200 Received: from [82.100.198.138] (helo=mail.embedded-brains.de) by sslproxy01.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nqUeB-000BQ6-Ty for newlib@sourceware.org; Mon, 16 May 2022 08:56:03 +0200 Received: from localhost (localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id 8EAAB480169 for ; Mon, 16 May 2022 08:56:03 +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 mT_iOh93_oow for ; Mon, 16 May 2022 08:56:00 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id 455F948016E for ; Mon, 16 May 2022 08:56:00 +0200 (CEST) X-Virus-Scanned: amavisd-new at zimbra.eb.localhost 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 EvAQhtpiKDOp for ; Mon, 16 May 2022 08:56:00 +0200 (CEST) Received: from zimbra.eb.localhost (unknown [192.168.96.242]) by mail.embedded-brains.de (Postfix) with ESMTPSA id 220EB4800A6 for ; Mon, 16 May 2022 08:56:00 +0200 (CEST) From: Sebastian Huber To: newlib@sourceware.org Subject: [PATCH 1/6] Add --enable-newlib-reent-binary-compat Date: Mon, 16 May 2022 08:55:52 +0200 Message-Id: <20220516065557.78164-2-sebastian.huber@embedded-brains.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220516065557.78164-1-sebastian.huber@embedded-brains.de> References: <20220516065557.78164-1-sebastian.huber@embedded-brains.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Authenticated-Sender: smtp-embedded@poldinet.de X-Virus-Scanned: Clear (ClamAV 0.103.5/26542/Sun May 15 10:03:23 2022) X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2022 06:56:09 -0000 Add the --enable-newlib-reent-binary-compat configure option. This optio= n is disabled by default. If enabled, then unused members in struct _reent ar= e preserved to maintain the structure layout. --- 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..c99ab47c6 100644 --- a/newlib/README +++ b/newlib/README @@ -362,6 +362,12 @@ One feature can be enabled by specifying `--enable-F= EATURE=3Dyes' or less conversion accuracy. Enabled 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 struc= ture + layout. + Disabled by default. + `--enable-multilib' Build many library versions. Enabled by default. diff --git a/newlib/configure b/newlib/configure index c83511da6..4ff02360b 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= atexit 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 compatibi= lity 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_enab= le_reent_binary_compat+set}" !=3D set; then + case "${enableval}" in + yes) newlib_enable_reent_binary_compat=3Dyes ;; + no) newlib_enable_reent_binary_compat=3Dno ;; + *) as_fn_error $? "bad value ${enableval} for newlib-enable-reent-= binary-compat option" "$LINENO" 5 ;; + esac + fi +else + newlib_enable_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}" i= n @@ -6418,6 +6433,12 @@ $as_echo "#define _WANT_REENT_SMALL 1" >>confdefs.= h =20 fi =20 +if test "${newlib_enable_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..7c7297564 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 compatib= ility for struct _reent], +[if test "${newlib_enable_reent_binary_compat+set}" !=3D set; then + case "${enableval}" in + yes) newlib_enable_reent_binary_compat=3Dyes ;; + no) newlib_enable_reent_binary_compat=3Dno ;; + *) AC_MSG_ERROR(bad value ${enableval} for newlib-enable-reent-bin= ary-compat option) ;; + esac + fi], [newlib_enable_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. U= sed mostly on platforms with very restricted storage.]) fi =20 +if test "${newlib_enable_reent_binary_compat}" =3D "yes"; then + AC_DEFINE(_WANT_REENT_BACKWARD_BINARY_COMPAT, 1, [Define to enable bac= kward 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 = and make them global. diff --git a/newlib/libc/include/sys/config.h b/newlib/libc/include/sys/c= onfig.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= make them global. The stdio stream pointers of struct _reent are initializ= ed to point to the global stdio FILE stream objects. */ --=20 2.35.3