]> granicus.if.org Git - clang/commitdiff
[OPENMP] Fixed linked libraries for libiomp5 on Linux
authorAlexey Bataev <a.bataev@hotmail.com>
Fri, 7 Mar 2014 07:43:52 +0000 (07:43 +0000)
committerAlexey Bataev <a.bataev@hotmail.com>
Fri, 7 Mar 2014 07:43:52 +0000 (07:43 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203212 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/Tools.cpp
test/OpenMP/linking.c

index 86a62376abdc4970c238f9d682f9c209c6c11883..d76ff5cde051ab69d8afffa93482fa80076ae8fe 100644 (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");
index 586e4606d100fef870ea23196b1906589058d344..979ba1f4e41ee8439904922898d3d44112222388 100644 (file)
 // 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 \