From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23958 invoked by alias); 17 May 2010 17:57:41 -0000 Received: (qmail 23945 invoked by uid 22791); 17 May 2010 17:57:40 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from moene.org (HELO moene.org) (82.95.66.103) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 17 May 2010 17:57:35 +0000 Received: from [127.0.0.1] (ident=toon) by moene.org with esmtp (Exim 4.71) (envelope-from ) id 1OE4ZH-00065K-Nt; Mon, 17 May 2010 19:57:31 +0200 Message-ID: <4BF1838B.2090603@moene.org> Date: Mon, 17 May 2010 17:57:00 -0000 From: Toon Moene User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100411 Icedove/3.0.4 MIME-Version: 1.0 To: Dave Korn CC: "gcc@gcc.gnu.org" Subject: Re: Does `-fwhole-program' make sense when compiling shared libraries? References: <4BF1861F.5020406@gmail.com> In-Reply-To: <4BF1861F.5020406@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2010-05/txt/msg00306.txt.bz2 On 05/17/2010 08:08 PM, Dave Korn wrote: > > Hi! > > PR42904 is a bug where, when compiling a windows DLL using -fwhole-program, > the compiler optimises away the entire library body, because there's no > dependency chain related to 'main' to anchor it. Aren't "shared library" and "whole program" mutually exclusive concepts ? The mere fact that you are building a library means that it cannot be the whole program, and because a shared library cannot be determined to have being used by any fixed program, by definition cannot be "the whole program". Or so I'd think. Kind regards, -- Toon Moene - e-mail: toon@moene.org - phone: +31 346 214290 Saturnushof 14, 3738 XG Maartensdijk, The Netherlands At home: http://moene.org/~toon/; weather: http://moene.org/~hirlam/ Progress of GNU Fortran: http://gcc.gnu.org/gcc-4.5/changes.html#Fortran