From owner-freebsd-hackers@FreeBSD.ORG Sat Apr 12 13:39:03 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 8F9D337B401 for ; Sat, 12 Apr 2003 13:39:03 -0700 (PDT) Received: from cecov.masternet.it (cecov.masternet.it [194.184.65.7]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7235243F93 for ; Sat, 12 Apr 2003 13:39:02 -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 h3CKd30Y066601; Sat, 12 Apr 2003 22:39:03 +0200 (CEST) (envelope-from gmarco@scotty.masternet.it) Message-Id: <5.2.0.9.2.20030412223502.053e0488@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 22:40:28 +0200 To: John Polstra From: Gianmarco Giovannelli In-Reply-To: <200304121840.h3CIes21072549@strings.polstra.com> References: <5.2.0.9.2.20030412071716.0257aeb8@194.184.65.7> <3E972F3E.8E86140E@mindspring.com> <5.2.0.9.2.20030411221904.011c5ec8@194.184.65.4> <3E972F3E.8E86140E@mindspring.com> <5.2.0.9.2.20030412071716.0257aeb8@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 20:39:03 -0000 At 12/04/2003, you wrote: > > So the point is why Linux/mingw have a lot of things in bss while 4.8 > (with > > the same gcc of linux debian 3.0 and 5.0 with the same gcc 3.2.1 of mingw) > > put them in Data ? > >Maybe Linux is using the "-fconserve-space" g++ option. From the >info pages: > >`-fconserve-space' > Put uninitialized or runtime-initialized global variables into the > common segment, as C does. This saves space in the executable at > the cost of not diagnosing duplicate definitions. If you compile > with this flag and your program mysteriously crashes after > `main()' has completed, you may have an object that is being > destroyed twice because two definitions were merged. > > This option is no longer useful on most targets, now that support > has been added for putting variables into BSS without making them > common. > >That last paragraph suggests that maybe FreeBSD's compiler is >configured slightly wrong, such that it does not do what the >paragraph says. In any case, try adding this option to your >compiles on FreeBSD and see if it helps. This exactly solve the problem :-) The compilation is fine, the exe is now 2mb (like linux). /source_of_lonejoy/src# ll -h lonewolf -rwxr-xr-x 1 root wheel 2M Apr 12 22:24 lonewolf Using such lines in Makefile.unix: CFLAGS = -pipe -funsigned-char -fconserve-space -O -DNO_DEBUG CXXFLAGS= -pipe -funsigned-char -fconserve-space -O -DNO_DEBUG did the job. Now we have to understand why the Linux version of the same gcc doesn't need this option to make the exe so small :-) Thanks very much. Best Regards, Gianmarco Giovannelli , "Unix expert since yesterday" http://www.gufi.org/~gmarco