Re: [PATCH][Solaris] Default to -fno-cxa-finalize

2015-09-08 Thread Xan López via cfe-commits
On Tue, Sep 08, 2015 at 01:09:02PM +0200, Joerg Sonnenberger via cfe-commits 
wrote:
> On Fri, Aug 28, 2015 at 07:52:17PM +0200, Xan López via cfe-commits wrote:
> > There is no __cxa_finalize symbol available on recent Solaris OS
> > versions, so we need this flag to make non trivial C++ programs run.
> 
> What do you consider as recent Solaris? When I asked, I've been told
> that Illumos has been providing __cxa_atexit since 2013. As such,
> disabling it for the Solaris family by default seems just wrong.

Solaris 11.2, which is the latest non-beta version available.

I found some patches for OpenSolaris from 2013 creating dummy versions
of cxa_finalize.o, but did not seem like that could possibly work. In
any case clang for Solaris has never really worked upstream, the code
before my recent patches was completely hardcoded for a Solaris/x86
version from 2012 with a very specific GCC version, it could not work
anywhere else. So I'm not sure that anyone at Illumos could have been
using upstream, maybe they have their own branch.

Where can I see the __cxa_atexit support in Illumos? If that works and
we can tell Solaris and Illumous apart maybe we can just disable this
for actual Solaris, but I won't be able to test that myself.

Xan

> 
> Joerg
> ___
> cfe-commits mailing list
> cfe-commits@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH][Solaris] Default to -fno-cxa-finalize

2015-09-08 Thread Xan López via cfe-commits
On Tue, Sep 08, 2015 at 01:27:42PM +0200, Xan López via cfe-commits wrote:
> > What do you consider as recent Solaris? When I asked, I've been told
> > that Illumos has been providing __cxa_atexit since 2013. As such,
> > disabling it for the Solaris family by default seems just wrong.
> 
> Solaris 11.2, which is the latest non-beta version available.

(Also, if you read the entire thread you'll see we figured that symbol
was probably never available in Solaris, see the referenced commit
from 2013, so the bit about the version being "recent" is irrelevant
and it was removed from the final commit message)

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH][Solaris] Default to -fno-cxa-finalize

2015-09-08 Thread Xan López via cfe-commits
On Tue, Sep 08, 2015 at 03:28:12PM +0200, Joerg Sonnenberger via cfe-commits 
wro> We don't distinguish Solaris and OpenSolaris forks currently. As such,
> changing one for the other is not a good choice, especially since you
> are more likely to find clang users for Illumos, IMO.
> 
> https://www.illumos.org/issues/3849

Well I'm still a bit confused about what were they using exactly,
since I'm pretty sure clang has never worked in its upstream form in a
general way from 2012/3. As I said maybe they ship a branch of their
own or something, not sure.

In any case Solaris is not Illumos, so we still need a
solution. Should we add a way to distinguish between them and disable
this feature only for Sun/Oracle Solaris? If they are diverging in
things like this it seems sooner or later it would be needed anyway.

Xan

> 
> Joerg
> ___
> cfe-commits mailing list
> cfe-commits@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH][Solaris] Default to -fno-cxa-finalize

2015-09-15 Thread Xan López via cfe-commits
On Mon, Sep 14, 2015 at 07:24:11PM -0400, Rafael Espíndola wrote:
> From the driver point of view, how does it know if it is targeting
> illumos or solaris? Do they use different triples?

At this point, they do not, se we can't.

> 
> In any case, if there is interest in the future this patch can be
> extended to work on illumos by
> 
> * Creating a shouldUseCxaAtexitByDefault and passing in whatever
> information is needed (Triple, a IsIlumos flag, etc)
> * Using it instead of the long boolean expression we have right now.
> 
> For now I committed this as r247634.

This sounds good. I'll try to contact the people at Illumos interested
in this to see if they want to work with me on making that happen.

Thanks!

> 
> Cheers,
> Rafael
> 
> 
> 
> On 8 September 2015 at 09:47, Xan López via cfe-commits
>  wrote:
> > On Tue, Sep 08, 2015 at 03:28:12PM +0200, Joerg Sonnenberger via 
> > cfe-commits wro> We don't distinguish Solaris and OpenSolaris forks 
> > currently. As such,
> >> changing one for the other is not a good choice, especially since you
> >> are more likely to find clang users for Illumos, IMO.
> >>
> >> https://www.illumos.org/issues/3849
> >
> > Well I'm still a bit confused about what were they using exactly,
> > since I'm pretty sure clang has never worked in its upstream form in a
> > general way from 2012/3. As I said maybe they ship a branch of their
> > own or something, not sure.
> >
> > In any case Solaris is not Illumos, so we still need a
> > solution. Should we add a way to distinguish between them and disable
> > this feature only for Sun/Oracle Solaris? If they are diverging in
> > things like this it seems sooner or later it would be needed anyway.
> >
> > Xan
> >
> >>
> >> Joerg
> >> ___
> >> cfe-commits mailing list
> >> cfe-commits@lists.llvm.org
> >> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
> > ___
> > cfe-commits mailing list
> > cfe-commits@lists.llvm.org
> > http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH][Solaris] Clang/Driver, stop hardcoding GCC paths in crt/ld.so lookup

2015-08-11 Thread Xan López via cfe-commits
Hi,

thanks for the review, I was not even aware that this could be
tested. Adding a test helped to fix me a couple extra issues (plus the
one you already mentioned). New patch attached.

Xan

On Wed, Aug 05, 2015 at 09:14:30AM -0400, Rafael Espíndola wrote:
> Please git-clang-format this patch.
> 
> +  // /usr/gcc/./lib/gcc/../,
> 
> The code appends a triple after the "/lib/gcc". Is the comment missing it?
> 
> The inner loop has no version comparison. Are you depending on the
> directory iteration order?
> 
> Can you add a testcase?
> 
> 
> On 28 July 2015 at 12:35, Xan López  wrote:
> > Here it is.
> >
> > On Tue, Jul 28, 2015 at 01:21:06PM +0200, Xan López wrote:
> >> On Tue, Jul 28, 2015 at 01:55:23PM +0300, Yaron Keren wrote:
> >> > +cfe-commits
> >> >
> >> > This is a very large Solaris special case in ScanLibDirForGCCTriple which
> >> > shares almost no code with the function.
> >> > How about splitting it out to a helper function or
> >> > making ScanLibDirForGCCTriple virtual and overriding on Solaris?
> >>
> >> Yep, at least a helper function makes sense, you are right. I'll send
> >> another patch with either of those suggestions later today.
> >>
> >>
> >> Xan
> >> ___
> >> llvm-commits mailing list
> >> llvm-comm...@cs.uiuc.edu
> >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
> >
> > ___
> > llvm-commits mailing list
> > llvm-comm...@cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
> >
>From 27215294c9a4aeaf25b2d618839bf413c137f8e6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Xan=20L=C3=B3pez?= 
Date: Fri, 24 Jul 2015 19:17:51 +0200
Subject: [PATCH] [Solaris] Stop hardcoding the location of the c runtime files

This refactors the GCC installation detection to work properly on
Solaris (which is a bit of a special case compared to Linux
distributions), and adds the proper /usr/lib/... logic in the
Driver. That way we can just use ToolChain::GetFilePath to locate all
crt*.o files instead of hardcoding their location.
---
 lib/Driver/ToolChains.cpp  | 107 +++--
 lib/Driver/ToolChains.h|   6 ++
 lib/Driver/Tools.cpp   |  54 ---
 .../4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2/crt1.o |   0
 .../lib/gcc/sparc-sun-solaris2.11/4.8.2/crtbegin.o |   0
 .../lib/gcc/sparc-sun-solaris2.11/4.8.2/crtend.o   |   0
 .../Inputs/sparc-sun-solaris2.11/usr/lib/crti.o|   0
 .../Inputs/sparc-sun-solaris2.11/usr/lib/crtn.o|   0
 .../Inputs/sparc-sun-solaris2.11/usr/lib/ld.so.1   |   0
 .../sparc-sun-solaris2.11/usr/lib/values-Xa.o  |   0
 test/Driver/solaris-ld.c   |  16 +++
 11 files changed, 140 insertions(+), 43 deletions(-)
 create mode 100644 
test/Driver/Inputs/sparc-sun-solaris2.11/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2/crt1.o
 create mode 100644 
test/Driver/Inputs/sparc-sun-solaris2.11/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2/crtbegin.o
 create mode 100644 
test/Driver/Inputs/sparc-sun-solaris2.11/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2/crtend.o
 create mode 100644 test/Driver/Inputs/sparc-sun-solaris2.11/usr/lib/crti.o
 create mode 100644 test/Driver/Inputs/sparc-sun-solaris2.11/usr/lib/crtn.o
 create mode 100644 test/Driver/Inputs/sparc-sun-solaris2.11/usr/lib/ld.so.1
 create mode 100644 test/Driver/Inputs/sparc-sun-solaris2.11/usr/lib/values-Xa.o
 create mode 100644 test/Driver/solaris-ld.c

diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp
index 59e6a2e..8e49c5a 100644
--- a/lib/Driver/ToolChains.cpp
+++ b/lib/Driver/ToolChains.cpp
@@ -1340,9 +1340,21 @@ bool 
Generic_GCC::GCCInstallationDetector::getBiarchSibling(Multilib &M) const {
   "s390x-linux-gnu", "s390x-unknown-linux-gnu", "s390x-ibm-linux-gnu",
   "s390x-suse-linux", "s390x-redhat-linux"};
 
+  // Solaris.
+  static const char *const SolarisSPARCLibDirs[] = {"/gcc"};
+  static const char *const SolarisSPARCTriples[] = {"sparc-sun-solaris2.11",
+"i386-pc-solaris2.11"};
+
   using std::begin;
   using std::end;
 
+  if (TargetTriple.getOS() == llvm::Triple::Solaris) {
+LibDirs.append(begin(SolarisSPARCLibDirs), end(SolarisSPARCLibDirs));
+TripleAliases.append(begin(SolarisSPARCTriples), end(SolarisSPARCTriples));
+
+return;
+  }
+
   switch (TargetTriple.getArch()) {
   case llvm::Triple::aarch64:
 LibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
@@ -1907,6 +1919,54 @@ static bool findBiarchMultilibs(const llvm::Triple 
&TargetTriple,
   return true;
 }
 
+void Generic_GCC::GCCInstallationDetector::SolarisScanLibDirForGCCTriple(
+const llvm::Triple &TargetArch, const llvm::opt::ArgList &Args,
+const std::string &LibDir, StringRef CandidateTriple,
+bool NeedsBiarchSuffix) {
+  // Solaris is a special case. The GCC installation is under
+  // /usr/gcc/./lib/gcc

[PATCH][Solaris] Default to -fno-cxa-finalize

2015-08-28 Thread Xan López via cfe-commits
There is no __cxa_finalize symbol available on recent Solaris OS
versions, so we need this flag to make non trivial C++ programs run.

Also stop looking for cxa_finalize.o, since it won't be there.

(This patch sits on top of a couple of unreviewed patches that make clang 
actually work on Solaris, see:

http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20150810/292800.html
http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20150817/293971.html

It should be trivial to rebase against master if it is reviewed first though)

Xan
>From 014ddb164689a3452b76f85079f213d607d07840 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Xan=20L=C3=B3pez?= 
Date: Fri, 14 Aug 2015 11:36:56 +0200
Subject: [PATCH 2/4] [Solaris] Default to -fno-cxa-finalize

There is no __cxa_finalize symbol available on recent Solaris OS
versions, so we need this flag to make non trivial C++ programs run.

Also stop looking for cxa_finalize.o, since it won't be there.
---
 lib/Driver/Tools.cpp | 9 +++--
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp
index b204961..cf01d7b 100644
--- a/lib/Driver/Tools.cpp
+++ b/lib/Driver/Tools.cpp
@@ -4506,8 +4506,9 @@ void Clang::ConstructJob(Compilation &C, const JobAction 
&JA,
   if (!Args.hasFlag(options::OPT_fuse_cxa_atexit,
 options::OPT_fno_use_cxa_atexit,
 !IsWindowsCygnus && !IsWindowsGNU &&
-getToolChain().getArch() != llvm::Triple::hexagon &&
-getToolChain().getArch() != llvm::Triple::xcore) ||
+getToolChain().getTriple().getOS() != 
llvm::Triple::Solaris &&
+getToolChain().getArch() != llvm::Triple::hexagon &&
+getToolChain().getArch() != llvm::Triple::xcore) ||
   KernelOrKext)
 CmdArgs.push_back("-fno-use-cxa-atexit");
 
@@ -6882,10 +6883,6 @@ void solaris::Linker::ConstructJob(Compilation &C, const 
JobAction &JA,
 Args.MakeArgString(getToolChain().GetFilePath("values-Xa.o")));
 CmdArgs.push_back(
 Args.MakeArgString(getToolChain().GetFilePath("crtbegin.o")));
-
-if (getToolChain().getDriver().CCCIsCXX())
-  CmdArgs.push_back(
-  Args.MakeArgString(getToolChain().GetFilePath("cxa_finalize.o")));
   }
 
   const ToolChain::path_list &Paths = getToolChain().getFilePaths();
-- 
2.4.3

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH][Solaris] Add -lc also when linking shared libraries

2015-08-28 Thread Xan López via cfe-commits
This is actually needed, otherwise libc won't be added at all. For
instance when building libclang.so all the libc symbols won't be
found, with ld warning about libc being an "implicit dependency".

((This patch sits on top of a couple of unreviewed patches that make clang 
actually work on Solaris, see:

http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20150810/292800.html
http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20150817/293971.html

It should be trivial to rebase against master if it is reviewed first though)

Xan
>From 8e81d6b095542c0ff1e28cf1f09d675f8afe1a25 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Xan=20L=C3=B3pez?= 
Date: Mon, 17 Aug 2015 16:04:26 +0200
Subject: [PATCH 4/4] [Solaris] Add -lc also when linking shared libraries

This is actually needed, otherwise libc won't be added at all. For
instance when building libclang.so all the libc symbols won't be
found, with ld warning about libc being an "implicit dependency".
---
 lib/Driver/Tools.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp
index cf01d7b..2034c0f 100644
--- a/lib/Driver/Tools.cpp
+++ b/lib/Driver/Tools.cpp
@@ -6899,9 +6899,9 @@ void solaris::Linker::ConstructJob(Compilation &C, const 
JobAction &JA,
 if (getToolChain().getDriver().CCCIsCXX())
   getToolChain().AddCXXStdlibLibArgs(Args, CmdArgs);
 CmdArgs.push_back("-lgcc_s");
+CmdArgs.push_back("-lc");
 if (!Args.hasArg(options::OPT_shared)) {
   CmdArgs.push_back("-lgcc");
-  CmdArgs.push_back("-lc");
   CmdArgs.push_back("-lm");
 }
   }
-- 
2.4.3

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH][Solaris] Clang/Driver, stop hardcoding GCC paths in crt/ld.so lookup

2015-08-31 Thread Xan López via cfe-commits
Oops, missed this. Here is the updated patch.

And yes please, commit the patch for me.

Cheers,

Xan

On Mon, Aug 31, 2015 at 01:07:35PM -0400, Rafael Espíndola wrote:
> Do you have a version with the last suggestions? I lgtmed it conditional on
> it.   Do you need someone to commit it for you?
> On Aug 23, 2015 7:07 PM, "Rafael Espíndola" 
> wrote:
> 
> > SolarisScanLibDirForGCCTriple should start with a lower case. Starting
> > it with "scan" would probably also be more in line with the code
> > style.
> >
> > LGTM
> >
> > On 11 August 2015 at 16:33, Xan López  wrote:
> > > Hi,
> > >
> > > thanks for the review, I was not even aware that this could be
> > > tested. Adding a test helped to fix me a couple extra issues (plus the
> > > one you already mentioned). New patch attached.
> > >
> > > Xan
> > >
> > > On Wed, Aug 05, 2015 at 09:14:30AM -0400, Rafael Espíndola wrote:
> > >> Please git-clang-format this patch.
> > >>
> > >> +  // /usr/gcc/./lib/gcc/../,
> > >>
> > >> The code appends a triple after the "/lib/gcc". Is the comment missing
> > it?
> > >>
> > >> The inner loop has no version comparison. Are you depending on the
> > >> directory iteration order?
> > >>
> > >> Can you add a testcase?
> > >>
> > >>
> > >> On 28 July 2015 at 12:35, Xan López  wrote:
> > >> > Here it is.
> > >> >
> > >> > On Tue, Jul 28, 2015 at 01:21:06PM +0200, Xan López wrote:
> > >> >> On Tue, Jul 28, 2015 at 01:55:23PM +0300, Yaron Keren wrote:
> > >> >> > +cfe-commits
> > >> >> >
> > >> >> > This is a very large Solaris special case in
> > ScanLibDirForGCCTriple which
> > >> >> > shares almost no code with the function.
> > >> >> > How about splitting it out to a helper function or
> > >> >> > making ScanLibDirForGCCTriple virtual and overriding on Solaris?
> > >> >>
> > >> >> Yep, at least a helper function makes sense, you are right. I'll send
> > >> >> another patch with either of those suggestions later today.
> > >> >>
> > >> >>
> > >> >> Xan
> > >> >> ___
> > >> >> llvm-commits mailing list
> > >> >> llvm-comm...@cs.uiuc.edu
> > >> >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
> > >> >
> > >> > ___
> > >> > llvm-commits mailing list
> > >> > llvm-comm...@cs.uiuc.edu
> > >> > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
> > >> >
> >
>From 750f40d3ae1c00e9eea1f44c5f0d4c32dd21d659 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Xan=20L=C3=B3pez?= 
Date: Fri, 24 Jul 2015 19:17:51 +0200
Subject: [PATCH 1/4] [Solaris] Stop hardcoding the location of the c runtime
 files

This refactors the GCC installation detection to work properly on
Solaris (which is a bit of a special case compared to Linux
distributions), and adds the proper /usr/lib/... logic in the
Driver. That way we can just use ToolChain::GetFilePath to locate all
crt*.o files instead of hardcoding their location.
---
 lib/Driver/ToolChains.cpp  | 106 +++--
 lib/Driver/ToolChains.h|   6 ++
 lib/Driver/Tools.cpp   |  54 ---
 .../4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2/crt1.o |   0
 .../lib/gcc/sparc-sun-solaris2.11/4.8.2/crtbegin.o |   0
 .../lib/gcc/sparc-sun-solaris2.11/4.8.2/crtend.o   |   0
 .../Inputs/sparc-sun-solaris2.11/usr/lib/crti.o|   0
 .../Inputs/sparc-sun-solaris2.11/usr/lib/crtn.o|   0
 .../Inputs/sparc-sun-solaris2.11/usr/lib/ld.so.1   |   0
 test/Driver/solaris-ld.c   |  16 
 10 files changed, 139 insertions(+), 43 deletions(-)
 create mode 100644 
test/Driver/Inputs/sparc-sun-solaris2.11/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2/crt1.o
 create mode 100644 
test/Driver/Inputs/sparc-sun-solaris2.11/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2/crtbegin.o
 create mode 100644 
test/Driver/Inputs/sparc-sun-solaris2.11/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2/crtend.o
 create mode 100644 test/Driver/Inputs/sparc-sun-solaris2.11/usr/lib/crti.o
 create mode 100644 test/Driver/Inputs/sparc-sun-solaris2.11/usr/lib/crtn.o
 create mode 100644 test/Driver/Inputs/sparc-sun-solaris2.11/usr/lib/ld.so.1
 create mode 100644 test/Driver/solaris-ld.c

diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp
index 54201aa..a703a92 100644
--- a/lib/Driver/ToolChains.cpp
+++ b/lib/Driver/ToolChains.cpp
@@ -1340,9 +1340,21 @@ bool 
Generic_GCC::GCCInstallationDetector::getBiarchSibling(Multilib &M) const {
   "s390x-linux-gnu", "s390x-unknown-linux-gnu", "s390x-ibm-linux-gnu",
   "s390x-suse-linux", "s390x-redhat-linux"};
 
+  // Solaris.
+  static const char *const SolarisSPARCLibDirs[] = {"/gcc"};
+  static const char *const SolarisSPARCTriples[] = {"sparc-sun-solaris2.11",
+"i386-pc-solaris2.11"};
+
   using std::begin;
   using std::end;
 
+  if (TargetTriple.getOS() == llvm::Triple::Solaris) {
+LibDirs.append(begin(SolarisSPARCLibDirs)

Re: [PATCH][Solaris] Default to -fno-cxa-finalize

2015-09-04 Thread Xan López via cfe-commits
On Fri, Aug 28, 2015 at 07:52:17PM +0200, Xan López via cfe-commits wrote:
> There is no __cxa_finalize symbol available on recent Solaris OS
> versions, so we need this flag to make non trivial C++ programs run.
> 
> Also stop looking for cxa_finalize.o, since it won't be there.
> 
> (This patch sits on top of a couple of unreviewed patches that make clang 
> actually work on Solaris, see:
> 
> http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20150810/292800.html
> http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20150817/293971.html
> 
> It should be trivial to rebase against master if it is reviewed first though)
> 
> Xan

Ping?


> From 014ddb164689a3452b76f85079f213d607d07840 Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?Xan=20L=C3=B3pez?= 
> Date: Fri, 14 Aug 2015 11:36:56 +0200
> Subject: [PATCH 2/4] [Solaris] Default to -fno-cxa-finalize
> 
> There is no __cxa_finalize symbol available on recent Solaris OS
> versions, so we need this flag to make non trivial C++ programs run.
> 
> Also stop looking for cxa_finalize.o, since it won't be there.
> ---
>  lib/Driver/Tools.cpp | 9 +++--
>  1 file changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp
> index b204961..cf01d7b 100644
> --- a/lib/Driver/Tools.cpp
> +++ b/lib/Driver/Tools.cpp
> @@ -4506,8 +4506,9 @@ void Clang::ConstructJob(Compilation &C, const 
> JobAction &JA,
>if (!Args.hasFlag(options::OPT_fuse_cxa_atexit,
>  options::OPT_fno_use_cxa_atexit,
>  !IsWindowsCygnus && !IsWindowsGNU &&
> -getToolChain().getArch() != llvm::Triple::hexagon &&
> -getToolChain().getArch() != llvm::Triple::xcore) ||
> +getToolChain().getTriple().getOS() != 
> llvm::Triple::Solaris &&
> +getToolChain().getArch() != llvm::Triple::hexagon &&
> +getToolChain().getArch() != llvm::Triple::xcore) ||
>KernelOrKext)
>  CmdArgs.push_back("-fno-use-cxa-atexit");
>  
> @@ -6882,10 +6883,6 @@ void solaris::Linker::ConstructJob(Compilation &C, 
> const JobAction &JA,
>  Args.MakeArgString(getToolChain().GetFilePath("values-Xa.o")));
>  CmdArgs.push_back(
>  Args.MakeArgString(getToolChain().GetFilePath("crtbegin.o")));
> -
> -if (getToolChain().getDriver().CCCIsCXX())
> -  CmdArgs.push_back(
> -  Args.MakeArgString(getToolChain().GetFilePath("cxa_finalize.o")));
>}
>  
>const ToolChain::path_list &Paths = getToolChain().getFilePaths();
> -- 
> 2.4.3
> 

> ___
> cfe-commits mailing list
> cfe-commits@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH][Solaris] Add -lc also when linking shared libraries

2015-09-04 Thread Xan López via cfe-commits
On Fri, Aug 28, 2015 at 07:53:40PM +0200, Xan López via cfe-commits wrote:
> This is actually needed, otherwise libc won't be added at all. For
> instance when building libclang.so all the libc symbols won't be
> found, with ld warning about libc being an "implicit dependency".
> 
> ((This patch sits on top of a couple of unreviewed patches that make clang 
> actually work on Solaris, see:
> 
> http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20150810/292800.html
> http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20150817/293971.html
> 
> It should be trivial to rebase against master if it is reviewed first though)
> 
> Xan

Ping?

> From 8e81d6b095542c0ff1e28cf1f09d675f8afe1a25 Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?Xan=20L=C3=B3pez?= 
> Date: Mon, 17 Aug 2015 16:04:26 +0200
> Subject: [PATCH 4/4] [Solaris] Add -lc also when linking shared libraries
> 
> This is actually needed, otherwise libc won't be added at all. For
> instance when building libclang.so all the libc symbols won't be
> found, with ld warning about libc being an "implicit dependency".
> ---
>  lib/Driver/Tools.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp
> index cf01d7b..2034c0f 100644
> --- a/lib/Driver/Tools.cpp
> +++ b/lib/Driver/Tools.cpp
> @@ -6899,9 +6899,9 @@ void solaris::Linker::ConstructJob(Compilation &C, 
> const JobAction &JA,
>  if (getToolChain().getDriver().CCCIsCXX())
>getToolChain().AddCXXStdlibLibArgs(Args, CmdArgs);
>  CmdArgs.push_back("-lgcc_s");
> +CmdArgs.push_back("-lc");
>  if (!Args.hasArg(options::OPT_shared)) {
>CmdArgs.push_back("-lgcc");
> -  CmdArgs.push_back("-lc");
>CmdArgs.push_back("-lm");
>  }
>}
> -- 
> 2.4.3
> 

> ___
> cfe-commits mailing list
> cfe-commits@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH][Solaris] Default to -fno-cxa-finalize

2015-09-07 Thread Xan López via cfe-commits
On Sat, Sep 05, 2015 at 12:25:28PM -0700, Saleem Abdulrasool wrote:
> > Ping?
> >
> 
> Does this break with older Solaris releases?  How far back did this change
> in Solaris?  The change itself should really be accompanied with a test.

Hi,

turns out I'm not really sure cxa_finalize.o was ever available on
Solaris. The initial code for Solaris was pushed in 2012, but it was
hardcoded to work on a pretty specific Solaris/x86 environment. One
commit from that time is r151648, which claims -fno-cxa-atexit
produces broken code and says they'll ship their own
cxa_finalize.o. So it seems it was not available back then
either. I've also seen commits in OpenSolaris from 2013 creating dummy
cxa_finalize.o files so that clang will pass the bare minimum tests.

Now that I'm slowly pushing changes to make clang/Solaris work again
(it was totally broken) I've found this issue again. My patch allows
me to compile clang with clang itself, and other simple C++ programs
compile and work. So if there was a bug here it was either fixed or I
have not found it yet. I'd say that we should probably fix whatever
issue there is with -fno-cxa-atexit when it shows up instead of
working around it, or maybe *actually* bundle an implementation for
Solaris with clang itself? But suggestions are welcome.

Also, what kind of test would you have in mind for this?

Xan

> 
> 
> > > From 014ddb164689a3452b76f85079f213d607d07840 Mon Sep 17 00:00:00 2001
> > > From: =?UTF-8?q?Xan=20L=C3=B3pez?= 
> > > Date: Fri, 14 Aug 2015 11:36:56 +0200
> > > Subject: [PATCH 2/4] [Solaris] Default to -fno-cxa-finalize
> > >
> > > There is no __cxa_finalize symbol available on recent Solaris OS
> > > versions, so we need this flag to make non trivial C++ programs run.
> > >
> > > Also stop looking for cxa_finalize.o, since it won't be there.
> > > ---
> > >  lib/Driver/Tools.cpp | 9 +++--
> > >  1 file changed, 3 insertions(+), 6 deletions(-)
> > >
> > > diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp
> > > index b204961..cf01d7b 100644
> > > --- a/lib/Driver/Tools.cpp
> > > +++ b/lib/Driver/Tools.cpp
> > > @@ -4506,8 +4506,9 @@ void Clang::ConstructJob(Compilation &C, const
> > JobAction &JA,
> > >if (!Args.hasFlag(options::OPT_fuse_cxa_atexit,
> > >  options::OPT_fno_use_cxa_atexit,
> > >  !IsWindowsCygnus && !IsWindowsGNU &&
> > > -getToolChain().getArch() !=
> > llvm::Triple::hexagon &&
> > > -getToolChain().getArch() !=
> > llvm::Triple::xcore) ||
> > > +getToolChain().getTriple().getOS() !=
> > llvm::Triple::Solaris &&
> > > +getToolChain().getArch() != llvm::Triple::hexagon &&
> > > +getToolChain().getArch() != llvm::Triple::xcore) ||
> > >KernelOrKext)
> > >  CmdArgs.push_back("-fno-use-cxa-atexit");
> > >
> > > @@ -6882,10 +6883,6 @@ void solaris::Linker::ConstructJob(Compilation
> > &C, const JobAction &JA,
> > >  Args.MakeArgString(getToolChain().GetFilePath("values-Xa.o")));
> > >  CmdArgs.push_back(
> > >  Args.MakeArgString(getToolChain().GetFilePath("crtbegin.o")));
> > > -
> > > -if (getToolChain().getDriver().CCCIsCXX())
> > > -  CmdArgs.push_back(
> > > -
> > Args.MakeArgString(getToolChain().GetFilePath("cxa_finalize.o")));
> > >}
> > >
> > >const ToolChain::path_list &Paths = getToolChain().getFilePaths();
> > > --
> > > 2.4.3
> > >
> >
> > > ___
> > > cfe-commits mailing list
> > > cfe-commits@lists.llvm.org
> > > http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
> >
> > ___
> > cfe-commits mailing list
> > cfe-commits@lists.llvm.org
> > http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
> >
> 
> 
> 
> -- 
> Saleem Abdulrasool
> compnerd (at) compnerd (dot) org
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH][Solaris] Add -lc also when linking shared libraries

2015-09-07 Thread Xan López via cfe-commits
On Sat, Sep 05, 2015 at 12:28:43PM -0700, Saleem Abdulrasool wrote:
> > Ping?
> >
> 
> Testcase?  Looks fine otherwise.

Basically check that -lc is present when clang is called in a certain
way I guess? Or something more sophisticated?

Xan

> 
> 
> > > From 8e81d6b095542c0ff1e28cf1f09d675f8afe1a25 Mon Sep 17 00:00:00 2001
> > > From: =?UTF-8?q?Xan=20L=C3=B3pez?= 
> > > Date: Mon, 17 Aug 2015 16:04:26 +0200
> > > Subject: [PATCH 4/4] [Solaris] Add -lc also when linking shared libraries
> > >
> > > This is actually needed, otherwise libc won't be added at all. For
> > > instance when building libclang.so all the libc symbols won't be
> > > found, with ld warning about libc being an "implicit dependency".
> > > ---
> > >  lib/Driver/Tools.cpp | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp
> > > index cf01d7b..2034c0f 100644
> > > --- a/lib/Driver/Tools.cpp
> > > +++ b/lib/Driver/Tools.cpp
> > > @@ -6899,9 +6899,9 @@ void solaris::Linker::ConstructJob(Compilation &C,
> > const JobAction &JA,
> > >  if (getToolChain().getDriver().CCCIsCXX())
> > >getToolChain().AddCXXStdlibLibArgs(Args, CmdArgs);
> > >  CmdArgs.push_back("-lgcc_s");
> > > +CmdArgs.push_back("-lc");
> > >  if (!Args.hasArg(options::OPT_shared)) {
> > >CmdArgs.push_back("-lgcc");
> > > -  CmdArgs.push_back("-lc");
> > >CmdArgs.push_back("-lm");
> > >  }
> > >}
> > > --
> > > 2.4.3
> > >
> >
> > > ___
> > > cfe-commits mailing list
> > > cfe-commits@lists.llvm.org
> > > http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
> >
> > ___
> > cfe-commits mailing list
> > cfe-commits@lists.llvm.org
> > http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
> >
> 
> 
> 
> -- 
> Saleem Abdulrasool
> compnerd (at) compnerd (dot) org
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH][Solaris] Add -lc also when linking shared libraries

2015-09-07 Thread Xan López via cfe-commits
On Mon, Sep 07, 2015 at 09:07:41AM -0700, Saleem Abdulrasool wrote:
> > Basically check that -lc is present when clang is called in a certain
> > way I guess? Or something more sophisticated?
> 
> 
> Yeah, that it is present when a DSO or executable is linked.

Right, maybe something like this. Patch attached.

(If it seems fine please commit it for me, I do not have commit
rights)

Xan

>From b73b50ebd8d14aebc71b5480ad0f33ccf15c5885 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Xan=20L=C3=B3pez?= 
Date: Mon, 17 Aug 2015 16:04:26 +0200
Subject: [PATCH] [Solaris] Add -lc also when linking shared libraries

This is actually needed, otherwise libc won't be added at all. For
instance when building libclang.so all the libc symbols won't be
found, with ld warning about libc being an "implicit dependency".
---
 lib/Driver/Tools.cpp |  2 +-
 test/Driver/solaris-ld.c | 17 +
 2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp
index 867d201..a4d6ee8 100644
--- a/lib/Driver/Tools.cpp
+++ b/lib/Driver/Tools.cpp
@@ -6965,9 +6965,9 @@ void solaris::Linker::ConstructJob(Compilation &C, const 
JobAction &JA,
 if (getToolChain().getDriver().CCCIsCXX())
   getToolChain().AddCXXStdlibLibArgs(Args, CmdArgs);
 CmdArgs.push_back("-lgcc_s");
+CmdArgs.push_back("-lc");
 if (!Args.hasArg(options::OPT_shared)) {
   CmdArgs.push_back("-lgcc");
-  CmdArgs.push_back("-lc");
   CmdArgs.push_back("-lm");
 }
   }
diff --git a/test/Driver/solaris-ld.c b/test/Driver/solaris-ld.c
index 0e1b89f..d871b59 100644
--- a/test/Driver/solaris-ld.c
+++ b/test/Driver/solaris-ld.c
@@ -14,3 +14,20 @@
 // CHECK: 
"{{.*}}/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2{{/|}}crtbegin.o"
 // CHECK: 
"{{.*}}/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2{{/|}}crtend.o"
 // CHECK: "{{.*}}/usr/lib/crtn.o"
+// CHECK "-lc"
+// CHECK "-lgcc_s"
+// CHECK "-lgcc"
+// CHECK "-lm"
+
+// Check the right -l flags are present with -shared
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o -shared 2>&1 \
+// RUN: --target=sparc-sun-solaris2.11 \
+// RUN: --gcc-toolchain="" \
+// RUN: --sysroot=%S/Inputs/sparc-sun-solaris2.11 \
+// RUN:   | FileCheck --check-prefix=CHECK-SHARED %s
+
+// CHECK-SHARED: ld{{.*}}"
+// CHECK-SHARED "-lc"
+// CHECK-SHARED "-lgcc_s"
+// CHECK-SHARED-NOT "-lgcc"
+// CHECK-SHARED-NOT: "-lm"
-- 
2.4.3

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH][Solaris] Default to -fno-cxa-finalize

2015-09-07 Thread Xan López via cfe-commits
OK! So here's the patch with a test.

Xan

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

Re: [PATCH][Solaris] Default to -fno-cxa-finalize

2015-09-07 Thread Xan López via cfe-commits
On Mon, Sep 07, 2015 at 10:38:08AM -0700, Saleem Abdulrasool wrote:
> The patch LGTM with a minor request for tweaking the commit message to have
> the context about the fact that cxa_finalize.o never shipped, and so this
> doesn't really cause any problems for older releases.

Right. Tried to explain a bit what's going on in the commit message,
with a reference to the original commit that removed the flag.

> 
> 
> > Xan
> >
> > On Mon, Sep 07, 2015 at 09:14:05AM -0700, Saleem Abdulrasool wrote:
> > > On Mon, Sep 7, 2015 at 2:28 AM, Xan López  wrote:
> > >
> > > > On Sat, Sep 05, 2015 at 12:25:28PM -0700, Saleem Abdulrasool wrote:
> > > > > > Ping?
> > > > > >
> > > > >
> > > > > Does this break with older Solaris releases?  How far back did this
> > > > change
> > > > > in Solaris?  The change itself should really be accompanied with a
> > test.
> > > >
> > > > Hi,
> > > >
> > > > turns out I'm not really sure cxa_finalize.o was ever available on
> > > > Solaris. The initial code for Solaris was pushed in 2012, but it was
> > > > hardcoded to work on a pretty specific Solaris/x86 environment. One
> > > > commit from that time is r151648, which claims -fno-cxa-atexit
> > > > produces broken code and says they'll ship their own
> > > > cxa_finalize.o. So it seems it was not available back then
> > > > either. I've also seen commits in OpenSolaris from 2013 creating dummy
> > > > cxa_finalize.o files so that clang will pass the bare minimum tests.
> > > >
> > >
> > > That seems less than ideal.  If there seems to be no release of Solaris
> > > with this mythical support file, it doesn't seem too terrible to just get
> > > rid of it.
> > >
> > >
> > > > Now that I'm slowly pushing changes to make clang/Solaris work again
> > > > (it was totally broken) I've found this issue again. My patch allows
> > > > me to compile clang with clang itself, and other simple C++ programs
> > > > compile and work. So if there was a bug here it was either fixed or I
> > > > have not found it yet. I'd say that we should probably fix whatever
> > > > issue there is with -fno-cxa-atexit when it shows up instead of
> > > > working around it, or maybe *actually* bundle an implementation for
> > > > Solaris with clang itself? But suggestions are welcome.
> > > >
> > >
> > > Okay, so, AIUI, no release ever contained this file, __cxa_exit isn't
> > > provided, and that using -fno-cxa-exit does (and really should) works
> > well
> > > enough for non-trivial applications.
> > >
> > >
> > > > Also, what kind of test would you have in mind for this?
> > >
> > >
> > > That -fno-cxa-exit is included by the driver when compiling for Solaris.
> > >
> > >
> > > >
> > > > Xan
> > > >
> > > > >
> > > > >
> > > > > > > From 014ddb164689a3452b76f85079f213d607d07840 Mon Sep 17 00:00:00
> > > > 2001
> > > > > > > From: =?UTF-8?q?Xan=20L=C3=B3pez?= 
> > > > > > > Date: Fri, 14 Aug 2015 11:36:56 +0200
> > > > > > > Subject: [PATCH 2/4] [Solaris] Default to -fno-cxa-finalize
> > > > > > >
> > > > > > > There is no __cxa_finalize symbol available on recent Solaris OS
> > > > > > > versions, so we need this flag to make non trivial C++ programs
> > run.
> > > > > > >
> > > > > > > Also stop looking for cxa_finalize.o, since it won't be there.
> > > > > > > ---
> > > > > > >  lib/Driver/Tools.cpp | 9 +++--
> > > > > > >  1 file changed, 3 insertions(+), 6 deletions(-)
> > > > > > >
> > > > > > > diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp
> > > > > > > index b204961..cf01d7b 100644
> > > > > > > --- a/lib/Driver/Tools.cpp
> > > > > > > +++ b/lib/Driver/Tools.cpp
> > > > > > > @@ -4506,8 +4506,9 @@ void Clang::ConstructJob(Compilation &C,
> > const
> > > > > > JobAction &JA,
> > > > > > >if (!Args.hasFlag(options::OPT_fuse_cxa_atexit,
> > > > > > >  options::OPT_fno_use_cxa_atexit,
> > > > > > >  !IsWindowsCygnus && !IsWindowsGNU &&
> > > > > > > -getToolChain().getArch() !=
> > > > > > llvm::Triple::hexagon &&
> > > > > > > -getToolChain().getArch() !=
> > > > > > llvm::Triple::xcore) ||
> > > > > > > +getToolChain().getTriple().getOS() !=
> > > > > > llvm::Triple::Solaris &&
> > > > > > > +getToolChain().getArch() !=
> > > > llvm::Triple::hexagon &&
> > > > > > > +getToolChain().getArch() !=
> > > > llvm::Triple::xcore) ||
> > > > > > >KernelOrKext)
> > > > > > >  CmdArgs.push_back("-fno-use-cxa-atexit");
> > > > > > >
> > > > > > > @@ -6882,10 +6883,6 @@ void
> > solaris::Linker::ConstructJob(Compilation
> > > > > > &C, const JobAction &JA,
> > > > > > >
> > > > Args.MakeArgString(getToolChain().GetFilePath("values-Xa.o")));
> > > > > > >  CmdArgs.push_back(
> > > > > > >
> > > > Args.MakeArgString(getToolChain().GetFilePath("crtbegin.o")));
> > > > > > > -
> > > > > > > -if (getToolChain().getDriver().CCCIsCXX())
> > > > > > > -  CmdArgs.push_back(
> > > > > > >

Re: [PATCH][Solaris] Default to -fno-cxa-finalize

2015-09-08 Thread Xan López via cfe-commits
On Mon, Sep 07, 2015 at 02:44:23PM -0700, Saleem Abdulrasool wrote:
> > Right. Tried to explain a bit what's going on in the commit message,
> > with a reference to the original commit that removed the flag.
> 
> 
> Thanks.  Would you like me to commit this on your behalf as well?

Yes please. Thanks!

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits