From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id D67733858C2C for ; Thu, 10 Mar 2022 08:12:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D67733858C2C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1646899950; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references; bh=ABHeXk0lxMMRmBXQ7xnBj+t3o9MrHWBm0X4UHo98BiI=; b=jM2S9RtZO21Aw313MVNBtCuWPkUlrxWMs5s1ySE9jdx4RUEfFdYS9tIs7VSi1Gc2JYajIF pelkEjgK97T4DJxBskfFaAaY81VBhVJA8S5mYC7ghZAe9MjvxFzEy+WPwANJKcOkp8d8HN o6RHp9i3+CmIhFgenEbRtMfz+YLlxCg= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-594-3u3WDmyHOF6DEtWfs0yvjA-1; Thu, 10 Mar 2022 03:12:29 -0500 X-MC-Unique: 3u3WDmyHOF6DEtWfs0yvjA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 968B7800D55 for ; Thu, 10 Mar 2022 08:12:28 +0000 (UTC) Received: from calimero.vinschen.de (unknown [10.36.112.5]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 657F3519CB for ; Thu, 10 Mar 2022 08:12:28 +0000 (UTC) Received: by calimero.vinschen.de (Postfix, from userid 500) id D92F3A8076B; Thu, 10 Mar 2022 09:12:26 +0100 (CET) Date: Thu, 10 Mar 2022 09:12:26 +0100 From: Corinna Vinschen To: newlib@sourceware.org Subject: Re: [PATCH 3/6] newlib: xstormy16: fix mallopt definition & mstats handling Message-ID: Reply-To: newlib@sourceware.org Mail-Followup-To: newlib@sourceware.org References: <20220302013623.368-1-vapier@gentoo.org> <20220302013623.368-4-vapier@gentoo.org> MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=vinschen@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, 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: Thu, 10 Mar 2022 08:12:34 -0000 On Mar 9 04:23, Mike Frysinger wrote: > 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. > > > > > > 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. > > > > > > 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/machine/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" > > > > 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 Sebastian is right. Just leave it as is. GTG. Thx, Corinna