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 EBA11396D80A for ; Fri, 13 May 2022 13:47:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org EBA11396D80A 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 sslproxy02.your-server.de ([78.47.166.47]) by dedi548.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1npVdJ-000A8s-Ha for newlib@sourceware.org; Fri, 13 May 2022 15:47:05 +0200 Received: from [82.100.198.138] (helo=mail.embedded-brains.de) by sslproxy02.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1npVdJ-000P4Y-M6 for newlib@sourceware.org; Fri, 13 May 2022 15:47:05 +0200 Received: from localhost (localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id 6836C48017E for ; Fri, 13 May 2022 15:47: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 m3Uh-mLgczF7 for ; Fri, 13 May 2022 15:47:03 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id E17CA480175 for ; Fri, 13 May 2022 15:47:02 +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 upsJNft8NZXC for ; Fri, 13 May 2022 15:47:02 +0200 (CEST) Received: from zimbra.eb.localhost (unknown [192.168.96.242]) by mail.embedded-brains.de (Postfix) with ESMTPSA id BC35E48017E for ; Fri, 13 May 2022 15:47:02 +0200 (CEST) From: Sebastian Huber To: newlib@sourceware.org Subject: [PATCH 1/7] Add --enable-newlib-backward-binary-compat Date: Fri, 13 May 2022 15:46:54 +0200 Message-Id: <20220513134700.68563-2-sebastian.huber@embedded-brains.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220513134700.68563-1-sebastian.huber@embedded-brains.de> References: <20220513134700.68563-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/26540/Fri May 13 10:03:59 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: Fri, 13 May 2022 13:47:12 -0000 Add the --enable-newlib-backward-binary-compat configure option. This op= tion is disabled by default. If enabled, then for example unused members in s= truct _reent are preserved to maintain the structure layout. --- newlib/README | 5 +++++ newlib/configure | 21 +++++++++++++++++++++ newlib/configure.ac | 15 +++++++++++++++ newlib/libc/include/sys/config.h | 6 ++++++ newlib/newlib.hin | 3 +++ 5 files changed, 50 insertions(+) diff --git a/newlib/README b/newlib/README index 97890b9d2..54921893f 100644 --- a/newlib/README +++ b/newlib/README @@ -362,6 +362,11 @@ One feature can be enabled by specifying `--enable-F= EATURE=3Dyes' or less conversion accuracy. Enabled by default. =20 +`--enable-newlib-backward-binary-compat' + Enable backward binary compatibility. If enabled, then for example= unused + members in struct _reent are preserved to maintain the structure la= yout. + Disabled by default. + `--enable-multilib' Build many library versions. Enabled by default. diff --git a/newlib/configure b/newlib/configure index c83511da6..6ea3f5631 100755 --- a/newlib/configure +++ b/newlib/configure @@ -983,6 +983,7 @@ enable_newlib_nano_formatted_io enable_newlib_retargetable_locking enable_newlib_long_time_t enable_newlib_use_gdtoa +enable_newlib_backward_binary_compat enable_multilib enable_target_optspace enable_malloc_debugging @@ -1650,6 +1651,7 @@ Optional Features: --enable-newlib-retargetable-locking Allow locking routines to be r= etargeted at link time --enable-newlib-long-time_t define time_t to long --enable-newlib-use-gdtoa Use gdtoa rather than legacy ldtoa + --enable-newlib-backward-binary-compat enable backward binary compat= ibility --enable-multilib build many library versions (default) --enable-target-optspace optimize for space --enable-malloc-debugging indicate malloc debugging requested @@ -2552,6 +2554,19 @@ else newlib_use_gdtoa=3Dyes fi =20 +# Check whether --enable-newlib-backward-binary-compat was given. +if test "${enable_newlib_backward_binary_compat+set}" =3D set; then : + enableval=3D$enable_newlib_backward_binary_compat; if test "${newlib_e= nable_backward_binary_compat+set}" !=3D set; then + case "${enableval}" in + yes) newlib_enable_backward_binary_compat=3Dyes ;; + no) newlib_enable_backward_binary_compat=3Dno ;; + *) as_fn_error $? "bad value ${enableval} for newlib-enable-backwa= rd-binary-compat option" "$LINENO" 5 ;; + esac + fi +else + newlib_enable_backward_binary_compat=3Dno +fi + # Default to --enable-multilib # Check whether --enable-multilib was given. if test "${enable_multilib+set}" =3D set; then : @@ -6529,6 +6544,12 @@ $as_echo "#define _WANT_USE_GDTOA 1" >>confdefs.h =20 fi =20 +if test "${newlib_enable_backward_binary_compat}" =3D "yes"; then + +$as_echo "#define _WANT_NEWLIB_BACKWARD_BINARY_COMPAT 1" >>confdefs.h + +fi + =20 if test "x${iconv_encodings}" !=3D "x" \ || test "x${iconv_to_encodings}" !=3D "x" \ diff --git a/newlib/configure.ac b/newlib/configure.ac index 195d336f2..556580967 100644 --- a/newlib/configure.ac +++ b/newlib/configure.ac @@ -288,6 +288,17 @@ AC_ARG_ENABLE(newlib-use-gdtoa, esac fi], [newlib_use_gdtoa=3Dyes])dnl =20 +dnl Support --enable-newlib-backward-binary-compat +AC_ARG_ENABLE(newlib-backward-binary-compat, +[ --enable-newlib-backward-binary-compat enable backward binary compa= tibility], +[if test "${newlib_enable_backward_binary_compat+set}" !=3D set; then + case "${enableval}" in + yes) newlib_enable_backward_binary_compat=3Dyes ;; + no) newlib_enable_backward_binary_compat=3Dno ;; + *) AC_MSG_ERROR(bad value ${enableval} for newlib-enable-backward-= binary-compat option) ;; + esac + fi], [newlib_enable_backward_binary_compat=3Dno])dnl + AM_ENABLE_MULTILIB(, ..) NEWLIB_CONFIGURE(.) =20 @@ -499,6 +510,10 @@ if test "${newlib_use_gdtoa}" =3D "yes"; then AC_DEFINE(_WANT_USE_GDTOA, 1, [Define if using gdtoa rather than legac= y ldtoa.]) fi =20 +if test "${newlib_enable_backward_binary_compat}" =3D "yes"; then + AC_DEFINE(_WANT_NEWLIB_BACKWARD_BINARY_COMPAT, 1, [Define to enable ba= ckward binary compatibility.]) +fi + dnl dnl Parse --enable-newlib-iconv-encodings option argument dnl diff --git a/newlib/libc/include/sys/config.h b/newlib/libc/include/sys/c= onfig.h index 61a6f95d8..fbc1e0fe1 100644 --- a/newlib/libc/include/sys/config.h +++ b/newlib/libc/include/sys/config.h @@ -299,6 +299,12 @@ #endif #endif =20 +#ifdef _WANT_NEWLIB_BACKWARD_BINARY_COMPAT +#ifndef _NEWLIB_BACKWARD_BINARY_COMPAT +#define _NEWLIB_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..cf3086c32 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. */ +#undef _WANT_NEWLIB_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