From owner-freebsd-ports@FreeBSD.ORG Wed Jun 26 21:05:41 2013 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CE0D85C0; Wed, 26 Jun 2013 21:05:41 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id 6F6931CF9; Wed, 26 Jun 2013 21:05:41 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.7/8.14.7) with ESMTP id r5QL5Y4c081292; Thu, 27 Jun 2013 00:05:34 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua r5QL5Y4c081292 Received: (from kostik@localhost) by tom.home (8.14.7/8.14.7/Submit) id r5QL5YUe081291; Thu, 27 Jun 2013 00:05:34 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 27 Jun 2013 00:05:34 +0300 From: Konstantin Belousov To: Dimitry Andric Subject: Re: Global destructor order problems (was: Re: Are ports supposed to build and run on 10-CURRENT?) Message-ID: <20130626210534.GY91021@kib.kiev.ua> References: <20130613031535.4087d7f9@bsd64.grem.de> <20130626015508.426ab5b9@bsd64.grem.de> <51CAADB8.7090603@FreeBSD.org> <20130626133149.4835f14a@bsd64.grem.de> <7CD9075C-F8D6-41C1-8D21-8B10DF866ECE@FreeBSD.org> <20130626204521.GU91021@kib.kiev.ua> <6900C006-2A57-4EAF-B19A-629A85CBA001@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="zeTRWudynWXPpCJH" Content-Disposition: inline In-Reply-To: <6900C006-2A57-4EAF-B19A-629A85CBA001@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: Matthias Andree , Brooks Davis , David Chisnall , "freebsd-ports@freebsd.org Ports" , Michael Gmelin X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jun 2013 21:05:42 -0000 --zeTRWudynWXPpCJH Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jun 26, 2013 at 10:59:24PM +0200, Dimitry Andric wrote: > On Jun 26, 2013, at 22:45, Konstantin Belousov wrot= e: > > On Wed, Jun 26, 2013 at 09:26:09PM +0200, Dimitry Andric wrote: > >> This revision is not in 9.1-RELEASE, but it is in 9-STABLE, so the > >> problem can also be reproduced there. > > ... > >> This is roughly gcc 4.3.0 and later. For example, gcc 4.8 generates: > > I just tested the thing with gcc 4.8 on up to date stable/9 and HEAD. > > In both cases, major tom did not fail, at least not in the peculiar way. > > The gcc-generated code passed the PLT address of the corresponding > > destructor. >=20 > That is strange, did you compile the main program with -fPIC? That is > the problem case. If you don't compile the main program with -fPIC, the > problem will indeed not occur. I just used the Makefile provided by the earlier message, and it contains the -fPIC flag (which is strange thing to do on its own, binaries should use -fPIE). This is how the registration for the outer dtr looks for me, gcc 4.8.1/i386: 0x08048763 <+42>: call 0x8048520 <_ZN5OuterC1Ev@plt> 0x08048768 <+47>: lea 0x28(%ebx),%eax 0x0804876e <+53>: mov %eax,0x8(%esp) 0x08048772 <+57>: lea 0x34(%ebx),%eax 0x08048778 <+63>: mov %eax,0x4(%esp) 0x0804877c <+67>: mov -0x4(%ebx),%eax 0x08048782 <+73>: mov %eax,(%esp) 0x08048785 <+76>: call 0x8048500 <__cxa_atexit@plt> ebx was set up earlier as the GOT pointer. --zeTRWudynWXPpCJH Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iQIcBAEBAgAGBQJRy1edAAoJEJDCuSvBvK1BH/4P/0Z+2ketTUTOBdnYOaV4TK0h WzYpZc6u5sAKjU0JL+qeccJj83ejMPQP/tKpHQTSwbUGpp3IgX+jCysAcxCBjXnv QBbMBP9em7sx50VTaoMvyfvNiVMv8EzBzJ2bofEfZsqXs71h6y7OML9N+Be5fz1V FHIlcf12fncAtTCxpgQl50lGLoZV7fWH7coDxmPZp2NOVgunH+v/LcQBHzC7hLpd qiZRZPNZcka9AAf/bERbxpV8HXPNOeteExnuS96Inu/qpo7H6XvC4sA2+vp0J85n 4GFrnkOg27pJAQcQJN5CksnFPFqDfG5YKSksEyEWB0ll/ZNIEhw1pXDQs8Q4AGP7 Ea8FfvHJkEI/WKUsRIH1usuz45Ipp/QdIsSF0DvShyoRNsTOuA+eW66NlOD92Yb8 sJqy0OxHu186ZJyKq3jfPVsvj3cSnkn5FhLEwoG+e3DlCLyQk6UMbrTOARAuxYd/ UHti0GsIjWn41vk34I2QlyIo+sOHDpYbUvRoKmsJ5LjDuAxO8oHjPmwnMlq9uY+u YWpl3jEKkgv9HKKYwYQKVf4qfjrKfUfC0er4P6jeY43trqJfVRDDs+5FDkeeGR4k POdNKk9mZRuM+eWunrAfrpF2gzsLNf11IdCi8V8D6zm23nYEhV5WzUFNtUUJJVmt B02/fGUJ1MaWetPgSUQ1 =5vJk -----END PGP SIGNATURE----- --zeTRWudynWXPpCJH--