From owner-freebsd-current@FreeBSD.ORG Wed May 25 02:54:27 2011 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8065F106566C; Wed, 25 May 2011 02:54:27 +0000 (UTC) (envelope-from lacombar@gmail.com) Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 3E1D58FC15; Wed, 25 May 2011 02:54:26 +0000 (UTC) Received: by iwn33 with SMTP id 33so9124594iwn.13 for ; Tue, 24 May 2011 19:54:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=8GKWcoye+qVNTInm0iNY03Nxtni+2qlIQq4xslTFYSk=; b=pPRcb+Cf+t0LmnQkWOsOhbAJRKIeTBqlJR0y2C+/Z1ooQ8k0a2TsVlh6CUaC3hImdM WV9cI4iqE/9ZNsERWnVquoV/uZFVuXdo0acp5irLUdE47Agi2XDU6gghxS++mtgAjQIe MjkJ/A8zZ/aQSJMxb+iZqzdlwX4N28gs1Jcc4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=esfgnod0LzLfOn3WxNEyvkOqhAuL4RPkukZ6QnkyRYEaYjcyNNYi3f5S1NKoPIg2Bv UhmhqrzTfazlVG3ifVHUJ1W4/GcTMnxlbDzFRHx+7qosF/RIUkzwj83olcqpDL+UiZse xvOJRcMcsHsPfDsQ/h7wf9L8o3gcoV47aEmKg= MIME-Version: 1.0 Received: by 10.42.220.202 with SMTP id hz10mr12406000icb.76.1306292066439; Tue, 24 May 2011 19:54:26 -0700 (PDT) Received: by 10.42.177.10 with HTTP; Tue, 24 May 2011 19:54:26 -0700 (PDT) In-Reply-To: <4DDC17E5.2020700@FreeBSD.org> References: <1306267772-31084-1-git-send-email-lacombar@gmail.com> <4DDC17E5.2020700@FreeBSD.org> Date: Tue, 24 May 2011 22:54:26 -0400 Message-ID: From: Arnaud Lacombe To: Dimitry Andric Content-Type: text/plain; charset=ISO-8859-1 Cc: current@freebsd.org Subject: Re: [PATCH] Fix CFLAGS overwrite by Makefile X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2011 02:54:27 -0000 Hi, On Tue, May 24, 2011 at 4:41 PM, Dimitry Andric wrote: > Besides, for space-constrained things like boot2, you > might not even be able to compile it when using non-standard settings, > since the code might grow too large. > About the size, let's get some number lib/libstand (library): (without -Os) text data bss CPUTYPE 139696 4861 4160 i386 143212 4861 4160 i486 142491 4861 4160 i586 146893 4861 4160 i686 147145 4861 4160 lib/libstand (library): (with -Os, only enabled on pc98) 90386 4472 4160 i386 90381 4472 4160 i486 90381 4472 4160 i586 90369 4472 4160 i686 90387 4472 4160 sys/boot/i386/btx/lib/crt0.o is not affected size-wise by any of the i[3456]86 CPUTYPE. sys/boot/i386/boot2/boot2.out: text data bss dec hex CPUTYPE 5024 29 1780 6833 1ab1 i386 5024 29 1780 6833 1ab1 i486 5024 29 1780 6833 1ab1 i586 5004 29 1780 6813 1a9d i686 5024 29 1780 6833 1ab1 sys/boot/i386/libi386 (library): text data bss CPUTYPE 36168 13970 18658 i386 37419 13970 18658 i486 37483 13970 18658 i586 40073 13970 18658 i686 40137 13970 18658 sys/boot/ficl (library): 58245 4711 0 i386 61215 4711 0 i486 61183 4711 0 i586 70787 4711 0 i686 70851 4711 0 and finally: sys/boot/i386/loader: 57853 556 452 i386 58755 556 452 i486 58783 556 452 i586 63631 556 452 i686 63695 556 452 So except for btx/crt0.o, the default setting generate the worst code size. - Arnaud ps: for static library and loader, I derived the total size as the sum of the size of the text/data/bss section of the member object using : size *.o | awk 'BEGIN {text=0; data=0; bss=0;}; {text+=$1; data+=$2; bss+=$3}; END {print text " " data " " bss " '$i'"}' where $i is the cpu type to test. make(1) is passed either CPUTYPE=$i for i in i[3456]86, or the empty string. The compiler used for the test is gcc, and it is the compiler build during a buildworld stage, in the tmp directory. ps2: this was only a compile test. No code has been ran.