summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFedor Sergeev <fedor.sergeev@azul.com>2018-02-06 13:21:12 +0000
committerFedor Sergeev <fedor.sergeev@azul.com>2018-02-06 13:21:12 +0000
commit33c86f87400c6517418a93068e507547b7582744 (patch)
tree134fbc642d90e7bafa2b8bc000eacf1248e6eed2
parent81fcf865be23275a1421df5cdeeed8651259817c (diff)
downloadbcm5719-llvm-33c86f87400c6517418a93068e507547b7582744.tar.gz
bcm5719-llvm-33c86f87400c6517418a93068e507547b7582744.zip
[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 llvm-svn: 324344
-rw-r--r--clang/lib/Driver/ToolChains/Solaris.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/Driver/ToolChains/Solaris.cpp b/clang/lib/Driver/ToolChains/Solaris.cpp
index 3ed286585e0..b48edbb08ee 100644
--- a/clang/lib/Driver/ToolChains/Solaris.cpp
+++ b/clang/lib/Driver/ToolChains/Solaris.cpp
@@ -71,6 +71,11 @@ void solaris::Linker::ConstructJob(Compilation &C, const JobAction &JA,
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()) {
OpenPOWER on IntegriCloud