From fec65ff9a65e73091d9f8117e6a072b79a6b8363 Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Fri, 7 Mar 2014 07:43:52 +0000 Subject: [PATCH] [OPENMP] Fixed linked libraries for libiomp5 on Linux git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203212 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Driver/Tools.cpp | 2 +- test/OpenMP/linking.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index 86a62376ab..d76ff5cde0 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -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"); diff --git a/test/OpenMP/linking.c b/test/OpenMP/linking.c index 586e4606d1..979ba1f4e4 100644 --- a/test/OpenMP/linking.c +++ b/test/OpenMP/linking.c @@ -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 \ -- 2.40.0