From owner-svn-src-head@freebsd.org Thu Jul 12 19:15:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0BFD103890C; Thu, 12 Jul 2018 19:15:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 87CB67A98D; Thu, 12 Jul 2018 19:15:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-2.local (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id 5980110A87D; Thu, 12 Jul 2018 15:15:51 -0400 (EDT) Subject: Re: svn commit: r336227 - head/contrib/llvm/tools/clang/lib/Driver/ToolChains To: Dimitry Andric , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201807121903.w6CJ30Fv023199@repo.freebsd.org> From: John Baldwin Message-ID: Date: Thu, 12 Jul 2018 12:15:50 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <201807121903.w6CJ30Fv023199@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Thu, 12 Jul 2018 15:15:51 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jul 2018 19:15:59 -0000 On 7/12/18 12:03 PM, Dimitry Andric wrote: > Author: dim > Date: Thu Jul 12 19:02:59 2018 > New Revision: 336227 > URL: https://svnweb.freebsd.org/changeset/base/336227 > > Log: > Pull in r336008 from upstream clang trunk: > > Request init/fini array on FreeBSD 12 and later > > Summary: > > It seems a bad idea to change the default in the middle of a release > branch due to possible changes in global ctor / dtor ordering between > .ctors and .init_array. With FreeBSD 11.0's release imminent lets > change the default now for FreeBSD 12 (the current development > stream) and later. > > FreeBSD rtld has supported .init_array / .fini_array for many years. > As of Jan 1 2017 all supported FreeBSD releases and branches will > have support. > > Reviewers: dim, brooks, arichardson > > Reviewed By: dim, brooks, arichardson > > Subscribers: bsdjhb, krytarowski, emaste, cfe-commits > > Differential Revision: https://reviews.llvm.org/D24867 > > Requested by: jhb > MFC after: 3 days I think that this is a flag day for 12 (and I wanted to get this in sooner rather than later so we can test it). I changed the external GCC ports to use init_array and fini_array earlier this week. I think lang/gcc* still need to be updated to enable it for 12.x and later. As long as a single executable or shared library is only using one of .ctors/.dtors vs init_array/fini_array I believe mixing them in a single process will be ok as the order of constructors and destructors doesn't change. I think you can only get into a bind if you mix old and new .o files into a single executable or shared library (and even then I don't think constructor order across different object files is really defined anyway, but I'm not sure if LTO might be affected in some way if you try to mix them). -- John Baldwin