From owner-freebsd-stable Sat Oct 28 0:22:44 2000 Delivered-To: freebsd-stable@freebsd.org Received: from krycek.zoominternet.net (krycek.zoominternet.net [63.67.120.9]) by hub.freebsd.org (Postfix) with SMTP id 58F5A37B479 for ; Sat, 28 Oct 2000 00:22:42 -0700 (PDT) Received: (qmail 14356 invoked from network); 28 Oct 2000 07:21:24 -0000 Received: from lcl12.cvzoom.net (208.226.155.12) by krycek.zoominternet.net with SMTP; 28 Oct 2000 07:21:24 -0000 Date: Sat, 28 Oct 2000 03:22:37 -0400 (EDT) From: Donn Miller To: "Jeffrey J. Mountin" Cc: stable@FreeBSD.ORG Subject: Re: "Malloc type lacks magic" show-stopper solved In-Reply-To: <4.3.2.20001027114057.00b91100@207.227.119.2> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Fri, 27 Oct 2000, Jeffrey J. Mountin wrote: > At 02:24 AM 10/27/00 -0400, Donn Miller wrote: > What is interesting is that -march will produce a slightly larger binary > than -mcpu. Would expect the opposite, since the code is compiled to run > *only* on one CPU class with -march, rather than just a scheduling change. Well, I believe the "default" instruction set generated by gcc/gas is i386. If you specifify -march=486, you will get i386+i486 instructions generated, because i486 contains i386 instructions as a subset. But if one specifies gcc -march=pentium, you will get i586 instructions, which includes 586+486+386 machine code. I guess it depends on the code being compiled. If there is a case where the asm code can > Also should clarify in my previous message that using anything other than > -O (ie -Os or => -O2) with -march tends to make compiling problematic. I hear that. I think that the world+kernel should be compiled with nothing but -O. I've seen beta versions of gcc 2.96 bomb out with an "internal compiler error" when using -Os => -O3. It should be allowable to build kernel and world with -march=ARCH, though. Also, I consider gcc to be a mission-critical app, and I've noticed that when I built gcc with -Os, gcc sometimes develops some severe memory leaks that aren't there when you build gcc with -O. For example, when I built gcc with -Os, I ran out of swapspace when trying to build kdelibs-1.96. I believe the source file was dcop*.cpp or something or other. I didn't see this gcc memory leak after I rebuilt the world with -O. By all means, -O should be the only allowable flag for building world. Also, I compared building world with -Os and with -O. A world built with -O actually used slightly less disk space than with -Os. I think there are cases when -O3 is desirable, though. I built XFree86 with both -Os and -O3. The -Os version seemed significantly more sluggish than with -O3. -O3 seems the best choice for things like mpg123, xanim, and XFree86. -Os seems like it's more trouble than it's worth, as it doesn't really reduce the size of the executable significantly more than -O. Plus, the speed you gain from using -O probably far outweighs the little disk space/memory usage savings from -Os. - Donn To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message