diff options
author | Brooks Davis <brooks@FreeBSD.org> | 2016-09-02 21:33:05 +0000 |
---|---|---|
committer | Brooks Davis <brooks@FreeBSD.org> | 2016-09-02 21:33:05 +0000 |
commit | 77dde08b76f00b5f600402c6674643b8b7100b84 (patch) | |
tree | 6d82e19c8a7d81f27f166372b0a1c00cb66c70ae /devel/llvm38/files/clang-patch-fopenmp.diff | |
parent | Fix on 11. (diff) |
Add a hack to make -fopenmp work inspired by a submission from
Johannes Dieterich <dieterich@ogolem.org>.
This differs from the submission in that it adds the library directly
to the linker command line. I chose not to add the llvm library to the
search path because that would (e.g.) make it hard to link something
that uses a different version of llvm.
Notes
Notes:
svn path=/head/; revision=421277
Diffstat (limited to 'devel/llvm38/files/clang-patch-fopenmp.diff')
-rw-r--r-- | devel/llvm38/files/clang-patch-fopenmp.diff | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/devel/llvm38/files/clang-patch-fopenmp.diff b/devel/llvm38/files/clang-patch-fopenmp.diff new file mode 100644 index 000000000000..5216a420e710 --- /dev/null +++ b/devel/llvm38/files/clang-patch-fopenmp.diff @@ -0,0 +1,28 @@ +--- tools/clang/lib/Driver/Tools.cpp.orig 2016-09-02 19:55:01.000873648 +0000 ++++ tools/clang/lib/Driver/Tools.cpp 2016-09-02 19:54:32.001875868 +0000 +@@ -2733,13 +2733,22 @@ + + switch (getOpenMPRuntime(TC, Args)) { + case OMPRT_OMP: +- CmdArgs.push_back("-lomp"); ++ if (TC.getTriple().getOS() != llvm::Triple::FreeBSD || TC.isCrossCompiling() || !llvm::sys::fs::exists("%%LLVM_PREFIX%%/lib/libomp.so")) ++ CmdArgs.push_back("-lomp"); ++ else ++ CmdArgs.push_back("%%LLVM_PREFIX%%/lib/libomp.so"); + break; + case OMPRT_GOMP: +- CmdArgs.push_back("-lgomp"); ++ if (TC.getTriple().getOS() != llvm::Triple::FreeBSD || TC.isCrossCompiling() || !llvm::sys::fs::exists("%%LLVM_PREFIX%%/lib/libomp.so")) ++ CmdArgs.push_back("-lgomp"); ++ else ++ CmdArgs.push_back("%%LLVM_PREFIX%%/lib/libgomp.so"); + break; + case OMPRT_IOMP5: +- CmdArgs.push_back("-liomp5"); ++ if (TC.getTriple().getOS() != llvm::Triple::FreeBSD || TC.isCrossCompiling() || !llvm::sys::fs::exists("%%LLVM_PREFIX%%/lib/libomp.so")) ++ CmdArgs.push_back("-liomp5"); ++ else ++ CmdArgs.push_back("%%LLVM_PREFIX%%/lib/libiomp5.so"); + break; + case OMPRT_Unknown: + // Already diagnosed. |