From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10053 invoked by alias); 20 Dec 2002 18:16:04 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 10038 invoked by uid 71); 20 Dec 2002 18:16:03 -0000 Date: Fri, 20 Dec 2002 10:16:00 -0000 Message-ID: <20021220181603.10037.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Hal Black Subject: Re: c++/7769: using static libraries sometimes loses static initialization Reply-To: Hal Black X-SW-Source: 2002-12/txt/msg01110.txt.bz2 List-Id: The following reply was made to PR c++/7769; it has been noted by GNATS. From: Hal Black To: Wolfgang Bangerth Cc: gcc-bugs@gcc.gnu.org, gcc-gnats@gcc.gnu.org Subject: Re: c++/7769: using static libraries sometimes loses static initialization Date: Fri, 20 Dec 2002 13:04:55 -0500 Wolfgang Bangerth wrote: > On Thu, 19 Dec 2002, Hal Black wrote: > > >>> This is not a bug. When you want that a particular >>> object file (possibly within an archive) is pulled into you >>> executable for sure, then you have to reference an object >>> inside it. >> >>This is a bug. >>[...] >>Correct, the compiler is fine, it is the linker that is not working >>correctly under the circumstances described above. > > > This is just how Unix has worked forever. If you want that changed, file a > report with the binutils people, but I think this is just how it is. Obviously that is the way things should work with C-code - which Unix has been working with forver - since there are no constructors for C functions. However, this is a fallacious argument because C++ is newer than Unix, and doesn't follow C linker rules anyway: C++ needs a C++ linker, not a C linker. Anyway, the binutils seem to do pretty well with other C++ functionality, so I will write them. Thanks for the pointer.