delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/05/16/11:45:39

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <3EC50777.5060200@oc.uni-kiel.de>
Date: Fri, 16 May 2003 17:44:55 +0200
From: =?ISO-8859-1?Q?Felix_K=F6hler?= <fkoehler AT oc DOT uni-kiel DOT de>
Reply-To: cygwin AT cygwin DOT com, fkoehler AT oc DOT uni-kiel DOT de
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4b) Gecko/20030507
X-Accept-Language: de, en-us, en
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Problem with g++ creating huge binaries
X-Virus-Scanned: by AMaViS perl-11 (Uni-Kiel/tms)

Hello everybody,

I would like to ask for some advice considering a compiling issue. When 
compiling a C++ program that contains STL headers, cygwin g++ seems to 
produce overly bloated code, compared to the same version of g++ (3.2) 
on other (Linux) plattforms or other compilers (Microsoft Visual C++). 
E.g. the following "hello world" program.:

#include <iostream>
int main () { std::cout << "Hello, world!!" << std::endl; return 0; }

Compiled with the command line:
g++ -O2 -Wl,-s hello.cpp -o hello_cpp
produces hello_cpp binaries of the size:
Linux (gcc version 3.2)                                          : 
3.756      Bytes
Cygwin (gcc version 3.2 20020927 (prerelease))   : 219.136  Bytes
MSVC++ 7.0                                                       : ca. 
3000 Bytes (dont know exactly any more)

I think this issue has crept up before in this mailing list, but none of 
the advice given so far seems to apply to/ work with gcc 3.2. Strip.exe 
doesn't yield any effect as ld already stripped the executable (-Wl,-s 
option). This might not be that much of a problem when producing single 
large binaries or using pure C Code, but when having a big set of little 
C++ commandline tools the speed offset becomes noticable. I vaguely 
remember this is a problem with the Template headers which can't be put 
into a dll other than defining a set of heavily used instantiations that 
are put into a dll. To be of any value this probably would need to be a 
pretty firm feature for the cygwin distribution, so you can make this 
dll a prerequisite.

I'd like to ask if anybody has ever done something like that and the 
"feature-is-there-you-just-have-to-find-it" or whether it's planned by 
the compiler gurus or whether there are principal problems why this will 
never work.

Thanks for your attention,

Felix Koehler



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019