Re: svn commit: r336227 - head/contrib/llvm/tools/clang/lib/Driver/ToolChains

2018-07-12 Thread John Baldwin
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
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r336227 - head/contrib/llvm/tools/clang/lib/Driver/ToolChains

2018-07-12 Thread Dimitry Andric
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

Modified:
  head/contrib/llvm/tools/clang/lib/Driver/ToolChains/Gnu.cpp

Modified: head/contrib/llvm/tools/clang/lib/Driver/ToolChains/Gnu.cpp
==
--- head/contrib/llvm/tools/clang/lib/Driver/ToolChains/Gnu.cpp Thu Jul 12 
18:48:53 2018(r336226)
+++ head/contrib/llvm/tools/clang/lib/Driver/ToolChains/Gnu.cpp Thu Jul 12 
19:02:59 2018(r336227)
@@ -2375,6 +2375,8 @@ void Generic_ELF::addClangTargetOptions(const ArgList 
   bool UseInitArrayDefault =
   getTriple().getArch() == llvm::Triple::aarch64 ||
   getTriple().getArch() == llvm::Triple::aarch64_be ||
+  (getTriple().getOS() == llvm::Triple::FreeBSD &&
+   getTriple().getOSMajorVersion() >= 12) ||
   (getTriple().getOS() == llvm::Triple::Linux &&
((!GCCInstallation.isValid() || !V.isOlderThan(4, 7, 0)) ||
 getTriple().isAndroid())) ||
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"