From owner-freebsd-ports@FreeBSD.ORG Wed Jun 26 20:59:26 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 B051B1F8; Wed, 26 Jun 2013 20:59:26 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:7b8:3a7:1:2d0:b7ff:fea0:8c26]) by mx1.freebsd.org (Postfix) with ESMTP id 754581C8A; Wed, 26 Jun 2013 20:59:26 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7::acbc:c165:3b28:a78a] (unknown [IPv6:2001:7b8:3a7:0:acbc:c165:3b28:a78a]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 554675C43; Wed, 26 Jun 2013 22:59:23 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) Subject: Re: Global destructor order problems (was: Re: Are ports supposed to build and run on 10-CURRENT?) From: Dimitry Andric In-Reply-To: <20130626204521.GU91021@kib.kiev.ua> Date: Wed, 26 Jun 2013 22:59:24 +0200 Content-Transfer-Encoding: 7bit Message-Id: <6900C006-2A57-4EAF-B19A-629A85CBA001@FreeBSD.org> 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> To: Konstantin Belousov X-Mailer: Apple Mail (2.1508) 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 20:59:26 -0000 On Jun 26, 2013, at 22:45, Konstantin Belousov wrote: > 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. 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. -Dimitry