From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-il1-x135.google.com (mail-il1-x135.google.com [IPv6:2607:f8b0:4864:20::135]) by sourceware.org (Postfix) with ESMTPS id 286DF3858D3C for ; Mon, 16 May 2022 07:42:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 286DF3858D3C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-il1-x135.google.com with SMTP id f9so172134ils.7 for ; Mon, 16 May 2022 00:42:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=JovuW3TkM4eRX9pA3Gwpn8ohILPZnroHc8quyZ83p7o=; b=a4SMElitfiRBWuRt8RTHhJ0gxaIYNtKCB+GKQyopIPBOJu3qEnCeNn9T5CGo8nLKQ6 v2kBpG4i3ZoKZkKlenOuyQK9kSPGI+wN4A2roq/8BXQrXA3b+ggBncCqnNHzQIwA9RxO rcny0xvqwAp/DcNBDzSNcpZaa/pn6v8uUnoyD0nEySWxc6F2Rve8jcE4asuVlqw4fv5a l3QYM7sFPUXnLc2xZ92HRYtkm13HJ+wQMQCA705rUb5OP8Uj+kh2eFCGe4a/VuP6kclp CAto4Be/3AVt19McG8Z9lU1Txo4aKGJzJiLSt/2SLa0ji3NUCgyDmTpS4Ew62RiAEBqe VGFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=JovuW3TkM4eRX9pA3Gwpn8ohILPZnroHc8quyZ83p7o=; b=Ijzvpf6lzLKTafK32t9cFNHG5Z4o1OLlf/RlFmeLdIGCB24xUb54RBq4/rjaYwKgDe BEQXJeiMq9zF+ZsZykr/ff+Bd5f6qq5R6/sk4x/gUAS+MJuOZ52+d85vv05+G6wLmFJr gq+0zIOMZo7mfdS1qAENmR4eVLku3yK0jlCuBgNxX6tGKTnMkWOF4C1SwAKG01oavJ6w BnK47ggL4Fek0MffezOCRlHq/mKwdwHvdRQQ8tFqGoaLeKvq0rdBOHxocVHVIwaeA1Mk A6fzuR/gIwKfUOWeMpPSiiijr7bC291/zBbZh9GzhQZCAj6+N5HGyXZhotazXOFbbvCP cXJA== X-Gm-Message-State: AOAM531+ApQsdXbkeNrgRQAPpaAQQ46JkN3QEm5ZIQXgWAlFg94s5W1r 5vD3Qiuk22B5qmjtSqzch6mtQdtIwAh4RmE3g9f/ZhddgqE= X-Google-Smtp-Source: ABdhPJzo9CT28JBneDF65Y3bU/ZQQ5mabc43qOYuWAc3xvMtBq5Lp8nVGk4ToiClaPPRtwtJom4Ys523B9I6twGAriQ= X-Received: by 2002:a05:6e02:d06:b0:2d1:2be8:df10 with SMTP id g6-20020a056e020d0600b002d12be8df10mr291015ilj.127.1652686951965; Mon, 16 May 2022 00:42:31 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: =?UTF-8?B?0JDQu9C10LrRgdC10Lkg0JHQvtC90LTQsNGA0LXQvdC60L4=?= Date: Mon, 16 May 2022 10:42:21 +0300 Message-ID: Subject: Re: Newlib Digest, Vol 27, Issue 23 To: newlib@sourceware.org X-Spam-Status: No, score=-9.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, GIT_PATCH_0, HTML_MESSAGE, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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 07:42:38 -0000 All dubious actions - freeze, 24/7 under the attacks of scammers, perhaps there is a substitution of identity.legitimate device is only this and then they are trying to perform remote control, apple, Mac, there is no more trust. =D0=BF=D0=BD, 16 =D0=BC=D0=B0=D1=8F 2022 =D0=B3., 09:58 : > Send Newlib mailing list submissions to > newlib@sourceware.org > > To subscribe or unsubscribe via the World Wide Web, visit > https://sourceware.org/mailman/listinfo/newlib > or, via email, send a message with subject or body 'help' to > newlib-request@sourceware.org > > You can reach the person managing the list at > newlib-owner@sourceware.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Newlib digest..." > Today's Topics: > > 1. Re: [PATCH 2/7] Cygwin: Enable backward binary compatibility > (Sebastian Huber) > 2. [PATCH 2/6] Optional struct _reent::__unused_sdidinit > (Sebastian Huber) > 3. [PATCH 5/6] Optional struct > _reent::_new::_reent::_unused_rand (Sebastian Huber) > 4. [PATCH 3/6] Optional struct _reent::_unspecified_locale_info > (Sebastian Huber) > 5. [PATCH 4/6] Optional struct _reent::_new::_unused > (Sebastian Huber) > 6. [PATCH 0/6] Add --enable-newlib-reent-binary-compat configure > option (Sebastian Huber) > > > > ---------- Forwarded message ---------- > From: Sebastian Huber > To: newlib@sourceware.org > Cc: > Bcc: > Date: Mon, 16 May 2022 07:31:38 +0200 > Subject: Re: [PATCH 2/7] Cygwin: Enable backward binary compatibility > On 13/05/2022 22:15, Corinna Vinschen wrote: > > On May 13 15:46, Sebastian Huber wrote: > >> --- > >> winsup/cygwin/include/cygwin/config.h | 1 + > >> 1 file changed, 1 insertion(+) > >> > >> diff --git a/winsup/cygwin/include/cygwin/config.h > b/winsup/cygwin/include/cygwin/config.h > >> index 71a216fbd..2d410a2e7 100644 > >> --- a/winsup/cygwin/include/cygwin/config.h > >> +++ b/winsup/cygwin/include/cygwin/config.h > >> @@ -80,6 +80,7 @@ extern inline struct _reent *__getreent (void) > >> #define __TM_GMTOFF tm_gmtoff > >> #define __TM_ZONE tm_zone > >> #define _USE_LONG_TIME_T 1 > >> +#define _NEWLIB_BACKWARD_BINARY_COMPAT 1 > > Why? > > > > AFAICS we don't expose _REENT to user space. In theory (knocking > > on wood here), we shouldn't need _REENT binary compat. > > Ok good, I always thought the unused members in struct _reent were > mainly for Cygwin. > > Maybe the option should be named --enable-newlib-reent-binary-compat and > restricted to struct _reent. > > -- > embedded brains GmbH > Herr Sebastian HUBER > Dornierstr. 4 > 82178 Puchheim > Germany > email: sebastian.huber@embedded-brains.de > phone: +49-89-18 94 741 - 16 > fax: +49-89-18 94 741 - 08 > > Registergericht: Amtsgericht M=C3=BCnchen > Registernummer: HRB 157899 > Vertretungsberechtigte Gesch=C3=A4ftsf=C3=BChrer: Peter Rasmussen, Thomas= D=C3=B6rfler > Unsere Datenschutzerkl=C3=A4rung finden Sie hier: > https://embedded-brains.de/datenschutzerklaerung/ > > > > > ---------- Forwarded message ---------- > From: Sebastian Huber > To: newlib@sourceware.org > Cc: > Bcc: > Date: Mon, 16 May 2022 08:55:53 +0200 > Subject: [PATCH 2/6] Optional struct _reent::__unused_sdidinit > Provide struct _reent::__unused_sdidinit only if > _REENT_BACKWARD_BINARY_COMPAT > is defined. > --- > newlib/libc/include/sys/reent.h | 16 +++++++++++++--- > 1 file changed, 13 insertions(+), 3 deletions(-) > > diff --git a/newlib/libc/include/sys/reent.h > b/newlib/libc/include/sys/reent.h > index fa9ac57da..e2fd0b422 100644 > --- a/newlib/libc/include/sys/reent.h > +++ b/newlib/libc/include/sys/reent.h > @@ -342,6 +342,12 @@ struct _rand48 { > #define _REENT_ASCTIME_SIZE 26 > #define _REENT_SIGNAL_SIZE 24 > > +#ifdef _REENT_BACKWARD_BINARY_COMPAT > +#define _REENT_INIT_UNUSED_SDIDINIT 0, > +#else > +#define _REENT_INIT_UNUSED_SDIDINIT /* Nothing to initialize */ > +#endif > + > /* > * struct _reent > * > @@ -395,9 +401,11 @@ struct _reent > > char *_emergency; > > +#ifdef _REENT_BACKWARD_BINARY_COMPAT > /* No longer used, but member retained for binary compatibility. > Now, the __cleanup member is used to check initialization. */ > int _unused_sdidinit; > +#endif > > int _unspecified_locale_info; /* unused, reserved for locale > stuff */ > struct __locale_t *_locale;/* per-thread locale */ > @@ -440,7 +448,7 @@ struct _reent > &__sf[2], \ > 0, \ > _NULL, \ > - 0, \ > + _REENT_INIT_UNUSED_SDIDINIT \ > 0, \ > _NULL, \ > _NULL, \ > @@ -478,7 +486,7 @@ extern const struct __sFILE_fake __sf_fake_stderr; > (__FILE *)&__sf_fake_stderr, \ > 0, \ > _NULL, \ > - 0, \ > + _REENT_INIT_UNUSED_SDIDINIT \ > 0, \ > _NULL, \ > _NULL, \ > @@ -633,9 +641,11 @@ struct _reent > int _unspecified_locale_info; /* unused, reserved for locale > stuff */ > struct __locale_t *_locale;/* per-thread locale */ > > +#ifdef _REENT_BACKWARD_BINARY_COMPAT > /* No longer used, but member retained for binary compatibility. > Now, the __cleanup member is used to check initialization. */ > int _unused_sdidinit; > +#endif > > void (*__cleanup) (struct _reent *); > > @@ -723,7 +733,7 @@ struct _reent > "", \ > 0, \ > _NULL, \ > - 0, \ > + _REENT_INIT_UNUSED_SDIDINIT \ > _NULL, \ > _NULL, \ > 0, \ > -- > 2.35.3 > > > > > > ---------- Forwarded message ---------- > From: Sebastian Huber > To: newlib@sourceware.org > Cc: > Bcc: > Date: Mon, 16 May 2022 08:55:56 +0200 > Subject: [PATCH 5/6] Optional struct _reent::_new::_reent::_unused_rand > Provide struct _reent::_new::_reent::_unused_rand only if > _REENT_BACKWARD_BINARY_COMPAT is defined. > --- > newlib/libc/include/sys/reent.h | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/newlib/libc/include/sys/reent.h > b/newlib/libc/include/sys/reent.h > index 1884ed982..4683ecc2f 100644 > --- a/newlib/libc/include/sys/reent.h > +++ b/newlib/libc/include/sys/reent.h > @@ -344,9 +344,11 @@ struct _rand48 { > > #ifdef _REENT_BACKWARD_BINARY_COMPAT > #define _REENT_INIT_UNUSED_LOCALE_INFO 0, > +#define _REENT_INIT_UNUSED_RAND 0, > #define _REENT_INIT_UNUSED_SDIDINIT 0, > #else > #define _REENT_INIT_UNUSED_LOCALE_INFO /* Nothing to initialize */ > +#define _REENT_INIT_UNUSED_RAND /* Nothing to initialize */ > #define _REENT_INIT_UNUSED_SDIDINIT /* Nothing to initialize */ > #endif > > @@ -667,7 +669,9 @@ struct _reent > { > struct > { > +#ifdef _REENT_BACKWARD_BINARY_COMPAT > unsigned int _unused_rand; > +#endif > char * _strtok_last; > char _asctime_buf[_REENT_ASCTIME_SIZE]; > struct __tm _localtime_buf; > @@ -749,7 +753,7 @@ struct _reent > _NULL, \ > { \ > { \ > - 0, \ > + _REENT_INIT_UNUSED_RAND \ > _NULL, \ > "", \ > {0, 0, 0, 0, 0, 0, 0, 0, 0}, \ > -- > 2.35.3 > > > > > > ---------- Forwarded message ---------- > From: Sebastian Huber > To: newlib@sourceware.org > Cc: > Bcc: > Date: Mon, 16 May 2022 08:55:54 +0200 > Subject: [PATCH 3/6] Optional struct _reent::_unspecified_locale_info > Provide struct _reent::_unspecified_locale_info only if > _REENT_BACKWARD_BINARY_COMPAT is defined. > --- > newlib/libc/include/sys/reent.h | 12 ++++++++---- > 1 file changed, 8 insertions(+), 4 deletions(-) > > diff --git a/newlib/libc/include/sys/reent.h > b/newlib/libc/include/sys/reent.h > index e2fd0b422..5f557111e 100644 > --- a/newlib/libc/include/sys/reent.h > +++ b/newlib/libc/include/sys/reent.h > @@ -343,8 +343,10 @@ struct _rand48 { > #define _REENT_SIGNAL_SIZE 24 > > #ifdef _REENT_BACKWARD_BINARY_COMPAT > +#define _REENT_INIT_UNUSED_LOCALE_INFO 0, > #define _REENT_INIT_UNUSED_SDIDINIT 0, > #else > +#define _REENT_INIT_UNUSED_LOCALE_INFO /* Nothing to initialize */ > #define _REENT_INIT_UNUSED_SDIDINIT /* Nothing to initialize */ > #endif > > @@ -405,9 +407,9 @@ struct _reent > /* No longer used, but member retained for binary compatibility. > Now, the __cleanup member is used to check initialization. */ > int _unused_sdidinit; > -#endif > > int _unspecified_locale_info; /* unused, reserved for locale > stuff */ > +#endif > struct __locale_t *_locale;/* per-thread locale */ > > struct _mprec *_mp; > @@ -449,7 +451,7 @@ struct _reent > 0, \ > _NULL, \ > _REENT_INIT_UNUSED_SDIDINIT \ > - 0, \ > + _REENT_INIT_UNUSED_LOCALE_INFO \ > _NULL, \ > _NULL, \ > _NULL, \ > @@ -487,7 +489,7 @@ extern const struct __sFILE_fake __sf_fake_stderr; > 0, \ > _NULL, \ > _REENT_INIT_UNUSED_SDIDINIT \ > - 0, \ > + _REENT_INIT_UNUSED_LOCALE_INFO \ > _NULL, \ > _NULL, \ > _NULL, \ > @@ -638,7 +640,9 @@ struct _reent > char _emergency[_REENT_EMERGENCY_SIZE]; > > /* TODO */ > +#ifdef _REENT_BACKWARD_BINARY_COMPAT > int _unspecified_locale_info; /* unused, reserved for locale > stuff */ > +#endif > struct __locale_t *_locale;/* per-thread locale */ > > #ifdef _REENT_BACKWARD_BINARY_COMPAT > @@ -731,7 +735,7 @@ struct _reent > _REENT_STDIO_STREAM(&(var), 2), \ > 0, \ > "", \ > - 0, \ > + _REENT_INIT_UNUSED_LOCALE_INFO \ > _NULL, \ > _REENT_INIT_UNUSED_SDIDINIT \ > _NULL, \ > -- > 2.35.3 > > > > > > ---------- Forwarded message ---------- > From: Sebastian Huber > To: newlib@sourceware.org > Cc: > Bcc: > Date: Mon, 16 May 2022 08:55:55 +0200 > Subject: [PATCH 4/6] Optional struct _reent::_new::_unused > Provide struct _reent::_new::_unused only if _REENT_BACKWARD_BINARY_COMPA= T > is > defined. > --- > newlib/libc/include/sys/reent.h | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/newlib/libc/include/sys/reent.h > b/newlib/libc/include/sys/reent.h > index 5f557111e..1884ed982 100644 > --- a/newlib/libc/include/sys/reent.h > +++ b/newlib/libc/include/sys/reent.h > @@ -687,6 +687,7 @@ struct _reent > _mbstate_t _wcsrtombs_state; > int _h_errno; > } _reent; > +#ifdef _REENT_BACKWARD_BINARY_COMPAT > /* Two next two fields were once used by malloc. They are no longer > used. They are used to preserve the space used before so as to > allow addition of new reent fields and keep binary compatibility. > */ > @@ -696,6 +697,7 @@ struct _reent > unsigned char * _nextf[_N_LISTS]; > unsigned int _nmalloc[_N_LISTS]; > } _unused; > +#endif > } _new; > > # ifndef _REENT_GLOBAL_ATEXIT > -- > 2.35.3 > > > > > > ---------- Forwarded message ---------- > From: Sebastian Huber > To: newlib@sourceware.org > Cc: > Bcc: > Date: Mon, 16 May 2022 08:55:51 +0200 > Subject: [PATCH 0/6] Add --enable-newlib-reent-binary-compat configure > option > This patch set adds the --enable-newlib-reent-binary-compat configure > option > which may be used to define the new Newlib configuration option > _REENT_BACKWARD_BINARY_COMPAT. This option is used to provide binary > backward > compatibility for struct _reent by preserving unused members in struct > _reent > to keep the structure layout. Make _REENT_GLOBAL_ATEXIT the default and > remove > this option. > > v2: > > * Rename --enable-newlib-backward-binary-compat in > --enable-newlib-reent-binary-compat. > > * Do not enable option for Cygwin. > > * Adjust code in libgloss. > > Sebastian Huber (6): > Add --enable-newlib-reent-binary-compat > Optional struct _reent::__unused_sdidinit > Optional struct _reent::_unspecified_locale_info > Optional struct _reent::_new::_unused > Optional struct _reent::_new::_reent::_unused_rand > Use global atexit data for all configurations > > libgloss/arc/crt0.S | 11 +++-- > libgloss/epiphany/crt0.S | 26 +++++----- > libgloss/sparc_leon/locore_atexit.c | 4 +- > newlib/README | 12 ++--- > newlib/configure | 30 ++++++++---- > newlib/configure.ac | 25 +++++++--- > newlib/libc/include/sys/config.h | 7 ++- > newlib/libc/include/sys/reent.h | 74 +++++++++++++++++------------ > newlib/libc/reent/reent.c | 19 -------- > newlib/libc/stdlib/__atexit.c | 15 ++---- > newlib/libc/stdlib/__call_atexit.c | 8 ++-- > newlib/newlib.hin | 6 +-- > 12 files changed, 125 insertions(+), 112 deletions(-) > > -- > 2.35.3 > > >