From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) by sourceware.org (Postfix) with ESMTP id F2CF33857C51 for ; Wed, 9 Mar 2022 09:23:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org F2CF33857C51 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gentoo.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gentoo.org Received: by smtp.gentoo.org (Postfix, from userid 559) id 86FE4342CA2; Wed, 9 Mar 2022 09:23:39 +0000 (UTC) Date: Wed, 9 Mar 2022 04:23:45 -0500 From: Mike Frysinger To: newlib@sourceware.org Subject: Re: [PATCH 3/6] newlib: xstormy16: fix mallopt definition & mstats handling Message-ID: Mail-Followup-To: newlib@sourceware.org References: <20220302013623.368-1-vapier@gentoo.org> <20220302013623.368-4-vapier@gentoo.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="F2wSRZiy9YQHJBGL" Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Wed, 09 Mar 2022 09:23:41 -0000 --F2wSRZiy9YQHJBGL Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 02 Mar 2022 10:46, Corinna Vinschen wrote: > On Mar 1 20:36, Mike Frysinger wrote: > > The mallopt symbol is defined in tiny-malloc.c, not mallocr.c, but > > the Makefile in here tries to compile it out of the latter. This > > leads to mallopt never being defined. > >=20 > > The build also creates mallinfo.o & mallopt.o & mallstats.o objects > > to override common ones, but the common dir doesn't use these names. > > Instead, it places these all in mstats.o. > >=20 > > So move the build define logic to a dedicated file and compile it > > directly to make things a bit simpler while fixing the missing func > > and aligning objects with the cmomon code. > > --- > > newlib/libc/machine/xstormy16/Makefile.am | 15 ++-------- > > newlib/libc/machine/xstormy16/Makefile.in | 36 +++++++++++++---------- > > newlib/libc/machine/xstormy16/mstats.c | 6 ++++ > > 3 files changed, 29 insertions(+), 28 deletions(-) > > create mode 100644 newlib/libc/machine/xstormy16/mstats.c > > [...] > > diff --git a/newlib/libc/machine/xstormy16/mstats.c b/newlib/libc/machi= ne/xstormy16/mstats.c > > new file mode 100644 > > index 000000000000..1bd24da555f1 > > --- /dev/null > > +++ b/newlib/libc/machine/xstormy16/mstats.c > > @@ -0,0 +1,6 @@ > > +/* stdlib/mstats.c defines all these symbols in this file. > > + TODO: Missing mstats function. */ > > +#define DEFINE_MALLINFO > > +#define DEFINE_MALLOC_STATS > > +#define DEFINE_MALLOPT > > +#include "tiny-malloc.c" >=20 > XStormy16 is such a small target, it would be better to split these into > three files. it must be really tiny if we need to micro manage this. 152 0 0 152 98 lib_a-mallinfo.o 274 0 0 274 112 lib_a-mallstats.o 4 0 0 4 4 lib_a-mallopt.o the only way they'd get pulled in is if one func is used, so if code called mallopt() but not mallinfo() or malloc_stats(), it would waste 426 bytes. the point of this change is to align xstormy16 with how common code is laid out. are you suggesting we split the common mstats.c too ? it wouldn't be hard as that file is pretty small. -mike --F2wSRZiy9YQHJBGL Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEuQK1JxMl+JKsJRrUQWM7n+g39YEFAmIociEACgkQQWM7n+g3 9YH3SQ//YVT/wdOmOmJF1lyMDI1mDySQtvUYfJ+LomNc+voRsazcuiNIF8DsFu3Q DVzehFEvkHl+arRKNtzsBFz+9IIVRhB3Fw9moK+2UX14P/nE6XaQ+46ZykDigqb1 w4aVEGMhMEY24ztmWXkrwmOvs1c1YgLFO53Xty+tMoh//wo77O+2wHWTsszyHijr vP4V0FixI5yJ3AYy1eAEB6svguYJmtd6ANBx+0pt5R/eMWIHNnP334tI27u5S3NE RaKJWXLHbm3bcwsTOSdL6GU6sfCJzKgHDBvcHgxYla/Fr+gIeGkdlu9Jh/FyXzdu T5ruQjcB5gBKS9c8ai6saXVC+IUEL3WtMC4/mbGoRZOcARmVQAYVX0n268D8B7Jk YAU0wbkyYMIEZ25OUH4Pfp2wEoyK3+GJRsBB//KqM/QvBpodQfPQiuROIrcDegDi h3QW3EbI0Id5KUS9r5FKpaQWMrCxWEfnJthW5/EYv6V5hAGbN1A5eM3jF5FEzn9d sjr57h04j9nTMYHvbZGrsaGHs7jtXD3HJTkZ05TzwPnzFTbO0uJ73X6+FWCbsgcg yO5FNKBzrduK8iEIygfZTBIukjYbmdlNQuyj62VtNqbeDgkSSduHdirEBxjdw86j PUWsJ5d1H4covxGkl/wATUVpqFK34RatP9Czyujnv+4xcU6ryS0= =gTrt -----END PGP SIGNATURE----- --F2wSRZiy9YQHJBGL--