Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Jul 2018 12:15:50 -0700
From:      John Baldwin <jhb@FreeBSD.org>
To:        Dimitry Andric <dim@FreeBSD.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r336227 - head/contrib/llvm/tools/clang/lib/Driver/ToolChains
Message-ID:  <a7e1a862-578b-ec75-7428-1a73f661851b@FreeBSD.org>
In-Reply-To: <201807121903.w6CJ30Fv023199@repo.freebsd.org>
References:  <201807121903.w6CJ30Fv023199@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?a7e1a862-578b-ec75-7428-1a73f661851b>