[PATCH] D35755: [Solaris] gcc toolchain handling revamp

2018-01-23 Thread Fedor Sergeev via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL323193: [Solaris] gcc toolchain handling revamp (authored by 
fedor.sergeev, committed by ).
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D35755?vs=110194=131043#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D35755

Files:
  cfe/trunk/lib/Driver/ToolChains/Gnu.cpp
  cfe/trunk/lib/Driver/ToolChains/Gnu.h
  cfe/trunk/lib/Driver/ToolChains/Solaris.cpp
  cfe/trunk/lib/Driver/ToolChains/Solaris.h
  cfe/trunk/lib/Frontend/InitHeaderSearch.cpp
  
cfe/trunk/test/Driver/Inputs/solaris_sparc_tree/usr/gcc/4.8/include/c++/4.8.2/sparc-sun-solaris2.11/bits/gthr.h
  
cfe/trunk/test/Driver/Inputs/solaris_sparc_tree/usr/gcc/4.8/include/c++/4.8.2/typeinfo
  
cfe/trunk/test/Driver/Inputs/solaris_sparc_tree/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2/crt1.o
  
cfe/trunk/test/Driver/Inputs/solaris_sparc_tree/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2/crtbegin.o
  
cfe/trunk/test/Driver/Inputs/solaris_sparc_tree/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2/crtend.o
  
cfe/trunk/test/Driver/Inputs/solaris_sparc_tree/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2/sparcv9/crt1.o
  
cfe/trunk/test/Driver/Inputs/solaris_sparc_tree/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2/sparcv9/crtbegin.o
  
cfe/trunk/test/Driver/Inputs/solaris_sparc_tree/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2/sparcv9/crtend.o
  cfe/trunk/test/Driver/Inputs/solaris_sparc_tree/usr/gcc/4.8/lib/libatomic.a
  
cfe/trunk/test/Driver/Inputs/solaris_sparc_tree/usr/gcc/4.8/lib/sparcv9/libatomic.a
  cfe/trunk/test/Driver/Inputs/solaris_sparc_tree/usr/lib/crti.o
  cfe/trunk/test/Driver/Inputs/solaris_sparc_tree/usr/lib/crtn.o
  cfe/trunk/test/Driver/Inputs/solaris_sparc_tree/usr/lib/ld.so.1
  cfe/trunk/test/Driver/Inputs/solaris_sparc_tree/usr/lib/sparcv9/crti.o
  cfe/trunk/test/Driver/Inputs/solaris_sparc_tree/usr/lib/sparcv9/crtn.o
  cfe/trunk/test/Driver/Inputs/solaris_sparc_tree/usr/lib/sparcv9/ld.so.1
  
cfe/trunk/test/Driver/Inputs/solaris_x86_tree/usr/gcc/4.9/include/c++/4.9.4/i386-pc-solaris2.11/bits/gthr.h
  
cfe/trunk/test/Driver/Inputs/solaris_x86_tree/usr/gcc/4.9/include/c++/4.9.4/typeinfo
  
cfe/trunk/test/Driver/Inputs/solaris_x86_tree/usr/gcc/4.9/lib/amd64/libatomic.a
  
cfe/trunk/test/Driver/Inputs/solaris_x86_tree/usr/gcc/4.9/lib/gcc/i386-pc-solaris2.11/4.9.4/amd64/crtbegin.o
  
cfe/trunk/test/Driver/Inputs/solaris_x86_tree/usr/gcc/4.9/lib/gcc/i386-pc-solaris2.11/4.9.4/amd64/crtend.o
  
cfe/trunk/test/Driver/Inputs/solaris_x86_tree/usr/gcc/4.9/lib/gcc/i386-pc-solaris2.11/4.9.4/crtbegin.o
  
cfe/trunk/test/Driver/Inputs/solaris_x86_tree/usr/gcc/4.9/lib/gcc/i386-pc-solaris2.11/4.9.4/crtend.o
  cfe/trunk/test/Driver/Inputs/solaris_x86_tree/usr/gcc/4.9/lib/libatomic.a
  cfe/trunk/test/Driver/Inputs/solaris_x86_tree/usr/lib/amd64/crt1.o
  cfe/trunk/test/Driver/Inputs/solaris_x86_tree/usr/lib/amd64/crti.o
  cfe/trunk/test/Driver/Inputs/solaris_x86_tree/usr/lib/amd64/crtn.o
  cfe/trunk/test/Driver/Inputs/solaris_x86_tree/usr/lib/amd64/ld.so.1
  cfe/trunk/test/Driver/Inputs/solaris_x86_tree/usr/lib/crt1.o
  cfe/trunk/test/Driver/Inputs/solaris_x86_tree/usr/lib/crti.o
  cfe/trunk/test/Driver/Inputs/solaris_x86_tree/usr/lib/crtn.o
  cfe/trunk/test/Driver/Inputs/solaris_x86_tree/usr/lib/ld.so.1
  
cfe/trunk/test/Driver/Inputs/sparc-sun-solaris2.11/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2/crt1.o
  
cfe/trunk/test/Driver/Inputs/sparc-sun-solaris2.11/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2/crtbegin.o
  
cfe/trunk/test/Driver/Inputs/sparc-sun-solaris2.11/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2/crtend.o
  cfe/trunk/test/Driver/Inputs/sparc-sun-solaris2.11/usr/lib/crti.o
  cfe/trunk/test/Driver/Inputs/sparc-sun-solaris2.11/usr/lib/crtn.o
  cfe/trunk/test/Driver/Inputs/sparc-sun-solaris2.11/usr/lib/ld.so.1
  cfe/trunk/test/Driver/solaris-header-search.cpp
  cfe/trunk/test/Driver/solaris-ld.c

Index: cfe/trunk/test/Driver/solaris-header-search.cpp
===
--- cfe/trunk/test/Driver/solaris-header-search.cpp
+++ cfe/trunk/test/Driver/solaris-header-search.cpp
@@ -1,11 +1,41 @@
-// Test that the C++ headers are found.
+// Test that the C++ headers are found on Solaris with gcc toolchain detection
 //
-// RUN: %clang -no-canonical-prefixes %s -### 2>&1 \
+// Sparc, 32bit
+// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
 // RUN: --target=sparc-sun-solaris2.11 \
-// RUN: --gcc-toolchain="" \
-// RUN: --sysroot=%S/Inputs/sparc-sun-solaris2.11 \
-// RUN:   | FileCheck %s
-// CHECK: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
-// CHECK: "-internal-isystem" "{{.*}}/usr/include/c++/v1/support/solaris"
-// CHECK: "-internal-isystem" "{{.*}}/usr/gcc/4.8/include/c++/4.8.2"
-// CHECK: "-internal-isystem" "{{.*}}/usr/gcc/4.8/include/c++/4.8.2/sparc-sun-solaris2.11"
+// RUN: --sysroot=%S/Inputs/solaris_sparc_tree 

[PATCH] D35755: [Solaris] gcc toolchain handling revamp

2017-12-19 Thread James Y Knight via Phabricator via cfe-commits
jyknight accepted this revision.
jyknight added a comment.
This revision is now accepted and ready to land.

This looks reasonable on the face of it.

I'm assuming you know the layout for Solaris, and it doesn't seem to change the 
behavior of non-Solaris, so LGTM.


https://reviews.llvm.org/D35755



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


[PATCH] D35755: [Solaris] gcc toolchain handling revamp

2017-11-21 Thread Rainer Orth via Phabricator via cfe-commits
ro added a comment.

In https://reviews.llvm.org/D35755#931120, @krytarowski wrote:

> Do we still target Oracle Solaris or SmartOS? Just wondering and noted the 
> domain change in e-mail.


Both, I'd say ;-)  They still have much common heritage and the vast majority 
of linker/toolchain work on Illumos derivatives is done by
a single guy, so the various distributions will be the same in this area.  This 
is very much like asking wether to target OS X 10.11 or 10.13.

There will of course be some divergence, but that can be handled when the need 
arrises.


https://reviews.llvm.org/D35755



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


[PATCH] D35755: [Solaris] gcc toolchain handling revamp

2017-11-20 Thread Kamil Rytarowski via Phabricator via cfe-commits
krytarowski added a comment.

In https://reviews.llvm.org/D35755#930789, @fedor.sergeev wrote:

> In https://reviews.llvm.org/D35755#930030, @ro wrote:
>
> > What's the status here?  This patch is required for my WIP 
> > sanitizers-on-Solaris work.
>
>
> since @tstellar just resolved the only remaining question I will go change 
> the questionable part to linux-only and then I consider this ready to go.
>  Then we just have to find somebody who is willing to press the green 
> button...
>  Thanks for keeping this topic alive, I kinda stopped pinging it.


Do we still target Oracle Solaris or SmartOS? Just wondering and noted the 
domain change in e-mail.


https://reviews.llvm.org/D35755



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


[PATCH] D35755: [Solaris] gcc toolchain handling revamp

2017-11-20 Thread Fedor Sergeev via Phabricator via cfe-commits
fedor.sergeev marked an inline comment as not done.
fedor.sergeev added a comment.

In https://reviews.llvm.org/D35755#930030, @ro wrote:

> What's the status here?  This patch is required for my WIP 
> sanitizers-on-Solaris work.


since @tstellar just resolved the only remaining question I will go change the 
questionable part to linux-only and then I consider this ready to go.
Then we just have to find somebody who is willing to press the green button...
Thanks for keeping this topic alive, I kinda stopped pinging it.


https://reviews.llvm.org/D35755



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


[PATCH] D35755: [Solaris] gcc toolchain handling revamp

2017-11-20 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added inline comments.



Comment at: lib/Driver/ToolChains/Gnu.cpp:1840
+// Yet, still look for RHEL devtoolsets
+// (should it be done Linux-only??)
+Prefixes.push_back("/opt/rh/devtoolset-6/root/usr");

fedor.sergeev wrote:
> aaron.ballman wrote:
> > This is a good question to get an answer to before committing. :-) I don't 
> > know the answer myself, unfortunately.
> So we need somebody that could answer it! :)
> Last person who touched these paths was Tom Stellard.
> Adding as a reviewer.
Yes, this can be linux only.


https://reviews.llvm.org/D35755



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


[PATCH] D35755: [Solaris] gcc toolchain handling revamp

2017-11-20 Thread Rainer Orth via Phabricator via cfe-commits
ro added a comment.

What's the status here?  This patch is required for my WIP 
sanitizers-on-Solaris work.


https://reviews.llvm.org/D35755



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


[PATCH] D35755: [Solaris] gcc toolchain handling revamp

2017-08-08 Thread Fedor Sergeev via Phabricator via cfe-commits
fedor.sergeev marked an inline comment as not done.
fedor.sergeev added inline comments.



Comment at: lib/Driver/ToolChains/Gnu.h:253
 
+void AddDefaultGCCPrefixes(const llvm::Triple ,
+   SmallVectorImpl ,

aaron.ballman wrote:
> Might as well drop the `llvm::` since the namespace isn't used for 
> `SmallVectorImpl`.
suggested change caused a build failure since Triple resolves into 
Toolchain::Triple data member, not to llvm::Triple.


https://reviews.llvm.org/D35755



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


[PATCH] D35755: [Solaris] gcc toolchain handling revamp

2017-08-08 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments.



Comment at: lib/Driver/ToolChains/Gnu.h:253
 
+void AddDefaultGCCPrefixes(const llvm::Triple ,
+   SmallVectorImpl ,

fedor.sergeev wrote:
> aaron.ballman wrote:
> > Might as well drop the `llvm::` since the namespace isn't used for 
> > `SmallVectorImpl`.
> suggested change caused a build failure since Triple resolves into 
> Toolchain::Triple data member, not to llvm::Triple.
That's really good to know, thanks (and sorry for the churn)!


https://reviews.llvm.org/D35755



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


[PATCH] D35755: [Solaris] gcc toolchain handling revamp

2017-08-08 Thread Fedor Sergeev via Phabricator via cfe-commits
fedor.sergeev updated this revision to Diff 110194.
fedor.sergeev added a comment.

ugh... reverting back to llvm::Triple, since plain Triple conflicts with 
clang::driver::Toolchain::Triple data member.
Built/tested on Solaris11 x86/SPARC, Linux x86.


https://reviews.llvm.org/D35755

Files:
  lib/Driver/ToolChains/Gnu.cpp
  lib/Driver/ToolChains/Gnu.h
  lib/Driver/ToolChains/Solaris.cpp
  lib/Driver/ToolChains/Solaris.h
  lib/Frontend/InitHeaderSearch.cpp
  
test/Driver/Inputs/solaris_sparc_tree/usr/gcc/4.8/include/c++/4.8.2/sparc-sun-solaris2.11/bits/gthr.h
  test/Driver/Inputs/solaris_sparc_tree/usr/gcc/4.8/include/c++/4.8.2/typeinfo
  
test/Driver/Inputs/solaris_sparc_tree/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2/crt1.o
  
test/Driver/Inputs/solaris_sparc_tree/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2/crtbegin.o
  
test/Driver/Inputs/solaris_sparc_tree/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2/crtend.o
  
test/Driver/Inputs/solaris_sparc_tree/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2/sparcv9/crt1.o
  
test/Driver/Inputs/solaris_sparc_tree/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2/sparcv9/crtbegin.o
  
test/Driver/Inputs/solaris_sparc_tree/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2/sparcv9/crtend.o
  test/Driver/Inputs/solaris_sparc_tree/usr/gcc/4.8/lib/libatomic.a
  test/Driver/Inputs/solaris_sparc_tree/usr/gcc/4.8/lib/sparcv9/libatomic.a
  test/Driver/Inputs/solaris_sparc_tree/usr/lib/crti.o
  test/Driver/Inputs/solaris_sparc_tree/usr/lib/crtn.o
  test/Driver/Inputs/solaris_sparc_tree/usr/lib/ld.so.1
  test/Driver/Inputs/solaris_sparc_tree/usr/lib/sparcv9/crti.o
  test/Driver/Inputs/solaris_sparc_tree/usr/lib/sparcv9/crtn.o
  test/Driver/Inputs/solaris_sparc_tree/usr/lib/sparcv9/ld.so.1
  
test/Driver/Inputs/solaris_x86_tree/usr/gcc/4.9/include/c++/4.9.4/i386-pc-solaris2.11/bits/gthr.h
  test/Driver/Inputs/solaris_x86_tree/usr/gcc/4.9/include/c++/4.9.4/typeinfo
  test/Driver/Inputs/solaris_x86_tree/usr/gcc/4.9/lib/amd64/libatomic.a
  
test/Driver/Inputs/solaris_x86_tree/usr/gcc/4.9/lib/gcc/i386-pc-solaris2.11/4.9.4/amd64/crtbegin.o
  
test/Driver/Inputs/solaris_x86_tree/usr/gcc/4.9/lib/gcc/i386-pc-solaris2.11/4.9.4/amd64/crtend.o
  
test/Driver/Inputs/solaris_x86_tree/usr/gcc/4.9/lib/gcc/i386-pc-solaris2.11/4.9.4/crtbegin.o
  
test/Driver/Inputs/solaris_x86_tree/usr/gcc/4.9/lib/gcc/i386-pc-solaris2.11/4.9.4/crtend.o
  test/Driver/Inputs/solaris_x86_tree/usr/gcc/4.9/lib/libatomic.a
  test/Driver/Inputs/solaris_x86_tree/usr/lib/amd64/crt1.o
  test/Driver/Inputs/solaris_x86_tree/usr/lib/amd64/crti.o
  test/Driver/Inputs/solaris_x86_tree/usr/lib/amd64/crtn.o
  test/Driver/Inputs/solaris_x86_tree/usr/lib/amd64/ld.so.1
  test/Driver/Inputs/solaris_x86_tree/usr/lib/crt1.o
  test/Driver/Inputs/solaris_x86_tree/usr/lib/crti.o
  test/Driver/Inputs/solaris_x86_tree/usr/lib/crtn.o
  test/Driver/Inputs/solaris_x86_tree/usr/lib/ld.so.1
  
test/Driver/Inputs/sparc-sun-solaris2.11/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2/crt1.o
  
test/Driver/Inputs/sparc-sun-solaris2.11/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2/crtbegin.o
  
test/Driver/Inputs/sparc-sun-solaris2.11/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2/crtend.o
  test/Driver/Inputs/sparc-sun-solaris2.11/usr/lib/crti.o
  test/Driver/Inputs/sparc-sun-solaris2.11/usr/lib/crtn.o
  test/Driver/Inputs/sparc-sun-solaris2.11/usr/lib/ld.so.1
  test/Driver/solaris-header-search.cpp
  test/Driver/solaris-ld.c

Index: test/Driver/solaris-ld.c
===
--- test/Driver/solaris-ld.c
+++ test/Driver/solaris-ld.c
@@ -1,33 +1,105 @@
-// Test ld invocation on Solaris targets.
+// General tests that ld invocations on Solaris targets sane. Note that we use
+// sysroot to make these tests independent of the host system.
 
-// Check sparc-sun-solaris2.1
+// Check sparc-sun-solaris2.11, 32bit
 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
 // RUN: --target=sparc-sun-solaris2.11 \
-// RUN: --gcc-toolchain="" \
-// RUN: --sysroot=%S/Inputs/sparc-sun-solaris2.11 \
-// RUN:   | FileCheck %s
-// CHECK: "-cc1" "-triple" "sparc-sun-solaris2.11"
-// CHECK: ld{{.*}}"
-// CHECK: "--dynamic-linker" "{{.*}}/usr/lib/ld.so.1"
-// CHECK: "{{.*}}/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2{{/|}}crt1.o"
-// CHECK: "{{.*}}/usr/lib/crti.o"
-// 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"
+// RUN: --sysroot=%S/Inputs/solaris_sparc_tree \
+// RUN:   | FileCheck --check-prefix=CHECK-LD-SPARC32 %s
+// CHECK-LD-SPARC32-NOT: warning:
+// CHECK-LD-SPARC32: {{.*/clang}}" "-cc1" "-triple" "sparc-sun-solaris2.11"
+// CHECK-LD-SPARC32-SAME: "-isysroot" "[[SYSROOT:[^"]+]]"
+// CHECK-LD-SPARC32: {{.*/ld}}"
+// CHECK-LD-SPARC32-SAME: 

[PATCH] D35755: [Solaris] gcc toolchain handling revamp

2017-08-08 Thread Fedor Sergeev via Phabricator via cfe-commits
fedor.sergeev updated this revision to Diff 110190.
fedor.sergeev added a comment.

auto changed to MultilibSet::IncludeDirsFunc.


https://reviews.llvm.org/D35755

Files:
  lib/Driver/ToolChains/Gnu.cpp
  lib/Driver/ToolChains/Gnu.h
  lib/Driver/ToolChains/Solaris.cpp
  lib/Driver/ToolChains/Solaris.h
  lib/Frontend/InitHeaderSearch.cpp
  
test/Driver/Inputs/solaris_sparc_tree/usr/gcc/4.8/include/c++/4.8.2/sparc-sun-solaris2.11/bits/gthr.h
  test/Driver/Inputs/solaris_sparc_tree/usr/gcc/4.8/include/c++/4.8.2/typeinfo
  
test/Driver/Inputs/solaris_sparc_tree/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2/crt1.o
  
test/Driver/Inputs/solaris_sparc_tree/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2/crtbegin.o
  
test/Driver/Inputs/solaris_sparc_tree/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2/crtend.o
  
test/Driver/Inputs/solaris_sparc_tree/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2/sparcv9/crt1.o
  
test/Driver/Inputs/solaris_sparc_tree/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2/sparcv9/crtbegin.o
  
test/Driver/Inputs/solaris_sparc_tree/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2/sparcv9/crtend.o
  test/Driver/Inputs/solaris_sparc_tree/usr/gcc/4.8/lib/libatomic.a
  test/Driver/Inputs/solaris_sparc_tree/usr/gcc/4.8/lib/sparcv9/libatomic.a
  test/Driver/Inputs/solaris_sparc_tree/usr/lib/crti.o
  test/Driver/Inputs/solaris_sparc_tree/usr/lib/crtn.o
  test/Driver/Inputs/solaris_sparc_tree/usr/lib/ld.so.1
  test/Driver/Inputs/solaris_sparc_tree/usr/lib/sparcv9/crti.o
  test/Driver/Inputs/solaris_sparc_tree/usr/lib/sparcv9/crtn.o
  test/Driver/Inputs/solaris_sparc_tree/usr/lib/sparcv9/ld.so.1
  
test/Driver/Inputs/solaris_x86_tree/usr/gcc/4.9/include/c++/4.9.4/i386-pc-solaris2.11/bits/gthr.h
  test/Driver/Inputs/solaris_x86_tree/usr/gcc/4.9/include/c++/4.9.4/typeinfo
  test/Driver/Inputs/solaris_x86_tree/usr/gcc/4.9/lib/amd64/libatomic.a
  
test/Driver/Inputs/solaris_x86_tree/usr/gcc/4.9/lib/gcc/i386-pc-solaris2.11/4.9.4/amd64/crtbegin.o
  
test/Driver/Inputs/solaris_x86_tree/usr/gcc/4.9/lib/gcc/i386-pc-solaris2.11/4.9.4/amd64/crtend.o
  
test/Driver/Inputs/solaris_x86_tree/usr/gcc/4.9/lib/gcc/i386-pc-solaris2.11/4.9.4/crtbegin.o
  
test/Driver/Inputs/solaris_x86_tree/usr/gcc/4.9/lib/gcc/i386-pc-solaris2.11/4.9.4/crtend.o
  test/Driver/Inputs/solaris_x86_tree/usr/gcc/4.9/lib/libatomic.a
  test/Driver/Inputs/solaris_x86_tree/usr/lib/amd64/crt1.o
  test/Driver/Inputs/solaris_x86_tree/usr/lib/amd64/crti.o
  test/Driver/Inputs/solaris_x86_tree/usr/lib/amd64/crtn.o
  test/Driver/Inputs/solaris_x86_tree/usr/lib/amd64/ld.so.1
  test/Driver/Inputs/solaris_x86_tree/usr/lib/crt1.o
  test/Driver/Inputs/solaris_x86_tree/usr/lib/crti.o
  test/Driver/Inputs/solaris_x86_tree/usr/lib/crtn.o
  test/Driver/Inputs/solaris_x86_tree/usr/lib/ld.so.1
  
test/Driver/Inputs/sparc-sun-solaris2.11/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2/crt1.o
  
test/Driver/Inputs/sparc-sun-solaris2.11/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2/crtbegin.o
  
test/Driver/Inputs/sparc-sun-solaris2.11/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2/crtend.o
  test/Driver/Inputs/sparc-sun-solaris2.11/usr/lib/crti.o
  test/Driver/Inputs/sparc-sun-solaris2.11/usr/lib/crtn.o
  test/Driver/Inputs/sparc-sun-solaris2.11/usr/lib/ld.so.1
  test/Driver/solaris-header-search.cpp
  test/Driver/solaris-ld.c

Index: test/Driver/solaris-ld.c
===
--- test/Driver/solaris-ld.c
+++ test/Driver/solaris-ld.c
@@ -1,33 +1,105 @@
-// Test ld invocation on Solaris targets.
+// General tests that ld invocations on Solaris targets sane. Note that we use
+// sysroot to make these tests independent of the host system.
 
-// Check sparc-sun-solaris2.1
+// Check sparc-sun-solaris2.11, 32bit
 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
 // RUN: --target=sparc-sun-solaris2.11 \
-// RUN: --gcc-toolchain="" \
-// RUN: --sysroot=%S/Inputs/sparc-sun-solaris2.11 \
-// RUN:   | FileCheck %s
-// CHECK: "-cc1" "-triple" "sparc-sun-solaris2.11"
-// CHECK: ld{{.*}}"
-// CHECK: "--dynamic-linker" "{{.*}}/usr/lib/ld.so.1"
-// CHECK: "{{.*}}/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2{{/|}}crt1.o"
-// CHECK: "{{.*}}/usr/lib/crti.o"
-// 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"
+// RUN: --sysroot=%S/Inputs/solaris_sparc_tree \
+// RUN:   | FileCheck --check-prefix=CHECK-LD-SPARC32 %s
+// CHECK-LD-SPARC32-NOT: warning:
+// CHECK-LD-SPARC32: {{.*/clang}}" "-cc1" "-triple" "sparc-sun-solaris2.11"
+// CHECK-LD-SPARC32-SAME: "-isysroot" "[[SYSROOT:[^"]+]]"
+// CHECK-LD-SPARC32: {{.*/ld}}"
+// CHECK-LD-SPARC32-SAME: "--dynamic-linker" "[[SYSROOT]]/usr/lib/ld.so.1"
+// CHECK-LD-SPARC32-SAME: 

[PATCH] D35755: [Solaris] gcc toolchain handling revamp

2017-08-08 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment.

Aside from a coding style nit and the unanswered question that hopefully 
@tstellar can help answer, this LGTM. I'll wait to accept until we figure out 
the answer for Linux, however.




Comment at: lib/Driver/ToolChains/Solaris.cpp:208
   if (GCCInstallation.isValid()) {
-GCCVersion Version = GCCInstallation.getVersion();
-addSystemInclude(DriverArgs, CC1Args,
- getDriver().SysRoot + "/usr/gcc/" +
- Version.MajorStr + "." +
- Version.MinorStr +
- "/include/c++/" + Version.Text);
-addSystemInclude(DriverArgs, CC1Args,
- getDriver().SysRoot + "/usr/gcc/" + Version.MajorStr +
- "." + Version.MinorStr + "/include/c++/" +
- Version.Text + "/" +
- GCCInstallation.getTriple().str());
+const auto  = Multilibs.includeDirsCallback();
+if (Callback) {

fedor.sergeev wrote:
> aaron.ballman wrote:
> > Shouldn't use `auto` here because the type is not spelled out in the 
> > initialization.
> I believe this is the case described in LLVM coding standard as "when the 
> type would have been abstracted away anyways". It would be 
> MultilibSet::IncludeDirsFunc, which IMO does not add anything to readability.
I've always taken that to refer to things like range-based for loop variables 
and functions that return iterators; not functions that return concrete types. 
I prefer to see the explicit type in this case so that I am able to better 
understand the arguments to be passed to the function. When it's abstracted 
behind `auto`, I have to work harder to find the information I need compared to 
when the type is explicitly spelled out.


https://reviews.llvm.org/D35755



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


[PATCH] D35755: [Solaris] gcc toolchain handling revamp

2017-08-03 Thread Fedor Sergeev via Phabricator via cfe-commits
fedor.sergeev added a reviewer: tstellar.
fedor.sergeev marked 11 inline comments as done.
fedor.sergeev added inline comments.



Comment at: lib/Driver/ToolChains/Gnu.cpp:1840
+// Yet, still look for RHEL devtoolsets
+// (should it be done Linux-only??)
+Prefixes.push_back("/opt/rh/devtoolset-6/root/usr");

aaron.ballman wrote:
> This is a good question to get an answer to before committing. :-) I don't 
> know the answer myself, unfortunately.
So we need somebody that could answer it! :)
Last person who touched these paths was Tom Stellard.
Adding as a reviewer.



Comment at: lib/Driver/ToolChains/Solaris.cpp:208
   if (GCCInstallation.isValid()) {
-GCCVersion Version = GCCInstallation.getVersion();
-addSystemInclude(DriverArgs, CC1Args,
- getDriver().SysRoot + "/usr/gcc/" +
- Version.MajorStr + "." +
- Version.MinorStr +
- "/include/c++/" + Version.Text);
-addSystemInclude(DriverArgs, CC1Args,
- getDriver().SysRoot + "/usr/gcc/" + Version.MajorStr +
- "." + Version.MinorStr + "/include/c++/" +
- Version.Text + "/" +
- GCCInstallation.getTriple().str());
+const auto  = Multilibs.includeDirsCallback();
+if (Callback) {

aaron.ballman wrote:
> Shouldn't use `auto` here because the type is not spelled out in the 
> initialization.
I believe this is the case described in LLVM coding standard as "when the type 
would have been abstracted away anyways". It would be 
MultilibSet::IncludeDirsFunc, which IMO does not add anything to readability.


https://reviews.llvm.org/D35755



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


[PATCH] D35755: [Solaris] gcc toolchain handling revamp

2017-08-03 Thread Fedor Sergeev via Phabricator via cfe-commits
fedor.sergeev updated this revision to Diff 109593.
fedor.sergeev added a comment.

Corrected comments as suggested by Aaron.
Will be replying on other suggestions inline.


https://reviews.llvm.org/D35755

Files:
  lib/Driver/ToolChains/Gnu.cpp
  lib/Driver/ToolChains/Gnu.h
  lib/Driver/ToolChains/Solaris.cpp
  lib/Driver/ToolChains/Solaris.h
  lib/Frontend/InitHeaderSearch.cpp
  
test/Driver/Inputs/solaris_sparc_tree/usr/gcc/4.8/include/c++/4.8.2/sparc-sun-solaris2.11/bits/gthr.h
  test/Driver/Inputs/solaris_sparc_tree/usr/gcc/4.8/include/c++/4.8.2/typeinfo
  
test/Driver/Inputs/solaris_sparc_tree/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2/crt1.o
  
test/Driver/Inputs/solaris_sparc_tree/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2/crtbegin.o
  
test/Driver/Inputs/solaris_sparc_tree/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2/crtend.o
  
test/Driver/Inputs/solaris_sparc_tree/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2/sparcv9/crt1.o
  
test/Driver/Inputs/solaris_sparc_tree/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2/sparcv9/crtbegin.o
  
test/Driver/Inputs/solaris_sparc_tree/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2/sparcv9/crtend.o
  test/Driver/Inputs/solaris_sparc_tree/usr/gcc/4.8/lib/libatomic.a
  test/Driver/Inputs/solaris_sparc_tree/usr/gcc/4.8/lib/sparcv9/libatomic.a
  test/Driver/Inputs/solaris_sparc_tree/usr/lib/crti.o
  test/Driver/Inputs/solaris_sparc_tree/usr/lib/crtn.o
  test/Driver/Inputs/solaris_sparc_tree/usr/lib/ld.so.1
  test/Driver/Inputs/solaris_sparc_tree/usr/lib/sparcv9/crti.o
  test/Driver/Inputs/solaris_sparc_tree/usr/lib/sparcv9/crtn.o
  test/Driver/Inputs/solaris_sparc_tree/usr/lib/sparcv9/ld.so.1
  
test/Driver/Inputs/solaris_x86_tree/usr/gcc/4.9/include/c++/4.9.4/i386-pc-solaris2.11/bits/gthr.h
  test/Driver/Inputs/solaris_x86_tree/usr/gcc/4.9/include/c++/4.9.4/typeinfo
  test/Driver/Inputs/solaris_x86_tree/usr/gcc/4.9/lib/amd64/libatomic.a
  
test/Driver/Inputs/solaris_x86_tree/usr/gcc/4.9/lib/gcc/i386-pc-solaris2.11/4.9.4/amd64/crtbegin.o
  
test/Driver/Inputs/solaris_x86_tree/usr/gcc/4.9/lib/gcc/i386-pc-solaris2.11/4.9.4/amd64/crtend.o
  
test/Driver/Inputs/solaris_x86_tree/usr/gcc/4.9/lib/gcc/i386-pc-solaris2.11/4.9.4/crtbegin.o
  
test/Driver/Inputs/solaris_x86_tree/usr/gcc/4.9/lib/gcc/i386-pc-solaris2.11/4.9.4/crtend.o
  test/Driver/Inputs/solaris_x86_tree/usr/gcc/4.9/lib/libatomic.a
  test/Driver/Inputs/solaris_x86_tree/usr/lib/amd64/crt1.o
  test/Driver/Inputs/solaris_x86_tree/usr/lib/amd64/crti.o
  test/Driver/Inputs/solaris_x86_tree/usr/lib/amd64/crtn.o
  test/Driver/Inputs/solaris_x86_tree/usr/lib/amd64/ld.so.1
  test/Driver/Inputs/solaris_x86_tree/usr/lib/crt1.o
  test/Driver/Inputs/solaris_x86_tree/usr/lib/crti.o
  test/Driver/Inputs/solaris_x86_tree/usr/lib/crtn.o
  test/Driver/Inputs/solaris_x86_tree/usr/lib/ld.so.1
  
test/Driver/Inputs/sparc-sun-solaris2.11/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2/crt1.o
  
test/Driver/Inputs/sparc-sun-solaris2.11/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2/crtbegin.o
  
test/Driver/Inputs/sparc-sun-solaris2.11/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2/crtend.o
  test/Driver/Inputs/sparc-sun-solaris2.11/usr/lib/crti.o
  test/Driver/Inputs/sparc-sun-solaris2.11/usr/lib/crtn.o
  test/Driver/Inputs/sparc-sun-solaris2.11/usr/lib/ld.so.1
  test/Driver/solaris-header-search.cpp
  test/Driver/solaris-ld.c

Index: test/Driver/solaris-ld.c
===
--- test/Driver/solaris-ld.c
+++ test/Driver/solaris-ld.c
@@ -1,33 +1,105 @@
-// Test ld invocation on Solaris targets.
+// General tests that ld invocations on Solaris targets sane. Note that we use
+// sysroot to make these tests independent of the host system.
 
-// Check sparc-sun-solaris2.1
+// Check sparc-sun-solaris2.11, 32bit
 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
 // RUN: --target=sparc-sun-solaris2.11 \
-// RUN: --gcc-toolchain="" \
-// RUN: --sysroot=%S/Inputs/sparc-sun-solaris2.11 \
-// RUN:   | FileCheck %s
-// CHECK: "-cc1" "-triple" "sparc-sun-solaris2.11"
-// CHECK: ld{{.*}}"
-// CHECK: "--dynamic-linker" "{{.*}}/usr/lib/ld.so.1"
-// CHECK: "{{.*}}/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2{{/|}}crt1.o"
-// CHECK: "{{.*}}/usr/lib/crti.o"
-// 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"
+// RUN: --sysroot=%S/Inputs/solaris_sparc_tree \
+// RUN:   | FileCheck --check-prefix=CHECK-LD-SPARC32 %s
+// CHECK-LD-SPARC32-NOT: warning:
+// CHECK-LD-SPARC32: {{.*/clang}}" "-cc1" "-triple" "sparc-sun-solaris2.11"
+// CHECK-LD-SPARC32-SAME: "-isysroot" "[[SYSROOT:[^"]+]]"
+// CHECK-LD-SPARC32: {{.*/ld}}"
+// CHECK-LD-SPARC32-SAME: "--dynamic-linker" "[[SYSROOT]]/usr/lib/ld.so.1"
+// CHECK-LD-SPARC32-SAME: 

[PATCH] D35755: [Solaris] gcc toolchain handling revamp

2017-08-02 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments.



Comment at: lib/Driver/ToolChains/Gnu.cpp:1511
+  StringRef Suff64 = "/64";
+  // Solaris uses platform-specific suffixes instead of /64
+  if (TargetTriple.getOS() == llvm::Triple::Solaris) {

Add a period at the end of the comment.



Comment at: lib/Driver/ToolChains/Gnu.cpp:1732
 
-// Then look for distribution supplied gcc installations.
+// Now prefix(es) that correspond to distribution-supplied gcc 
installations
 if (D.SysRoot.empty()) {

s/Now/Next, look for
Add a period at the end of the comment.



Comment at: lib/Driver/ToolChains/Gnu.cpp:1734
 if (D.SysRoot.empty()) {
-  // Look for RHEL devtoolsets.
-  Prefixes.push_back("/opt/rh/devtoolset-6/root/usr");
-  Prefixes.push_back("/opt/rh/devtoolset-4/root/usr");
-  Prefixes.push_back("/opt/rh/devtoolset-3/root/usr");
-  Prefixes.push_back("/opt/rh/devtoolset-2/root/usr");
-  // And finally in /usr.
-  Prefixes.push_back("/usr");
+  // typically /usr
+  AddDefaultGCCPrefixes(TargetTriple, Prefixes, D.SysRoot);

s/typically/Typically
Add a period at the end of the comment.



Comment at: lib/Driver/ToolChains/Gnu.cpp:1807
+void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+const llvm::Triple , SmallVectorImpl ,
+StringRef SysRoot) {

I'd drop the `llvm::` here.



Comment at: lib/Driver/ToolChains/Gnu.cpp:1813-1814
+//   /usr/gcc/./lib/gcc//../
+// so we need to find those /usr/gcc/*/lib/gcc libdirs
+// and go with /usr/gcc/ as a prefix
+

This comment can probably be re-flowed, and needs a period at the end of it.



Comment at: lib/Driver/ToolChains/Gnu.cpp:1837
+
+  // non-Solaris is much simpler - most systems just go with "/usr"
+  if (SysRoot.empty()) {

s/non/Non
Needs a period at the end of the comment.



Comment at: lib/Driver/ToolChains/Gnu.cpp:1840
+// Yet, still look for RHEL devtoolsets
+// (should it be done Linux-only??)
+Prefixes.push_back("/opt/rh/devtoolset-6/root/usr");

This is a good question to get an answer to before committing. :-) I don't know 
the answer myself, unfortunately.



Comment at: lib/Driver/ToolChains/Gnu.h:253
 
+void AddDefaultGCCPrefixes(const llvm::Triple ,
+   SmallVectorImpl ,

Might as well drop the `llvm::` since the namespace isn't used for 
`SmallVectorImpl`.



Comment at: lib/Driver/ToolChains/Gnu.h:309
+  // FIXME: This should be final, but CrossWindows toolchain does weird
+  // things that cant be easily generalized
   void AddClangCXXStdlibIncludeArgs(

s/but CrossWindows/but the CrossWindows
s/cant/can't
Add a period at the end of the comment.



Comment at: lib/Driver/ToolChains/Solaris.cpp:151
+  if (GCCInstallation.isValid()) {
+// On Solaris gcc uses both architecture-specific path with triple in it
+// as well as more generic lib path (+arch suffix)

s/both architecture/both an architecture



Comment at: lib/Driver/ToolChains/Solaris.cpp:152
+// On Solaris gcc uses both architecture-specific path with triple in it
+// as well as more generic lib path (+arch suffix)
+addPathIfExists(D,

s/as more/as a more

Add a period at the end of the comment.



Comment at: lib/Driver/ToolChains/Solaris.cpp:160
 
-  addPathIfExists(D, getDriver().SysRoot + LibPath, Paths);
+  // if we are currently running Clang inside of the requested system root,
+  // add its parent library path to those searched.

s/if/If



Comment at: lib/Driver/ToolChains/Solaris.cpp:208
   if (GCCInstallation.isValid()) {
-GCCVersion Version = GCCInstallation.getVersion();
-addSystemInclude(DriverArgs, CC1Args,
- getDriver().SysRoot + "/usr/gcc/" +
- Version.MajorStr + "." +
- Version.MinorStr +
- "/include/c++/" + Version.Text);
-addSystemInclude(DriverArgs, CC1Args,
- getDriver().SysRoot + "/usr/gcc/" + Version.MajorStr +
- "." + Version.MinorStr + "/include/c++/" +
- Version.Text + "/" +
- GCCInstallation.getTriple().str());
+const auto  = Multilibs.includeDirsCallback();
+if (Callback) {

Shouldn't use `auto` here because the type is not spelled out in the 
initialization.


https://reviews.llvm.org/D35755



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


[PATCH] D35755: [Solaris] gcc toolchain handling revamp

2017-07-31 Thread Fedor Sergeev via Phabricator via cfe-commits
fedor.sergeev added a comment.

ping?


https://reviews.llvm.org/D35755



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


[PATCH] D35755: [Solaris] gcc toolchain handling revamp

2017-07-21 Thread Fedor Sergeev via Phabricator via cfe-commits
fedor.sergeev created this revision.

General idea is to utilize generic (mostly Generic_GCC) code
and get rid of Solaris-specific handling as much as possible.

In particular:

- scanLibDirForGCCTripleSolaris was removed, relying on generic 
CollectLibDirsAndTriples

- findBiarchMultilibs is now properly utilized to switch between m32 and m64 
include & lib paths on Solaris

- C system include handling copied from Linux (bar multilib hacks)

Fixes PR24606.


https://reviews.llvm.org/D35755

Files:
  lib/Driver/ToolChains/Gnu.cpp
  lib/Driver/ToolChains/Gnu.h
  lib/Driver/ToolChains/Solaris.cpp
  lib/Driver/ToolChains/Solaris.h
  lib/Frontend/InitHeaderSearch.cpp
  
test/Driver/Inputs/solaris_sparc_tree/usr/gcc/4.8/include/c++/4.8.2/sparc-sun-solaris2.11/bits/gthr.h
  test/Driver/Inputs/solaris_sparc_tree/usr/gcc/4.8/include/c++/4.8.2/typeinfo
  
test/Driver/Inputs/solaris_sparc_tree/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2/crt1.o
  
test/Driver/Inputs/solaris_sparc_tree/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2/crtbegin.o
  
test/Driver/Inputs/solaris_sparc_tree/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2/crtend.o
  
test/Driver/Inputs/solaris_sparc_tree/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2/sparcv9/crt1.o
  
test/Driver/Inputs/solaris_sparc_tree/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2/sparcv9/crtbegin.o
  
test/Driver/Inputs/solaris_sparc_tree/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2/sparcv9/crtend.o
  test/Driver/Inputs/solaris_sparc_tree/usr/gcc/4.8/lib/libatomic.a
  test/Driver/Inputs/solaris_sparc_tree/usr/gcc/4.8/lib/sparcv9/libatomic.a
  test/Driver/Inputs/solaris_sparc_tree/usr/lib/crti.o
  test/Driver/Inputs/solaris_sparc_tree/usr/lib/crtn.o
  test/Driver/Inputs/solaris_sparc_tree/usr/lib/ld.so.1
  test/Driver/Inputs/solaris_sparc_tree/usr/lib/sparcv9/crti.o
  test/Driver/Inputs/solaris_sparc_tree/usr/lib/sparcv9/crtn.o
  test/Driver/Inputs/solaris_sparc_tree/usr/lib/sparcv9/ld.so.1
  
test/Driver/Inputs/solaris_x86_tree/usr/gcc/4.9/include/c++/4.9.4/i386-pc-solaris2.11/bits/gthr.h
  test/Driver/Inputs/solaris_x86_tree/usr/gcc/4.9/include/c++/4.9.4/typeinfo
  test/Driver/Inputs/solaris_x86_tree/usr/gcc/4.9/lib/amd64/libatomic.a
  
test/Driver/Inputs/solaris_x86_tree/usr/gcc/4.9/lib/gcc/i386-pc-solaris2.11/4.9.4/amd64/crtbegin.o
  
test/Driver/Inputs/solaris_x86_tree/usr/gcc/4.9/lib/gcc/i386-pc-solaris2.11/4.9.4/amd64/crtend.o
  
test/Driver/Inputs/solaris_x86_tree/usr/gcc/4.9/lib/gcc/i386-pc-solaris2.11/4.9.4/crtbegin.o
  
test/Driver/Inputs/solaris_x86_tree/usr/gcc/4.9/lib/gcc/i386-pc-solaris2.11/4.9.4/crtend.o
  test/Driver/Inputs/solaris_x86_tree/usr/gcc/4.9/lib/libatomic.a
  test/Driver/Inputs/solaris_x86_tree/usr/lib/amd64/crt1.o
  test/Driver/Inputs/solaris_x86_tree/usr/lib/amd64/crti.o
  test/Driver/Inputs/solaris_x86_tree/usr/lib/amd64/crtn.o
  test/Driver/Inputs/solaris_x86_tree/usr/lib/amd64/ld.so.1
  test/Driver/Inputs/solaris_x86_tree/usr/lib/crt1.o
  test/Driver/Inputs/solaris_x86_tree/usr/lib/crti.o
  test/Driver/Inputs/solaris_x86_tree/usr/lib/crtn.o
  test/Driver/Inputs/solaris_x86_tree/usr/lib/ld.so.1
  
test/Driver/Inputs/sparc-sun-solaris2.11/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2/crt1.o
  
test/Driver/Inputs/sparc-sun-solaris2.11/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2/crtbegin.o
  
test/Driver/Inputs/sparc-sun-solaris2.11/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2/crtend.o
  test/Driver/Inputs/sparc-sun-solaris2.11/usr/lib/crti.o
  test/Driver/Inputs/sparc-sun-solaris2.11/usr/lib/crtn.o
  test/Driver/Inputs/sparc-sun-solaris2.11/usr/lib/ld.so.1
  test/Driver/solaris-header-search.cpp
  test/Driver/solaris-ld.c

Index: test/Driver/solaris-ld.c
===
--- test/Driver/solaris-ld.c
+++ test/Driver/solaris-ld.c
@@ -1,33 +1,105 @@
-// Test ld invocation on Solaris targets.
+// General tests that ld invocations on Solaris targets sane. Note that we use
+// sysroot to make these tests independent of the host system.
 
-// Check sparc-sun-solaris2.1
+// Check sparc-sun-solaris2.11, 32bit
 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
 // RUN: --target=sparc-sun-solaris2.11 \
-// RUN: --gcc-toolchain="" \
-// RUN: --sysroot=%S/Inputs/sparc-sun-solaris2.11 \
-// RUN:   | FileCheck %s
-// CHECK: "-cc1" "-triple" "sparc-sun-solaris2.11"
-// CHECK: ld{{.*}}"
-// CHECK: "--dynamic-linker" "{{.*}}/usr/lib/ld.so.1"
-// CHECK: "{{.*}}/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2{{/|}}crt1.o"
-// CHECK: "{{.*}}/usr/lib/crti.o"
-// 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"
+// RUN: --sysroot=%S/Inputs/solaris_sparc_tree \
+// RUN:   | FileCheck --check-prefix=CHECK-LD-SPARC32 %s
+// CHECK-LD-SPARC32-NOT: