From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 11 23:12:50 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D655237B404 for ; Fri, 11 Apr 2003 23:12:50 -0700 (PDT) Received: from cecov.masternet.it (cecov.masternet.it [194.184.65.7]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4391A43FBF for ; Fri, 11 Apr 2003 23:12:49 -0700 (PDT) (envelope-from gmarco@scotty.masternet.it) Received: from usul.scotty.masternet.it (freebsd.giovannelli.com [194.184.65.139]) by cecov.masternet.it (8.12.9/8.12.9) with ESMTP id h3C6Cr0Y063972; Sat, 12 Apr 2003 08:12:53 +0200 (CEST) (envelope-from gmarco@scotty.masternet.it) Message-Id: <5.2.0.9.2.20030412080941.016d0978@194.184.65.7> X-Sender: gmarco@194.184.65.7 (Unverified) X-Mailer: QUALCOMM Windows Eudora Version 5.2.0.9 Date: Sat, 12 Apr 2003 08:14:16 +0200 To: "M. Warner Losh" From: Gianmarco Giovannelli In-Reply-To: <20030411.230438.53067150.imp@bsdimp.com> References: <5.2.0.9.2.20030411223601.053eaeb8@194.184.65.7> <5.2.0.9.2.20030411082040.02604e90@194.184.65.4> <20030411140738.GA40724@ussenterprise.ufp.org> <5.2.0.9.2.20030411223601.053eaeb8@194.184.65.7> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed cc: hackers@freebsd.org Subject: Re: gcc iussue or ... ? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Apr 2003 06:12:51 -0000 At 11/04/2003, you wrote: >In message: <5.2.0.9.2.20030411223601.053eaeb8@194.184.65.7> > Gianmarco Giovannelli writes: >: At 11/04/2003, Leo Bicknell wrote: >: >In a message written on Fri, Apr 11, 2003 at 08:41:37AM +0200, Gianmarco >: >Giovannelli wrote: >: > > The problem is that if I compile it under FreeBSD it is a binary of 19M, >: > > while on linux (debian 3.0), same Makefile, is only 2MB. FreeBSD 5.0 and >: > > OpenBSD 3.1 produce the (about) 19M file. >: > >: >Well, the problem location is fairly obvious: >: > >: >% ls -lags | sort -nr | more >: >19416 -rwxr-xr-x 1 bicknell wheel 19854956 Apr 11 09:49 lonewolf* >: >16912 -rw-r--r-- 1 bicknell wheel 17286792 Apr 11 09:42 globals.o >: > 368 -rw-r--r-- 1 bicknell wheel 365140 Apr 11 09:46 npcinfo.o >: > 304 -rw-r--r-- 1 bicknell wheel 301100 Apr 11 09:47 targeting.o >: > 272 -rw-r--r-- 1 bicknell wheel 267648 Apr 11 09:48 virtues.o >: >[etc] >: > >: >A quick nm --size-sort globals.o | tail shows: >: > >: >00009b80 D ownsp >: >00009b80 D spawnsp >: >000138a0 D location >: >00111020 D region >: >002180a0 D buffer >: >002190a0 D PacketFetcher >: >01061710 D PacketSender >: >01061778 D cwrap >: >010617f0 D w_anim >: >01061850 D wp_version >: > >: >buffer, for instance appears to be 129 * 17000 = 2193000, a 2M >: >buffer, and nm shows 2195616 bytes. >: > >: >I can't track down quickly why the others are so big, but I suspect you >: >may be making them bigger than you expected. It could also be that >: >FreeBSD puts some types of globals in the executable to load, where as >: >Linux puts them in some zero filled pages or something, I don't know >: >enough to know for sure. Either way, you probably want to make the >: >data smaller, or dynamically allocate it to make sure you don't run >: >into this on any platform. >: >: The problem is that both the system start from _equals_ conditions (gcc >: version, Makefiles and so on). >: I'd like to understand way they generate different (and very different) exe >: file... > >Since you haven't given us the output of the make build, we can't tell >that for sure. Equal makefiles might give slightly different results. > >Also, the items in 'D', why are they in data section rather than bss >section. That's likely a large part of the problem. Can you share >the definition of buffer? Hi Warner, first of all thanks for your reply. My skills in g++ programming (as in other fields as well :-) are very limited . The only help I can give you is where the sources are (they are very small and you can easily build with make -f Makefile.unix) : http://games.gimbo.org/uo/binaries.pl or if you prefer a short way: http://games.gimbo.org/uo/files/bin/lonewolf/cvs_src.tgz If you can help in trace down this hacks it will be wonderfull :-) Thanks again. Best Regards, Gianmarco Giovannelli , "Unix expert since yesterday" http://www.gufi.org/~gmarco