From: Fedor Sergeev Date: Tue, 6 Feb 2018 13:21:12 +0000 (+0000) Subject: [Solaris] Silence -pthread warning on Solaris X-Git-Tag: llvmorg-7.0.0-rc1~13580 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=33c86f87400c6517418a93068e507547b7582744;p=platform%2Fupstream%2Fllvm.git [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 --- diff --git a/clang/lib/Driver/ToolChains/Solaris.cpp b/clang/lib/Driver/ToolChains/Solaris.cpp index 3ed2865..b48edbb 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()) {