[PATCH] [OPENMP] Replace libgomp by libiomp5 in driver
Alexey Bataev
a.bataev at hotmail.com
Thu Feb 20 01:15:07 PST 2014
Hi doug.gregor, hfinkel, cbergstrom, gribozavr, fraggamuffin,
http://llvm-reviews.chandlerc.com/D2841
Files:
test/OpenMP/linking.c
lib/Driver/Tools.cpp
Index: test/OpenMP/linking.c
===================================================================
--- test/OpenMP/linking.c
+++ test/OpenMP/linking.c
@@ -5,12 +5,12 @@
// RUN: -fopenmp -target i386-unknown-linux \
// RUN: | FileCheck --check-prefix=CHECK-LD-32 %s
// CHECK-LD-32: "{{.*}}ld{{(.exe)?}}"
-// CHECK-LD-32: "-lgomp" "-lrt" "-lgcc"
-// CHECK-LD-32: "-lpthread" "-lc"
+// CHECK-LD-32: "-liomp5" "-lgcc"
+// CHECK-LD-32: "-lc"
//
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: -fopenmp -target x86_64-unknown-linux \
// RUN: | FileCheck --check-prefix=CHECK-LD-64 %s
// CHECK-LD-64: "{{.*}}ld{{(.exe)?}}"
-// CHECK-LD-64: "-lgomp" "-lrt" "-lgcc"
-// CHECK-LD-64: "-lpthread" "-lc"
+// CHECK-LD-64: "-liomp5" "-lgcc"
+// CHECK-LD-64: "-lc"
Index: lib/Driver/Tools.cpp
===================================================================
--- lib/Driver/Tools.cpp
+++ lib/Driver/Tools.cpp
@@ -5200,8 +5200,7 @@
Args.AddAllArgs(CmdArgs, options::OPT_L);
if (Args.hasArg(options::OPT_fopenmp))
- // This is more complicated in gcc...
- CmdArgs.push_back("-lgomp");
+ CmdArgs.push_back("-liomp5");
AddLinkerInputs(getToolChain(), Inputs, Args, CmdArgs);
@@ -6797,19 +6796,13 @@
if (Args.hasArg(options::OPT_static))
CmdArgs.push_back("--start-group");
- bool OpenMP = Args.hasArg(options::OPT_fopenmp);
- if (OpenMP) {
- CmdArgs.push_back("-lgomp");
-
- // FIXME: Exclude this for platforms with libgomp that don't require
- // librt. Most modern Linux platforms require it, but some may not.
- CmdArgs.push_back("-lrt");
- }
+ if (Args.hasArg(options::OPT_fopenmp))
+ CmdArgs.push_back("-liomp5");
AddRunTimeLibs(ToolChain, D, CmdArgs, Args);
if (Args.hasArg(options::OPT_pthread) ||
- Args.hasArg(options::OPT_pthreads) || OpenMP)
+ Args.hasArg(options::OPT_pthreads))
CmdArgs.push_back("-lpthread");
CmdArgs.push_back("-lc");
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D2841.1.patch
Type: text/x-patch
Size: 2025 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140220/f89e50b2/attachment.bin>
More information about the cfe-commits
mailing list