From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19042 invoked by alias); 22 Nov 2011 20:23:27 -0000 Received: (qmail 19034 invoked by uid 22791); 22 Nov 2011 20:23:26 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-ww0-f43.google.com (HELO mail-ww0-f43.google.com) (74.125.82.43) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 22 Nov 2011 20:23:12 +0000 Received: by wwo1 with SMTP id 1so559356wwo.12 for ; Tue, 22 Nov 2011 12:23:11 -0800 (PST) Received: by 10.227.197.10 with SMTP id ei10mr13102263wbb.9.1321993391087; Tue, 22 Nov 2011 12:23:11 -0800 (PST) MIME-Version: 1.0 Received: by 10.180.82.2 with HTTP; Tue, 22 Nov 2011 12:22:50 -0800 (PST) In-Reply-To: <4ECB872F.8010101@linaro.org> References: <4ECB872F.8010101@linaro.org> From: Michael Hope Date: Tue, 22 Nov 2011 20:23:00 -0000 Message-ID: Subject: Re: [PATCH] libc/newlib: Add optspace config for newlib To: Zhenqiang Chen Cc: yann.morin.1998@anciens.enib.fr, crossgcc@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact crossgcc-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: crossgcc-owner@sourceware.org X-SW-Source: 2011-11/txt/msg00136.txt.bz2 On Wed, Nov 23, 2011 at 12:27 AM, Zhenqiang Chen wrote: > # HG changeset patch > # User Zhenqiang Chen > # Date 1321942694 -28800 > # Node ID b28457252771ed67373226ced85317a6c03aac74 > # Parent =A0a6c68712024f406df7d2da4af377f51982615833 > libc/newlib: Add LIBC_NEWLIB_ENABLE_TARGET_OPTSPACE (-Os) other than -O to > control CFLAGS. > > Reviewed-by: Michael Hope > Signed-off-by: Zhenqiang Chen > > diff --git a/config/libc/newlib.in.2 b/config/libc/newlib.in.2 > --- a/config/libc/newlib.in.2 > +++ b/config/libc/newlib.in.2 > @@ -35,3 +35,11 @@ > =A0 =A0 =A0 =A0 =A0_write... If you plan to port newlib to a new > =A0 =A0 =A0 =A0 =A0platform/board, say Yes. > > +config LIBC_NEWLIB_ENABLE_TARGET_OPTSPACE > + =A0 =A0bool > + =A0 =A0prompt "Optimize newlib for size" > + =A0 =A0default y > + =A0 =A0help > + =A0 =A0 =A0Pass --enable-target-optspace to newlib configure. > + > + =A0 =A0 =A0This will compile newlib with -Os. > diff --git a/scripts/build/libc/newlib.sh b/scripts/build/libc/newlib.sh > --- a/scripts/build/libc/newlib.sh > +++ b/scripts/build/libc/newlib.sh > @@ -85,6 +85,8 @@ > =A0 =A0 =A0 =A0 newlib_opts+=3D( "--enable-newlib-supplied-syscalls" ) > =A0 =A0 fi > > + =A0 =A0[ "${CT_LIBC_NEWLIB_ENABLE_TARGET_OPTSPACE}" =3D "y" ] && > newlib_opts+=3D("--enable-target-optspace") > + > =A0 =A0 # Note: newlib handles the build/host/target a little bit differe= ntly > =A0 =A0 # than one would expect: > =A0 =A0 # =A0 build =A0: not used A question for the list: there's already a 'Optimise the GCC runtime libraries for space' option. Should it be promoted to something like CT_ENABLE_TARGET_OPTSPACE and apply to all target libraries? How you you handle backwards compatibility of config files? I have a similar problem with CC_STATIC_LIBSTDCXX. GOLD is written in C++ and really needs to have libstdc++ statically linked into it. I'm thinking of sending a patch that promotes CT_CC_STATIC_LIBSTDCXX to CT_STATIC_LIBSTDCXX and uses it everywhere. -- Michael -- For unsubscribe information see http://sourceware.org/lists.html#faq