r324344 - [Solaris] Silence -pthread warning on Solaris

2018-02-06 Thread Fedor Sergeev via cfe-commits
Author: fedor.sergeev
Date: Tue Feb  6 05:21:12 2018
New Revision: 324344

URL: http://llvm.org/viewvc/llvm-project?rev=324344&view=rev
Log:
[Solaris] Silence -pthread warning on Solaris

Summary:
During make check-all on Solaris, I see several instances of this warning:

clang-6.0: warning: argument unused during compilation: '-pthread' 
[-Wunused-command-line-argument]

Since Solaris 10, libpthread has been folded into libc, so there's nothing to 
do.  gcc
just ignores -pthread here.  Darwin claims the option to silence the warning, 
and
this patch follows that lead.

Reviewers: rsmith, fedor.sergeev

Reviewed By: fedor.sergeev

Subscribers: cfe-commits, fedor.sergeev

Differential Revision: https://reviews.llvm.org/D41242

Modified:
cfe/trunk/lib/Driver/ToolChains/Solaris.cpp

Modified: cfe/trunk/lib/Driver/ToolChains/Solaris.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Solaris.cpp?rev=324344&r1=324343&r2=324344&view=diff
==
--- cfe/trunk/lib/Driver/ToolChains/Solaris.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/Solaris.cpp Tue Feb  6 05:21:12 2018
@@ -71,6 +71,11 @@ void solaris::Linker::ConstructJob(Compi
   CmdArgs.push_back(
   Args.MakeArgString(getToolChain().GetFilePath("ld.so.1")));
 }
+
+// libpthread has been folded into libc since Solaris 10, no need to do
+// anything for pthreads. Claim argument to avoid warning.
+Args.ClaimAllArgs(options::OPT_pthread);
+Args.ClaimAllArgs(options::OPT_pthreads);
   }
 
   if (Output.isFilename()) {


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


r319026 - [lit] Set shlibpath_var on Solaris

2017-11-27 Thread Fedor Sergeev via cfe-commits
Author: fedor.sergeev
Date: Mon Nov 27 05:33:19 2017
New Revision: 319026

URL: http://llvm.org/viewvc/llvm-project?rev=319026&view=rev
Log:
[lit] Set shlibpath_var on Solaris

Summary:
During make check-all on Solaris, lit complains

llvm-lit: /vol/gcc/src/llvm/llvm/dist/tools/clang/test/Unit/lit.cfg.py:57: 
warning: unable to inject shared library path on 'SunOS'

The following patch avoids this: Solaris uses LD_LIBRARY_PATH like several 
other targets.

In theory, one could also handle LD_LIBRARY_PATH_{32,64} which take precedence 
over
LD_LIBRARY_PATH if set, but let's cross that bridge when we get there.

Patch by Rainer Orth.

Reviewers: rsmith, lichray
Reviewed By: lichray

Differential Revision: https://reviews.llvm.org/D39640

Modified:
cfe/trunk/test/Unit/lit.cfg.py

Modified: cfe/trunk/test/Unit/lit.cfg.py
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Unit/lit.cfg.py?rev=319026&r1=319025&r2=319026&view=diff
==
--- cfe/trunk/test/Unit/lit.cfg.py (original)
+++ cfe/trunk/test/Unit/lit.cfg.py Mon Nov 27 05:33:19 2017
@@ -36,7 +36,7 @@ for symbolizer in ['ASAN_SYMBOLIZER_PATH
 config.environment[symbolizer] = os.environ[symbolizer]
 
 def find_shlibpath_var():
-if platform.system() in ['Linux', 'FreeBSD', 'NetBSD']:
+if platform.system() in ['Linux', 'FreeBSD', 'NetBSD', 'SunOS']:
 yield 'LD_LIBRARY_PATH'
 elif platform.system() == 'Darwin':
 yield 'DYLD_LIBRARY_PATH'


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


Re: [PATCH] D34158: For standards compatibility, preinclude if the file is available

2017-07-28 Thread Fedor Sergeev via cfe-commits
On Fri, Jul 28, 2017 at 02:07:29PM +, Blower, Melanie wrote:
>  
> 
> fedor.sergeev added a comment.
> 
> Hmm... I tried this patch and now the following worries me:
> 
> - it passes -finclude-if-exists stdc-predef.h on all platforms (say, 
> including my Solaris platform that has no system stdc-predef.h)
> - it searches all the paths, not just "system include" ones
> 
> That essentially disallows user to have stdc-predef.h include in my own 
> project, since there is a chance that this user header will be accidentally 
> included by this hidden machinery.
> 
> >> Yes, I recognize this problem. However, I don't know an acceptable way to 
> >> solve it. Does anyone have a recommendation? I had tried putting angle 
> >> brackets around the file name string to imply a system-only search but 
> >> that didn't work:  I guess the >angle brackets are taken to be part of the 
> >> file name.  I believe it's intentional that has_include doesn't recognize 
> >> the angle, I see test cases that have __has_include( "<...") Quoting from 
> >> the patch:
> // For standards compliance, clang will preinclude 
> // -ffreestanding suppresses this behavior.
> CmdArgs.push_back("-finclude-if-exists");
> CmdArgs.push_back(""); // This doesn't work to restrict 
> the search to system includes
>   } 
> 
> >I could change the argument scanner for __has_include to recognize the angle 
> >brackets -- would that be acceptable?  Alternatively, I could change the 
> >flag to be "finclude-if-exists" into "fsystem-include-if-exists". Then I 
> >could create a new preprocessing keyword(is that the right term?) 
> >__has_system_include and use that instead of __has_include.  
> 
> >I tried this test case with -c -E:
> >cat test1.c
> >#if __has_include( "stdio.h" )
> >#error it has stdio without angle  // This is printed
> >#else
> >#error it does not have stdio without angle
> >#endif
> 
> >#if __has_include( "" )

According to:
  https://clang.llvm.org/docs/LanguageExtensions.html

a proper syntax here is without "s:

  #if __has_include()

regards,
  Fedor.

> >#error it has stdio with angle
> >#else
> >#error it does not have stdio with angle // This is printed
> >#endif
> 
>   ] cat stdc-predef.h
>   #error I was not expecting to see that
>   ] bin/clang hello-world.c
>   In file included from :2:
>   ./stdc-predef.h:1:2: error: I was not expecting to see this!
>   #error I was not expecting to see this!
>^
>   1 error generated.
>   ]
> 
> 
> Repository:
>   rL LLVM
> 
> https://reviews.llvm.org/D34158
> 
> 
> 

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


r323194 - [Solaris] Make RHEL devtoolsets handling Linux-specific

2018-01-23 Thread Fedor Sergeev via cfe-commits
Author: fedor.sergeev
Date: Tue Jan 23 04:24:01 2018
New Revision: 323194

URL: http://llvm.org/viewvc/llvm-project?rev=323194&view=rev
Log:
[Solaris] Make RHEL devtoolsets handling Linux-specific

Summary:
This patch is meant to address the last outstanding review comment on the 
already approved
(but not yet commited) https://reviews.llvm.org/D35755, namely making the 
handling of the RHEL
devtoolsets Linux-specific.

Don't know if it's best integrated into the former or applied subsequently.

Tested on i386-pc-solaris2.11 and x86_64-pc-linux-gnu.

Reviewers: fedor.sergeev, tstellar, jyknight

Reviewed By: fedor.sergeev

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D42029

Modified:
cfe/trunk/lib/Driver/ToolChains/Gnu.cpp

Modified: cfe/trunk/lib/Driver/ToolChains/Gnu.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Gnu.cpp?rev=323194&r1=323193&r2=323194&view=diff
==
--- cfe/trunk/lib/Driver/ToolChains/Gnu.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/Gnu.cpp Tue Jan 23 04:24:01 2018
@@ -1788,17 +1788,14 @@ void Generic_GCC::GCCInstallationDetecto
   }
 
   // Non-Solaris is much simpler - most systems just go with "/usr".
-  if (SysRoot.empty()) {
-// Yet, still look for RHEL devtoolsets
-// (should it be done Linux-only??)
+  if (SysRoot.empty() && TargetTriple.getOS() == llvm::Triple::Linux) {
+// Yet, still 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");
-Prefixes.push_back("/usr");
-  } else {
-Prefixes.push_back(SysRoot.str() + "/usr");
   }
+  Prefixes.push_back(SysRoot.str() + "/usr");
 }
 
 /*static*/ void Generic_GCC::GCCInstallationDetector::CollectLibDirsAndTriples(


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


r323193 - [Solaris] gcc toolchain handling revamp

2018-01-23 Thread Fedor Sergeev via cfe-commits
Author: fedor.sergeev
Date: Tue Jan 23 04:23:52 2018
New Revision: 323193

URL: http://llvm.org/viewvc/llvm-project?rev=323193&view=rev
Log:
[Solaris] gcc toolchain handling revamp

Summary:
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.

Reviewers: dlj, rafael, jyknight, theraven, tstellar

Reviewed By: jyknight

Subscribers: aaron.ballman, mgorny, krytarowski, ro, joerg, cfe-commits

Differential Revision: https://reviews.llvm.org/D35755

Added:
cfe/trunk/test/Driver/Inputs/solaris_sparc_tree/
cfe/trunk/test/Driver/Inputs/solaris_sparc_tree/usr/
cfe/trunk/test/Driver/Inputs/solaris_sparc_tree/usr/gcc/
cfe/trunk/test/Driver/Inputs/solaris_sparc_tree/usr/gcc/4.8/
cfe/trunk/test/Driver/Inputs/solaris_sparc_tree/usr/gcc/4.8/include/
cfe/trunk/test/Driver/Inputs/solaris_sparc_tree/usr/gcc/4.8/include/c++/

cfe/trunk/test/Driver/Inputs/solaris_sparc_tree/usr/gcc/4.8/include/c++/4.8.2/

cfe/trunk/test/Driver/Inputs/solaris_sparc_tree/usr/gcc/4.8/include/c++/4.8.2/sparc-sun-solaris2.11/

cfe/trunk/test/Driver/Inputs/solaris_sparc_tree/usr/gcc/4.8/include/c++/4.8.2/sparc-sun-solaris2.11/bits/

cfe/trunk/test/Driver/Inputs/solaris_sparc_tree/usr/gcc/4.8/include/c++/4.8.2/sparc-sun-solaris2.11/bits/gthr.h
  - copied, changed from r323188, 
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/solaris_sparc_tree/usr/gcc/4.8/include/c++/4.8.2/typeinfo
  - copied, changed from r323188, 
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/solaris_sparc_tree/usr/gcc/4.8/lib/
cfe/trunk/test/Driver/Inputs/solaris_sparc_tree/usr/gcc/4.8/lib/gcc/

cfe/trunk/test/Driver/Inputs/solaris_sparc_tree/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/

cfe/trunk/test/Driver/Inputs/solaris_sparc_tree/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2/

cfe/trunk/test/Driver/Inputs/solaris_sparc_tree/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2/crt1.o
  - copied, changed from r323188, 
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/solaris_sparc_tree/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2/crtbegin.o
  - copied, changed from r323188, 
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/solaris_sparc_tree/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2/crtend.o
  - copied, changed from r323188, 
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/solaris_sparc_tree/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2/sparcv9/

cfe/trunk/test/Driver/Inputs/solaris_sparc_tree/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2/sparcv9/crt1.o
  - copied, changed from r323188, 
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/solaris_sparc_tree/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2/sparcv9/crtbegin.o
  - copied, changed from r323188, 
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/solaris_sparc_tree/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2/sparcv9/crtend.o
  - copied, changed from r323188, 
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/solaris_sparc_tree/usr/gcc/4.8/lib/libatomic.a
  - copied, changed from r323188, 
cfe/trunk/test/Driver/Inputs/sparc-sun-solaris2.11/usr/lib/crti.o
cfe/trunk/test/Driver/Inputs/solaris_sparc_tree/usr/gcc/4.8/lib/sparcv9/

cfe/trunk/test/Driver/Inputs/solaris_sparc_tree/usr/gcc/4.8/lib/sparcv9/libatomic.a
  - copied, changed from r323188, 
cfe/trunk/test/Driver/Inputs/sparc-sun-solaris2.11/usr/lib/crtn.o
cfe/trunk/test/Driver/Inputs/solaris_sparc_tree/usr/lib/
cfe/trunk/test/Driver/Inputs/solaris_sparc_tree/usr/lib/crti.o
  - copied, changed from r323188, 
cfe/trunk/test/Driver/Inputs/sparc-sun-solaris2.11/usr/lib/crti.o
cfe/trunk/test/Driver/Inputs/solaris_sparc_tree/usr/lib/crtn.o
  - copied, changed from r323188, 
cfe/trunk/test/Driver/Inputs/sparc-sun-solaris2.11/usr/lib/crtn.o
cfe/trunk/test/Driver/Inputs/solaris_sparc_tree/usr/lib/ld.so.1
  - copied, changed from r323

r323199 - Fix Driver/solaris-ld.c test on Windows

2018-01-23 Thread Fedor Sergeev via cfe-commits
Author: fedor.sergeev
Date: Tue Jan 23 05:59:11 2018
New Revision: 323199

URL: http://llvm.org/viewvc/llvm-project?rev=323199&view=rev
Log:
Fix Driver/solaris-ld.c test on Windows

Fixing failure introduced with r323193.

Modified:
cfe/trunk/test/Driver/solaris-ld.c

Modified: cfe/trunk/test/Driver/solaris-ld.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/solaris-ld.c?rev=323199&r1=323198&r2=323199&view=diff
==
--- cfe/trunk/test/Driver/solaris-ld.c (original)
+++ cfe/trunk/test/Driver/solaris-ld.c Tue Jan 23 05:59:11 2018
@@ -4,6 +4,7 @@
 // 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/solaris_sparc_tree \
 // RUN:   | FileCheck --check-prefix=CHECK-LD-SPARC32 %s
 // CHECK-LD-SPARC32-NOT: warning:
@@ -27,6 +28,7 @@
 // Check sparc-sun-solaris2.11, 64bit
 // RUN: %clang -no-canonical-prefixes -m64 %s -### -o %t.o 2>&1 \
 // RUN: --target=sparc-sun-solaris2.11 \
+// RUN: --gcc-toolchain="" \
 // RUN: --sysroot=%S/Inputs/solaris_sparc_tree \
 // RUN:   | FileCheck --check-prefix=CHECK-LD-SPARC64 %s
 // CHECK-LD-SPARC64-NOT: warning:
@@ -50,6 +52,7 @@
 // Check i386-pc-solaris2.11, 32bit
 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
 // RUN: --target=i386-pc-solaris2.11 \
+// RUN: --gcc-toolchain="" \
 // RUN: --sysroot=%S/Inputs/solaris_x86_tree \
 // RUN:   | FileCheck --check-prefix=CHECK-LD-X32 %s
 // CHECK-LD-X32-NOT: warning:
@@ -73,6 +76,7 @@
 // Check i386-pc-solaris2.11, 64bit
 // RUN: %clang -no-canonical-prefixes -m64 %s -### -o %t.o 2>&1 \
 // RUN: --target=i386-pc-solaris2.11 \
+// RUN: --gcc-toolchain="" \
 // RUN: --sysroot=%S/Inputs/solaris_x86_tree \
 // RUN:   | FileCheck --check-prefix=CHECK-LD-X64 %s
 // CHECK-LD-X64-NOT: warning:
@@ -96,6 +100,7 @@
 // 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/solaris_sparc_tree \
 // RUN:   | FileCheck --check-prefix=CHECK-SPARC32-SHARED %s
 // CHECK-SPARC32-SHARED: {{.*/ld}}"


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