Fix driver warning about -pthread on Android.

-pthread is no-op on Android. Suppress the unused argument warning.

llvm-svn: 210253
This commit is contained in:
Evgeniy Stepanov 2014-06-05 11:41:39 +00:00
parent 6f0ae18a59
commit dad9206564
2 changed files with 9 additions and 3 deletions

View File

@ -7189,9 +7189,9 @@ void gnutools::Link::ConstructJob(Compilation &C, const JobAction &JA,
}
AddRunTimeLibs(ToolChain, D, CmdArgs, Args);
if (!isAndroid &&
(Args.hasArg(options::OPT_pthread) ||
Args.hasArg(options::OPT_pthreads) || UsedOpenMPLib != LibUnknown))
if ((Args.hasArg(options::OPT_pthread) ||
Args.hasArg(options::OPT_pthreads) || UsedOpenMPLib != LibUnknown) &&
!isAndroid)
CmdArgs.push_back("-lpthread");
CmdArgs.push_back("-lc");

View File

@ -895,6 +895,12 @@
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
// CHECK-ANDROID-PTHREAD-NOT: -lpthread
//
// RUN: %clang -no-canonical-prefixes %t.o -### -o %t 2>&1 \
// RUN: --target=arm-linux-androideabi -pthread \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD-LINK %s
// CHECK-ANDROID-PTHREAD-LINK-NOT: argument unused during compilation: '-pthread'
//
// Check linker invocation on Debian 6 MIPS 32/64-bit.
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=mipsel-linux-gnu \