[OPENMP] Fixed linked libraries for libiomp5 on Linux

llvm-svn: 203212
This commit is contained in:
Alexey Bataev 2014-03-07 07:43:52 +00:00
parent 7b58305ff6
commit 648250a2e5
2 changed files with 5 additions and 3 deletions

View File

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

View File

@ -33,13 +33,15 @@
// RUN: -fopenmp=libiomp5 -target i386-unknown-linux \
// RUN: | FileCheck --check-prefix=CHECK-IOMP5-LD-32 %s
// CHECK-IOMP5-LD-32: "{{.*}}ld{{(.exe)?}}"
// CHECK-IOMP5-LD-32: "-liomp5"
// CHECK-IOMP5-LD-32: "-liomp5" "-lgcc"
// CHECK-IOMP5-LD-32: "-lpthread" "-lc"
//
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: -fopenmp=libiomp5 -target x86_64-unknown-linux \
// RUN: | FileCheck --check-prefix=CHECK-IOMP5-LD-64 %s
// CHECK-IOMP5-LD-64: "{{.*}}ld{{(.exe)?}}"
// CHECK-IOMP5-LD-64: "-liomp5"
// CHECK-IOMP5-LD-64: "-liomp5" "-lgcc"
// CHECK-IOMP5-LD-64: "-lpthread" "-lc"
//
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: -fopenmp=lib -target i386-unknown-linux \