<div dir="ltr">On Mon, Sep 7, 2015 at 10:42 AM, Xan López <span dir="ltr"><<a href="mailto:xan@igalia.com" target="_blank">xan@igalia.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Mon, Sep 07, 2015 at 10:38:08AM -0700, Saleem Abdulrasool wrote:<br>
> The patch LGTM with a minor request for tweaking the commit message to have<br>
> the context about the fact that cxa_finalize.o never shipped, and so this<br>
> doesn't really cause any problems for older releases.<br>
<br>
</span>Right. Tried to explain a bit what's going on in the commit message,<br>
with a reference to the original commit that removed the flag.</blockquote><div><br></div><div>Thanks.  Would you like me to commit this on your behalf as well?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">
><br>
><br>
> > Xan<br>
> ><br>
> > On Mon, Sep 07, 2015 at 09:14:05AM -0700, Saleem Abdulrasool wrote:<br>
> > > On Mon, Sep 7, 2015 at 2:28 AM, Xan López <<a href="mailto:xan@igalia.com">xan@igalia.com</a>> wrote:<br>
> > ><br>
> > > > On Sat, Sep 05, 2015 at 12:25:28PM -0700, Saleem Abdulrasool wrote:<br>
> > > > > > Ping?<br>
> > > > > ><br>
> > > > ><br>
> > > > > Does this break with older Solaris releases?  How far back did this<br>
> > > > change<br>
> > > > > in Solaris?  The change itself should really be accompanied with a<br>
> > test.<br>
> > > ><br>
> > > > Hi,<br>
> > > ><br>
> > > > turns out I'm not really sure cxa_finalize.o was ever available on<br>
> > > > Solaris. The initial code for Solaris was pushed in 2012, but it was<br>
> > > > hardcoded to work on a pretty specific Solaris/x86 environment. One<br>
> > > > commit from that time is r151648, which claims -fno-cxa-atexit<br>
> > > > produces broken code and says they'll ship their own<br>
> > > > cxa_finalize.o. So it seems it was not available back then<br>
> > > > either. I've also seen commits in OpenSolaris from 2013 creating dummy<br>
> > > > cxa_finalize.o files so that clang will pass the bare minimum tests.<br>
> > > ><br>
> > ><br>
> > > That seems less than ideal.  If there seems to be no release of Solaris<br>
> > > with this mythical support file, it doesn't seem too terrible to just get<br>
> > > rid of it.<br>
> > ><br>
> > ><br>
> > > > Now that I'm slowly pushing changes to make clang/Solaris work again<br>
> > > > (it was totally broken) I've found this issue again. My patch allows<br>
> > > > me to compile clang with clang itself, and other simple C++ programs<br>
> > > > compile and work. So if there was a bug here it was either fixed or I<br>
> > > > have not found it yet. I'd say that we should probably fix whatever<br>
> > > > issue there is with -fno-cxa-atexit when it shows up instead of<br>
> > > > working around it, or maybe *actually* bundle an implementation for<br>
> > > > Solaris with clang itself? But suggestions are welcome.<br>
> > > ><br>
> > ><br>
> > > Okay, so, AIUI, no release ever contained this file, __cxa_exit isn't<br>
> > > provided, and that using -fno-cxa-exit does (and really should) works<br>
> > well<br>
> > > enough for non-trivial applications.<br>
> > ><br>
> > ><br>
> > > > Also, what kind of test would you have in mind for this?<br>
> > ><br>
> > ><br>
> > > That -fno-cxa-exit is included by the driver when compiling for Solaris.<br>
> > ><br>
> > ><br>
> > > ><br>
> > > > Xan<br>
> > > ><br>
> > > > ><br>
> > > > ><br>
> > > > > > > From 014ddb164689a3452b76f85079f213d607d07840 Mon Sep 17 00:00:00<br>
> > > > 2001<br>
> > > > > > > From: =?UTF-8?q?Xan=20L=C3=B3pez?= <<a href="mailto:xan@igalia.com">xan@igalia.com</a>><br>
> > > > > > > Date: Fri, 14 Aug 2015 11:36:56 +0200<br>
> > > > > > > Subject: [PATCH 2/4] [Solaris] Default to -fno-cxa-finalize<br>
> > > > > > ><br>
> > > > > > > There is no __cxa_finalize symbol available on recent Solaris OS<br>
> > > > > > > versions, so we need this flag to make non trivial C++ programs<br>
> > run.<br>
> > > > > > ><br>
> > > > > > > Also stop looking for cxa_finalize.o, since it won't be there.<br>
> > > > > > > ---<br>
> > > > > > >  lib/Driver/Tools.cpp | 9 +++------<br>
> > > > > > >  1 file changed, 3 insertions(+), 6 deletions(-)<br>
> > > > > > ><br>
> > > > > > > diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp<br>
> > > > > > > index b204961..cf01d7b 100644<br>
> > > > > > > --- a/lib/Driver/Tools.cpp<br>
> > > > > > > +++ b/lib/Driver/Tools.cpp<br>
> > > > > > > @@ -4506,8 +4506,9 @@ void Clang::ConstructJob(Compilation &C,<br>
> > const<br>
> > > > > > JobAction &JA,<br>
> > > > > > >    if (!Args.hasFlag(options::OPT_fuse_cxa_atexit,<br>
> > > > > > >                      options::OPT_fno_use_cxa_atexit,<br>
> > > > > > >                      !IsWindowsCygnus && !IsWindowsGNU &&<br>
> > > > > > > -                        getToolChain().getArch() !=<br>
> > > > > > llvm::Triple::hexagon &&<br>
> > > > > > > -                        getToolChain().getArch() !=<br>
> > > > > > llvm::Triple::xcore) ||<br>
> > > > > > > +                    getToolChain().getTriple().getOS() !=<br>
> > > > > > llvm::Triple::Solaris &&<br>
> > > > > > > +                    getToolChain().getArch() !=<br>
> > > > llvm::Triple::hexagon &&<br>
> > > > > > > +                    getToolChain().getArch() !=<br>
> > > > llvm::Triple::xcore) ||<br>
> > > > > > >        KernelOrKext)<br>
> > > > > > >      CmdArgs.push_back("-fno-use-cxa-atexit");<br>
> > > > > > ><br>
> > > > > > > @@ -6882,10 +6883,6 @@ void<br>
> > solaris::Linker::ConstructJob(Compilation<br>
> > > > > > &C, const JobAction &JA,<br>
> > > > > > ><br>
> > > > Args.MakeArgString(getToolChain().GetFilePath("values-Xa.o")));<br>
> > > > > > >      CmdArgs.push_back(<br>
> > > > > > ><br>
> > > > Args.MakeArgString(getToolChain().GetFilePath("crtbegin.o")));<br>
> > > > > > > -<br>
> > > > > > > -    if (getToolChain().getDriver().CCCIsCXX())<br>
> > > > > > > -      CmdArgs.push_back(<br>
> > > > > > > -<br>
> > > > > > Args.MakeArgString(getToolChain().GetFilePath("cxa_finalize.o")));<br>
> > > > > > >    }<br>
> > > > > > ><br>
> > > > > > >    const ToolChain::path_list &Paths =<br>
> > getToolChain().getFilePaths();<br>
> > > > > > > --<br>
> > > > > > > 2.4.3<br>
> > > > > > ><br>
> > > > > ><br>
> > > > > > > _______________________________________________<br>
> > > > > > > cfe-commits mailing list<br>
> > > > > > > <a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a><br>
> > > > > > > <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br>
> > > > > ><br>
> > > > > > _______________________________________________<br>
> > > > > > cfe-commits mailing list<br>
> > > > > > <a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a><br>
> > > > > > <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br>
> > > > > ><br>
> > > > ><br>
> > > > ><br>
> > > > ><br>
> > > > > --<br>
> > > > > Saleem Abdulrasool<br>
> > > > > compnerd (at) compnerd (dot) org<br>
> > > ><br>
> > ><br>
> > ><br>
> > ><br>
> > > --<br>
> > > Saleem Abdulrasool<br>
> > > compnerd (at) compnerd (dot) org<br>
> ><br>
><br>
><br>
><br>
> --<br>
> Saleem Abdulrasool<br>
> compnerd (at) compnerd (dot) org<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Saleem Abdulrasool<br>compnerd (at) compnerd (dot) org</div>
</div></div>