Lines 1-32
Link Here
|
1 |
--- tools/clang/lib/Driver/Tools.cpp.orig 2017-01-26 08:40:33.955918000 +0000 |
1 |
--- tools/clang/lib/Driver/Tools.cpp.orig 2017-04-15 22:54:19.427146000 -0400 |
2 |
+++ tools/clang/lib/Driver/Tools.cpp 2017-01-26 09:41:36.791095000 +0000 |
2 |
+++ tools/clang/lib/Driver/Tools.cpp 2017-04-15 23:10:14.340304000 -0400 |
3 |
@@ -3216,13 +3216,22 @@ |
3 |
@@ -3216,13 +3216,25 @@ |
4 |
|
4 |
|
5 |
switch (TC.getDriver().getOpenMPRuntime(Args)) { |
5 |
switch (TC.getDriver().getOpenMPRuntime(Args)) { |
6 |
case Driver::OMPRT_OMP: |
6 |
case Driver::OMPRT_OMP: |
7 |
- CmdArgs.push_back("-lomp"); |
7 |
- CmdArgs.push_back("-lomp"); |
8 |
+ if (TC.getTriple().getOS() != llvm::Triple::FreeBSD || TC.isCrossCompiling() || !llvm::sys::fs::exists("/usr/local/llvm40/lib/libomp.so")) |
8 |
+ if (TC.getTriple().getOS() != llvm::Triple::FreeBSD || TC.isCrossCompiling() || !llvm::sys::fs::exists("/usr/local/llvm40/lib/libomp.so")){ |
|
|
9 |
+ CmdArgs.push_back("-LCMAKE_INSTALL_PREFIX/lib"); |
9 |
+ CmdArgs.push_back("-lomp"); |
10 |
+ CmdArgs.push_back("-lomp"); |
10 |
+ else |
11 |
+ } else |
11 |
+ CmdArgs.push_back("/usr/local/llvm40/lib/libomp.so"); |
12 |
+ CmdArgs.push_back("/usr/local/llvm40/lib/libomp.so"); |
12 |
break; |
13 |
break; |
13 |
case Driver::OMPRT_GOMP: |
14 |
case Driver::OMPRT_GOMP: |
14 |
- CmdArgs.push_back("-lgomp"); |
15 |
- CmdArgs.push_back("-lgomp"); |
15 |
+ if (TC.getTriple().getOS() != llvm::Triple::FreeBSD || TC.isCrossCompiling() || !llvm::sys::fs::exists("/usr/local/llvm40/lib/libgomp.so")) |
16 |
+ if (TC.getTriple().getOS() != llvm::Triple::FreeBSD || TC.isCrossCompiling() || !llvm::sys::fs::exists("/usr/local/llvm40/lib/libgomp.so")){ |
|
|
17 |
+ CmdArgs.push_back("-LCMAKE_INSTALL_PREFIX/lib"); |
16 |
+ CmdArgs.push_back("-lgomp"); |
18 |
+ CmdArgs.push_back("-lgomp"); |
17 |
+ else |
19 |
+ } else |
18 |
+ CmdArgs.push_back("/usr/local/llvm40/lib/libgomp.so"); |
20 |
+ CmdArgs.push_back("/usr/local/llvm40/lib/libgomp.so"); |
19 |
break; |
21 |
break; |
20 |
case Driver::OMPRT_IOMP5: |
22 |
case Driver::OMPRT_IOMP5: |
21 |
- CmdArgs.push_back("-liomp5"); |
23 |
- CmdArgs.push_back("-liomp5"); |
22 |
+ if (TC.getTriple().getOS() != llvm::Triple::FreeBSD || TC.isCrossCompiling() || !llvm::sys::fs::exists("/usr/local/llvm40/lib/libiomp5.so")) |
24 |
+ if (TC.getTriple().getOS() != llvm::Triple::FreeBSD || TC.isCrossCompiling() || !llvm::sys::fs::exists("/usr/local/llvm40/lib/libiomp5.so")){ |
|
|
25 |
+ CmdArgs.push_back("-LCMAKE_INSTALL_PREFIX/lib"); |
23 |
+ CmdArgs.push_back("-liomp5"); |
26 |
+ CmdArgs.push_back("-liomp5"); |
24 |
+ else |
27 |
+ } else |
25 |
+ CmdArgs.push_back("/usr/local/llvm40/lib/libiomp5.so"); |
28 |
+ CmdArgs.push_back("/usr/local/llvm40/lib/libiomp5.so"); |
26 |
break; |
29 |
break; |
27 |
case Driver::OMPRT_Unknown: |
30 |
case Driver::OMPRT_Unknown: |
28 |
// Already diagnosed. |
31 |
// Already diagnosed. |
29 |
@@ -10235,17 +10244,26 @@ |
32 |
@@ -10239,17 +10251,26 @@ |
30 |
// Also link the particular OpenMP runtimes. |
33 |
// Also link the particular OpenMP runtimes. |
31 |
switch (ToolChain.getDriver().getOpenMPRuntime(Args)) { |
34 |
switch (ToolChain.getDriver().getOpenMPRuntime(Args)) { |
32 |
case Driver::OMPRT_OMP: |
35 |
case Driver::OMPRT_OMP: |