View | Details | Raw Unified | Return to bug 210337 | Differences between
and this patch

Collapse All | Expand All

(-)Mk/Uses/compiler.mk (-1 / +21 lines)
Lines 96-103 Link Here
96
96
97
.if ${_COMPILER_ARGS:Mopenmp}
97
.if ${_COMPILER_ARGS:Mopenmp}
98
.if ${COMPILER_TYPE} == clang
98
.if ${COMPILER_TYPE} == clang
99
USE_GCC=	yes
99
.if ${ARCH} == amd64
100
_USES_POST+=	localbase:ldflags
101
.if ${COMPILER_VERSION} < 38
102
BUILD_DEPENDS+=	llvm40>=0:devel/llvm40
103
CPP=	${LOCALBASE}/bin/clang-cpp40
104
CC=	${LOCALBASE}/bin/clang40
105
CXX=	${LOCALBASE}/bin/clang++40
106
CHOSEN_COMPILER_TYPE=	clang
107
.endif
108
LIB_DEPENDS+=	libomp.so.0:devel/openmp
109
.else
110
USE_GCC=		yes
100
CHOSEN_COMPILER_TYPE=	gcc
111
CHOSEN_COMPILER_TYPE=	gcc
112
.if ${COMPILER_FEATURES:Mlibc++}
113
CXXFLAGS+=	-nostdinc++ -isystem /usr/include/c++/v1
114
LDFLAGS+=	-L${WRKDIR}
115
116
_USES_configure+=	200:gcc-libc++-configure
117
gcc-libc++-configure:
118
	@${LN} -fs /usr/lib/libc++.so ${WRKDIR}/libstdc++.so
119
.endif
120
.endif
101
.endif
121
.endif
102
.endif
122
.endif
103
123
(-)devel/llvm40/Makefile (-1 / +2 lines)
Lines 2-8 Link Here
2
2
3
PORTNAME=	llvm
3
PORTNAME=	llvm
4
DISTVERSION=	4.0.0
4
DISTVERSION=	4.0.0
5
PORTREVISION=	4
5
PORTREVISION=	5
6
CATEGORIES=	devel lang
6
CATEGORIES=	devel lang
7
MASTER_SITES=	http://llvm.org/${PRE_}releases/${LLVM_RELEASE}/${RCDIR}
7
MASTER_SITES=	http://llvm.org/${PRE_}releases/${LLVM_RELEASE}/${RCDIR}
8
PKGNAMESUFFIX=	${LLVM_SUFFIX}
8
PKGNAMESUFFIX=	${LLVM_SUFFIX}
Lines 344-349 Link Here
344
	    -e 's|lit\.|lit${LLVM_SUFFIX}.|' \
344
	    -e 's|lit\.|lit${LLVM_SUFFIX}.|' \
345
	    ${WRKSRC}/utils/lit/lit.py ${WRKSRC}/utils/lit/lit/*.py \
345
	    ${WRKSRC}/utils/lit/lit.py ${WRKSRC}/utils/lit/lit/*.py \
346
	    ${WRKSRC}/utils/lit/lit/formats/*.py
346
	    ${WRKSRC}/utils/lit/lit/formats/*.py
347
	    ${REINPLACE_CMD} -e 's|CMAKE_INSTALL_PREFIX|${CMAKE_INSTALL_PREFIX}|g' ${WRKSRC}/tools/clang/lib/Driver/Tools.cpp
347
348
348
post-patch-CLANG-on:
349
post-patch-CLANG-on:
349
	${REINPLACE_CMD} -e 's|%%LLVM_PREFIX%%|${LLVM_PREFIX}|' \
350
	${REINPLACE_CMD} -e 's|%%LLVM_PREFIX%%|${LLVM_PREFIX}|' \
(-)devel/llvm40/files/clang-patch-fopenmp.diff (-10 / +13 lines)
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:
(-)math/openblas/Makefile (+1 lines)
Lines 73-78 Link Here
73
.endif
73
.endif
74
74
75
.if ${PORT_OPTIONS:MOPENMP}
75
.if ${PORT_OPTIONS:MOPENMP}
76
USE_GCC=	yes
76
USES+=		compiler:openmp
77
USES+=		compiler:openmp
77
BUILDFLAGS_THREAD+=	USE_OPENMP=1
78
BUILDFLAGS_THREAD+=	USE_OPENMP=1
78
.endif
79
.endif

Return to bug 210337