From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 108270 invoked by alias); 20 Jul 2017 14:19:35 -0000 Mailing-List: contact newlib-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: newlib-owner@sourceware.org Received: (qmail 108257 invoked by uid 89); 20 Jul 2017 14:19:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 20 Jul 2017 14:19:32 +0000 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 264007A16A for ; Thu, 20 Jul 2017 14:19:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 264007A16A Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=vinschen@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 264007A16A Received: from calimero.vinschen.de (ovpn-116-16.ams2.redhat.com [10.36.116.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id E53C018236 for ; Thu, 20 Jul 2017 14:19:30 +0000 (UTC) Received: by calimero.vinschen.de (Postfix, from userid 500) id 52CCFA806DB; Thu, 20 Jul 2017 16:19:30 +0200 (CEST) Date: Thu, 20 Jul 2017 14:19:00 -0000 From: Corinna Vinschen To: newlib@sourceware.org Subject: Re: [PATCH][MSP430] MSP430: Define __BUFSIZ__ as 256 to prevent default of 1024 being used Message-ID: <20170720141930.GB19395@calimero.vinschen.de> Reply-To: newlib@sourceware.org Mail-Followup-To: newlib@sourceware.org References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="0F1p//8PRICkK4MW" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.8.3 (2017-05-23) X-SW-Source: 2017/txt/msg00609.txt.bz2 --0F1p//8PRICkK4MW Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 1292 On Jul 19 19:01, Jozef Lawrynowicz wrote: > Many MSP430 devices have a very small amount of RAM (the MSP430FR5969 > has 2kB). A simple "Hello World" printf program built for one of these > devices will not execute properly as stack and heap collide before > output is printed. > About 1.5kB of heap is allocated to do the printf, but reducing > __BUFSIZ__ to 256 brings this to around 750 bytes, and the hello world > program comfortably executes on hardware. >=20 > Patch is attached. > From 7ba27bcfe2fbbc66d07c7f85062d7050b6381fcb Mon Sep 17 00:00:00 2001 > From: Jozef Lawrynowicz > Date: Mon, 10 Jul 2017 17:19:00 +0000 > Subject: [PATCH] MSP430: Define __BUFSIZ__ as 256 to prevent default of 1= 024 > being used >=20 > --- > newlib/libc/include/sys/config.h | 1 + > 1 file changed, 1 insertion(+) >=20 > diff --git a/newlib/libc/include/sys/config.h b/newlib/libc/include/sys/c= onfig.h > index c536698..39f8384 100644 > --- a/newlib/libc/include/sys/config.h > +++ b/newlib/libc/include/sys/config.h > @@ -155,6 +155,7 @@ > #define _REENT_SMALL > #endif >=20=20 > +#define __BUFSIZ__ 256 > #define __SMALL_BITFIELDS >=20=20 > #ifdef __MSP430X_LARGE__ > --=20 > 1.8.3.1 >=20 Pushed. Thanks, Corinna --=20 Corinna Vinschen Cygwin Maintainer Red Hat --0F1p//8PRICkK4MW Content-Type: application/pgp-signature; name="signature.asc" Content-length: 819 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJZcLvyAAoJEPU2Bp2uRE+gwf4P/3ixIl0JGVI0EF8hmLJ+GtCE 4XohVMO/NZIgzaSj9nkKhk5Xio/Rq1kO1zLlkfd8lSGf+iBvlRiDiJN4MPdzCefL Nk5FE0pmNjsLgLYRF+FyGQbhK9P5H7YvWsnsNiHpbm1B7QPTe6PNOdSEbD/T1GKj LFsBaNu8OuJuXxi2RhDQbBzCuiWlqpD5CeI/ZVAFNnT55djXpOuDMa8kxYXOYSzF LbGXwMQBqDDGvv8Lucreyk5CKgfn9HS0EEv/osNA+xc4CtBemAmulzafbZbwVgft CPu/zMJ47fqSWg3mxHQ/96eSUy1cqgkOMsctm8d+qJVoligUYGld4FGm9M1/J2mj vrbiqx+ld45I3UBZOq9ksIjz1+4VTPqD1g0WXLw7oXvuGtFliEaV7jcxC1LwyFBY yBQRBRLQ+Xib/wpIK5sLu0nz+rPtjYfcx7/hUjJTpLPdE6jeiFdMZvB93CHUSVus IGeNp/SP0OPdLU6Hum9iw4N4gy5TFXV0v1/IMZWFGeinwbpPWsr56NoDZacWYmPB hsijZ6UmI66qF6PjQjELYFmEADz1epdczNaGG8ZnH4XMnj/TJ/GZqQFMw9Uo9bb8 q+BbyLe1PwzVyg6UHbTGVOfp2U/52mkh+Z7CsL1z5wFdOtdzOFDEyBXXska8VN3d 1Ga6NoN5LNR8xOwLM5C6 =nsD6 -----END PGP SIGNATURE----- --0F1p//8PRICkK4MW--