From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18064 invoked by alias); 20 Jul 2011 20:53:42 -0000 Received: (qmail 18047 invoked by uid 22791); 20 Jul 2011 20:53:41 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from qmta14.emeryville.ca.mail.comcast.net (HELO qmta14.emeryville.ca.mail.comcast.net) (76.96.27.212) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 20 Jul 2011 20:53:22 +0000 Received: from omta15.emeryville.ca.mail.comcast.net ([76.96.30.71]) by qmta14.emeryville.ca.mail.comcast.net with comcast id ALsd1h0041Y3wxoAELtKE5; Wed, 20 Jul 2011 20:53:19 +0000 Received: from up.mrs.kithrup.com ([24.4.193.8]) by omta15.emeryville.ca.mail.comcast.net with comcast id ALt61h00s0BKwT48bLtBpR; Wed, 20 Jul 2011 20:53:13 +0000 Subject: Re: PATCH RFA: Build stages 2 and 3 with C++ Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Mike Stump In-Reply-To: Date: Wed, 20 Jul 2011 21:06:00 -0000 Cc: David Edelsohn , gcc-patches@gcc.gnu.org, gcc@gcc.gnu.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <4E26E775.7070802@moene.org> To: Ian Lance Taylor 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: 2011-07/txt/msg00396.txt.bz2 On Jul 20, 2011, at 1:25 PM, Ian Lance Taylor wrote: > Interesting. I don't know why this doesn't happen on GNU/Linux. It doesn't happen as the symbols in question are local on linux. collect2 = runs nm on public symbols looking for symbols of a particular form, it then= builds two lists, one for constructors of global objects (simplistic view)= and one for destructors. a.out systems liked doing this sort of things as= well. On more modern OSes, the constructors and destructors hook into crt= code that can run per translation unit initializations, for example on elf= , one might use .init to achieve this. When one uses one of these more adv= anced features to hook into the OS, then the symbols no longer need to be p= ublic and the port is changed to make them non-public. > Presumably the fix will be to use -frandom-seed. But, the random seem was to ensure that things that should not collide, don= 't. If you use 0, then things that should not collide, eventually will and= your world with then end. In the present code base, it is perfectly safe = to do this. If the codebase is ever extended to use C++ features, then, th= at code can break.