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

Collapse All | Expand All

(-)graphics/libGL/Makefile.common (-7 / +5 lines)
Lines 18-24 Link Here
18
MESAVERSION=	${MESABASEVERSION}${MESASUBVERSION:C/^(.)/.\1/}
18
MESAVERSION=	${MESABASEVERSION}${MESASUBVERSION:C/^(.)/.\1/}
19
MESADISTVERSION=${MESABASEVERSION}${MESASUBVERSION:C/^(.)/-\1/}
19
MESADISTVERSION=${MESABASEVERSION}${MESASUBVERSION:C/^(.)/-\1/}
20
20
21
MESABASEVERSION=	13.0.6
21
MESABASEVERSION=	17.0.3
22
# if there is a subversion, don't include the '-' between 7.11-rc2.
22
# if there is a subversion, don't include the '-' between 7.11-rc2.
23
MESASUBVERSION=
23
MESASUBVERSION=
24
24
Lines 31-38 DISTFILES= mesa-${MESADISTVERSION}${EXTRACT_SUFX} Link Here
31
31
32
MAINTAINER=	x11@FreeBSD.org
32
MAINTAINER=	x11@FreeBSD.org
33
33
34
BUILD_DEPENDS+=	makedepend:devel/makedepend
35
36
USES+=		compiler:c++11-lib bison gettext-tools gmake libtool \
34
USES+=		compiler:c++11-lib bison gettext-tools gmake libtool \
37
		localbase pathfix pkgconfig python:2,build shebangfix tar:xz
35
		localbase pathfix pkgconfig python:2,build shebangfix tar:xz
38
USE_LDCONFIG=	yes
36
USE_LDCONFIG=	yes
Lines 63-69 INSTALL_TARGET= install-strip Link Here
63
COMPONENT=		${PORTNAME:tl:C/^lib//:C/mesa-//}
61
COMPONENT=		${PORTNAME:tl:C/^lib//:C/mesa-//}
64
62
65
.if (${ARCH} != sparc64 && ${ARCH} != ia64)	# no working LLVM
63
.if (${ARCH} != sparc64 && ${ARCH} != ia64)	# no working LLVM
66
MESA_LLVM_VER?=	39
64
MESA_LLVM_VER?=	40
67
LDFLAGS+=	-Wl,-rpath=${LOCALBASE}/llvm${MESA_LLVM_VER}/lib
65
LDFLAGS+=	-Wl,-rpath=${LOCALBASE}/llvm${MESA_LLVM_VER}/lib
68
.endif
66
.endif
69
67
Lines 120-128 CONFIGURE_ARGS+= --enable-osmesa --enable-xvmc Link Here
120
118
121
# gallium
119
# gallium
122
.if (${MESA_LLVM_VER} != "")
120
.if (${MESA_LLVM_VER} != "")
123
BUILD_DEPENDS+= llvm${MESA_LLVM_VER}>=3.9.0_4:devel/llvm${MESA_LLVM_VER}
121
BUILD_DEPENDS+=	llvm${MESA_LLVM_VER}>=3.6:devel/llvm${MESA_LLVM_VER}
124
.if ${COMPONENT:Mdri} != "" || ${COMPONENT:Mclover} != "" || ${COMPONENT:Megl} != ""
122
.if ${COMPONENT:Mdri} != "" || ${COMPONENT:Mclover} != "" || ${COMPONENT:Megl} != ""
125
RUN_DEPENDS+=   llvm${MESA_LLVM_VER}>=3.9.0_4:devel/llvm${MESA_LLVM_VER}
123
RUN_DEPENDS+=	llvm${MESA_LLVM_VER}>=3.6:devel/llvm${MESA_LLVM_VER}
126
.endif
124
.endif
127
125
128
CONFIGURE_ENV+= LLVM_CONFIG=${LOCALBASE}/bin/llvm-config${MESA_LLVM_VER}
126
CONFIGURE_ENV+= LLVM_CONFIG=${LOCALBASE}/bin/llvm-config${MESA_LLVM_VER}
Lines 130-136 CONFIGURE_ENV+= LLVM_CONFIG=${LOCALBASE}/bin/llvm- Link Here
130
CONFIGURE_ARGS+=	--enable-gallium-llvm --enable-llvm-shared-libs
128
CONFIGURE_ARGS+=	--enable-gallium-llvm --enable-llvm-shared-libs
131
.else
129
.else
132
CONFIGURE_ARGS+=	--disable-gallium-llvm
130
CONFIGURE_ARGS+=	--disable-gallium-llvm
133
.endif
131
.endif # ${MESA_LLVM_VER} != ""
134
132
135
.if ${PORT_OPTIONS:MTEXTURE}
133
.if ${PORT_OPTIONS:MTEXTURE}
136
CONFIGURE_ARGS+=--enable-texture-float
134
CONFIGURE_ARGS+=--enable-texture-float
(-)graphics/libGL/Makefile.targets (-3 / +3 lines)
Lines 4-10 Link Here
4
4
5
post-patch:
5
post-patch:
6
.if ${OPSYS} == FreeBSD
6
.if ${OPSYS} == FreeBSD
7
	@${REINPLACE_CMD} -e 's|x86_64|amd64|' -e 's|\\S\*//|[:space:]* //|' \
7
	@${REINPLACE_CMD} -e 's|x86_64|amd64|' \
8
		${WRKSRC}/configure
8
		${WRKSRC}/configure
9
# Clang 3.4 in 10.x on i386 fails with the following error when using "GCC atomics"
9
# Clang 3.4 in 10.x on i386 fails with the following error when using "GCC atomics"
10
#
10
#
Lines 16-23 post-patch: Link Here
16
	@${REINPLACE_CMD} -e 's|-DUSE_GCC_ATOMIC_BUILTINS||' ${WRKSRC}/configure
16
	@${REINPLACE_CMD} -e 's|-DUSE_GCC_ATOMIC_BUILTINS||' ${WRKSRC}/configure
17
.endif
17
.endif
18
.else # ${OPSYS} == DragonFly
18
.else # ${OPSYS} == DragonFly
19
#	Sed on dragonfly doesn't support \< or \>
19
#	DragonFly's sed lacks \< or \> while GNU sed lacks [[:<:]] or [[:>:]]
20
	@${REINPLACE_CMD} -e 's|\\>//|[[:>:]]//|' -e 's|\\S\*//|[:space:]* //|' \
20
	@${REINPLACE_CMD} -e 's|\\>//|[[:>:]]//|' \
21
		${WRKSRC}/configure
21
		${WRKSRC}/configure
22
.endif # ${OPSYS}
22
.endif # ${OPSYS}
23
	@${REINPLACE_CMD} -e 's|/etc/|${PREFIX}/etc/|g' \
23
	@${REINPLACE_CMD} -e 's|/etc/|${PREFIX}/etc/|g' \
(-)graphics/libGL/distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
TIMESTAMP = 1490202594
1
TIMESTAMP = 1491060851
2
SHA256 (mesa-13.0.6.tar.xz) = 29ef104a7fc082d352b1599bd6cb1d040be424ccd22f5e0eb7ee9b0e9acd3597
2
SHA256 (mesa-17.0.3.tar.xz) = ca646f5075a002d60ef9123c8a4331cede155c01712ef945a65c59a5e69fe7ed
3
SIZE (mesa-13.0.6.tar.xz) = 9179236
3
SIZE (mesa-17.0.3.tar.xz) = 9485792
(-)graphics/libGL/files/configure.ac (-48 / +53 lines)
Lines 1-35 Link Here
1
--- configure.ac.orig	2016-06-21 14:31:09.000000000 +0200
1
--- configure.ac.orig	2017-03-04 15:46:53 UTC
2
+++ configure.ac	2016-07-08 13:05:53.236433000 +0200
2
+++ configure.ac
3
@@ -871,7 +872,7 @@
3
@@ -943,18 +943,18 @@ llvm_add_target() {
4
     [enable_dri=yes])
4
 # $1 is the llvm-config command with arguments.
5
 strip_unwanted_llvm_flags() {
6
     # Use \> (marks the end of the word)
7
-    echo " `$1`" | sed \
8
-        -e 's/\s\+-m\S*//g' \
9
-        -e 's/\s\+-DNDEBUG\>//g' \
10
-        -e 's/\s\+-D_GNU_SOURCE\>//g' \
11
-        -e 's/\s\+-pedantic\>//g' \
12
-        -e 's/\s\+-W\S*//g' \
13
-        -e 's/\s\+-O\S*//g' \
14
-        -e 's/\s\+-g\S*//g' \
15
+    echo " `$1`" | sed -E \
16
+        -e 's/[[[:space:]]]+-m[[^[:space:]]]*//g' \
17
+        -e 's/[[[:space:]]]+-DNDEBUG\>//g' \
18
+        -e 's/[[[:space:]]]+-D_GNU_SOURCE\>//g' \
19
+        -e 's/[[[:space:]]]+-pedantic\>//g' \
20
+        -e 's/[[[:space:]]]+-W[[^[:space:]]]*//g' \
21
+        -e 's/[[[:space:]]]+-O[[^[:space:]]]*//g' \
22
+        -e 's/[[[:space:]]]+-g[[^[:space:]]]*//g' \
23
         -e 's/-fno-rtti\>/-Fno-rtti/g' \
24
-        -e 's/\s\+-f\S*//g' \
25
+        -e 's/[[[:space:]]]+-f[[^[:space:]]]*//g' \
26
         -e 's/-Fno-rtti\>/-fno-rtti/g' \
27
-        -e 's/^ //'
28
+        -e 's/^[[[:space:]]]//'
29
 }
5
 
30
 
31
 llvm_set_environment_variables() {
32
@@ -1121,7 +1121,7 @@ fi
33
 AC_SUBST(LIBSENSORS_LIBS)
34
 
6
 case "$host_os" in
35
 case "$host_os" in
7
-linux*)
36
-linux*)
8
+linux*|freebsd*)
37
+linux* | freebsd*)
9
     dri3_default=yes
38
     dri3_default=yes
10
     ;;
39
     ;;
11
 *)
40
 *)
12
@@ -1540,6 +1548,19 @@
41
@@ -1631,7 +1631,7 @@ dnl platform checks. Set DEFINES and LIB
13
         ;;
42
 if test "x$enable_dri" = xyes; then
14
     gnu*)
43
     # Platform specific settings and drivers to build
15
         DEFINES="$DEFINES -DHAVE_ALIAS"
44
     case "$host_os" in
16
+dnl not sure about dri3 support, just enable it for now.
45
-    linux*)
17
+        if test "x$enable_dri3" = xyes; then
46
+    linux* | *freebsd* | dragonfly* | *netbsd* | openbsd*)
18
+            DEFINES="$DEFINES -DHAVE_DRI3"
47
         if test "x$enable_dri3" = xyes; then
19
+        fi
48
             DEFINES="$DEFINES -DHAVE_DRI3"
20
+
49
         fi
21
+        case "$host_cpu" in
50
@@ -2002,9 +2002,19 @@ if test "x$enable_opencl" = xyes; then
22
+        powerpc* | sparc*)
23
+            # Build only the drivers for cards that exist on PowerPC/sparc
24
+            if test "x$with_dri_drivers" = "xyes"; then
25
+                with_dri_drivers="r200 radeon swrast"
26
+            fi
27
+            ;;
28
+        esac
29
         ;;
30
     cygwin*)
31
         if test "x$with_dri_drivers" = "xyes"; then
32
@@ -1921,9 +1948,19 @@
33
         AC_MSG_ERROR([cannot enable OpenCL without Gallium])
51
         AC_MSG_ERROR([cannot enable OpenCL without Gallium])
34
     fi
52
     fi
35
 
53
 
Lines 49-73 Link Here
49
 
67
 
50
     if test "x$have_libclc" = xno; then
68
     if test "x$have_libclc" = xno; then
51
         AC_MSG_ERROR([pkg-config cannot find libclc.pc which is required to build clover.
69
         AC_MSG_ERROR([pkg-config cannot find libclc.pc which is required to build clover.
52
@@ -2102,9 +2139,9 @@
70
@@ -2047,8 +2057,6 @@ if test "x$enable_opencl" = xyes; then
53
 strip_unwanted_llvm_flags() {
71
         CLANG_LIBDIR=${LLVM_LIBDIR}
54
     # Use \> (marks the end of the word)
72
     fi
55
     echo `$1` | sed \
73
     CLANG_RESOURCE_DIR=$CLANG_LIBDIR/clang/${LLVM_VERSION}
56
-	-e 's/-march=\S*//g' \
74
-    AS_IF([test ! -f "$CLANG_RESOURCE_DIR/include/stddef.h"],
57
-	-e 's/-mtune=\S*//g' \
75
-        [AC_MSG_ERROR([Could not find clang internal header stddef.h in $CLANG_RESOURCE_DIR Use --with-clang-libdir to specify the correct path to the clang libraries.])])
58
-	-e 's/-mcpu=\S*//g' \
76
 fi
59
+	-e 's/-march=[[:graph:]]* //g' \
77
 AM_CONDITIONAL(HAVE_CLOVER, test "x$enable_opencl" = xyes)
60
+	-e 's/-mtune=[[:graph:]]* //g' \
78
 AM_CONDITIONAL(HAVE_CLOVER_ICD, test "x$enable_opencl_icd" = xyes)
61
+	-e 's/-mcpu=[[:graph:]]* //g' \
62
 	-e 's/-DNDEBUG\>//g' \
63
 	-e 's/-D_GNU_SOURCE\>//g' \
64
 	-e 's/-pedantic\>//g' \
65
@@ -2196,8 +2233,6 @@
66
                 CLANG_LIBDIR=${LLVM_LIBDIR}
67
             fi
68
             CLANG_RESOURCE_DIR=$CLANG_LIBDIR/clang/${LLVM_VERSION}
69
-            AS_IF([test ! -f "$CLANG_RESOURCE_DIR/include/stddef.h"],
70
-                [AC_MSG_ERROR([Could not find clang internal header stddef.h in $CLANG_RESOURCE_DIR Use --with-clang-libdir to specify the correct path to the clang libraries.])])
71
         fi
72
     else
73
         MESA_LLVM=0
(-)graphics/libGL/files/patch-configure (-31 / +52 lines)
Lines 1-34 Link Here
1
--- configure.orig	2017-01-05 15:52:21 UTC
1
Don't forget to keep files/configure.ac in sync
2
3
--- configure.orig	2017-03-04 15:47:01 UTC
2
+++ configure
4
+++ configure
3
@@ -21955,7 +21955,7 @@ fi
5
@@ -22307,18 +22307,18 @@ llvm_add_target() {
6
 # $1 is the llvm-config command with arguments.
7
 strip_unwanted_llvm_flags() {
8
     # Use \> (marks the end of the word)
9
-    echo " `$1`" | sed \
10
-        -e 's/\s\+-m\S*//g' \
11
-        -e 's/\s\+-DNDEBUG\>//g' \
12
-        -e 's/\s\+-D_GNU_SOURCE\>//g' \
13
-        -e 's/\s\+-pedantic\>//g' \
14
-        -e 's/\s\+-W\S*//g' \
15
-        -e 's/\s\+-O\S*//g' \
16
-        -e 's/\s\+-g\S*//g' \
17
+    echo " `$1`" | sed -E \
18
+        -e 's/[[:space:]]+-m[^[:space:]]*//g' \
19
+        -e 's/[[:space:]]+-DNDEBUG\>//g' \
20
+        -e 's/[[:space:]]+-D_GNU_SOURCE\>//g' \
21
+        -e 's/[[:space:]]+-pedantic\>//g' \
22
+        -e 's/[[:space:]]+-W[^[:space:]]*//g' \
23
+        -e 's/[[:space:]]+-O[^[:space:]]*//g' \
24
+        -e 's/[[:space:]]+-g[^[:space:]]*//g' \
25
         -e 's/-fno-rtti\>/-Fno-rtti/g' \
26
-        -e 's/\s\+-f\S*//g' \
27
+        -e 's/[[:space:]]+-f[^[:space:]]*//g' \
28
         -e 's/-Fno-rtti\>/-fno-rtti/g' \
29
-        -e 's/^ //'
30
+        -e 's/^[[:space:]]//'
31
 }
4
 
32
 
33
 llvm_set_environment_variables() {
34
@@ -22516,7 +22516,7 @@ fi
5
 
35
 
36
 
6
 case "$host_os" in
37
 case "$host_os" in
7
-linux*)
38
-linux*)
8
+linux*|freebsd*)
39
+linux* | freebsd*)
9
     dri3_default=yes
40
     dri3_default=yes
10
     ;;
41
     ;;
11
 *)
42
 *)
12
@@ -23968,6 +23968,18 @@ if test "x$enable_dri" = xyes; then
43
@@ -24055,7 +24055,7 @@ fi
13
         ;;
44
 if test "x$enable_dri" = xyes; then
14
     *freebsd* | dragonfly* | *netbsd* | openbsd*)
45
     # Platform specific settings and drivers to build
15
         DEFINES="$DEFINES -DHAVE_ALIAS"
46
     case "$host_os" in
16
+        if test "x$enable_dri3" = xyes; then
47
-    linux*)
17
+            DEFINES="$DEFINES -DHAVE_DRI3"
48
+    linux* | *freebsd* | dragonfly* | *netbsd* | openbsd*)
18
+        fi
49
         if test "x$enable_dri3" = xyes; then
19
+
50
             DEFINES="$DEFINES -DHAVE_DRI3"
20
+        case "$host_cpu" in
51
         fi
21
+        powerpc* | sparc*)
52
@@ -25807,9 +25807,19 @@ if test "x$enable_opencl" = xyes; then
22
+            # Build only the drivers for cards that exist on PowerPC/sparc
23
+            if test "x$with_dri_drivers" = "xyes"; then
24
+                with_dri_drivers="r200 radeon swrast"
25
+            fi
26
+            ;;
27
+        esac
28
         ;;
29
     gnu*)
30
         DEFINES="$DEFINES -DHAVE_ALIAS"
31
@@ -25849,9 +25861,19 @@ if test "x$enable_opencl" = xyes; then
32
         as_fn_error $? "cannot enable OpenCL without Gallium" "$LINENO" 5
53
         as_fn_error $? "cannot enable OpenCL without Gallium" "$LINENO" 5
33
     fi
54
     fi
34
 
55
 
Lines 48-60 Link Here
48
 
69
 
49
     if test "x$have_libclc" = xno; then
70
     if test "x$have_libclc" = xno; then
50
         as_fn_error $? "pkg-config cannot find libclc.pc which is required to build clover.
71
         as_fn_error $? "pkg-config cannot find libclc.pc which is required to build clover.
51
@@ -26670,9 +26692,6 @@ fi
72
@@ -25851,9 +25861,6 @@ if test "x$enable_opencl" = xyes; then
52
                 CLANG_LIBDIR=${LLVM_LIBDIR}
73
         CLANG_LIBDIR=${LLVM_LIBDIR}
53
             fi
74
     fi
54
             CLANG_RESOURCE_DIR=$CLANG_LIBDIR/clang/${LLVM_VERSION}
75
     CLANG_RESOURCE_DIR=$CLANG_LIBDIR/clang/${LLVM_VERSION}
55
-            if test ! -f "$CLANG_RESOURCE_DIR/include/stddef.h"; then :
76
-    if test ! -f "$CLANG_RESOURCE_DIR/include/stddef.h"; then :
56
-  as_fn_error $? "Could not find clang internal header stddef.h in $CLANG_RESOURCE_DIR Use --with-clang-libdir to specify the correct path to the clang libraries." "$LINENO" 5
77
-  as_fn_error $? "Could not find clang internal header stddef.h in $CLANG_RESOURCE_DIR Use --with-clang-libdir to specify the correct path to the clang libraries." "$LINENO" 5
57
-fi
78
-fi
58
         fi
79
 fi
59
     else
80
  if test "x$enable_opencl" = xyes; then
60
         MESA_LLVM=0
81
   HAVE_CLOVER_TRUE=
(-)graphics/libGL/files/patch-llvm50 (+94 lines)
Line 0 Link Here
1
https://cgit.freedesktop.org/mesa/mesa/commit/?id=84012262ea70
2
https://cgit.freedesktop.org/mesa/mesa/commit/?id=6e2b9fd07171
3
https://cgit.freedesktop.org/mesa/mesa/commit/?id=d9f8bae616dd
4
5
--- src/amd/common/ac_llvm_helper.cpp.orig	2017-04-01 15:33:36 UTC
6
+++ src/amd/common/ac_llvm_helper.cpp
7
@@ -37,18 +37,24 @@
8
 #include <llvm/ExecutionEngine/ExecutionEngine.h>
9
 #include <llvm/IR/Attributes.h>
10
 
11
+#if HAVE_LLVM < 0x0500
12
+namespace llvm {
13
+typedef AttributeSet AttributeList;
14
+}
15
+#endif
16
+
17
 void ac_add_attr_dereferenceable(LLVMValueRef val, uint64_t bytes)
18
 {
19
    llvm::Argument *A = llvm::unwrap<llvm::Argument>(val);
20
    llvm::AttrBuilder B;
21
    B.addDereferenceableAttr(bytes);
22
-   A->addAttr(llvm::AttributeSet::get(A->getContext(), A->getArgNo() + 1,  B));
23
+   A->addAttr(llvm::AttributeList::get(A->getContext(), A->getArgNo() + 1,  B));
24
 }
25
 
26
 bool ac_is_sgpr_param(LLVMValueRef arg)
27
 {
28
 	llvm::Argument *A = llvm::unwrap<llvm::Argument>(arg);
29
-	llvm::AttributeSet AS = A->getParent()->getAttributes();
30
+	llvm::AttributeList AS = A->getParent()->getAttributes();
31
 	unsigned ArgNo = A->getArgNo();
32
 	return AS.hasAttribute(ArgNo + 1, llvm::Attribute::ByVal) ||
33
 	       AS.hasAttribute(ArgNo + 1, llvm::Attribute::InReg);
34
--- src/gallium/auxiliary/gallivm/lp_bld_misc.cpp.orig	2017-04-01 15:33:37 UTC
35
+++ src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
36
@@ -755,17 +755,6 @@ lp_free_memory_manager(LLVMMCJITMemoryMa
37
    delete reinterpret_cast<BaseMemoryManager*>(memorymgr);
38
 }
39
 
40
-extern "C" void
41
-lp_add_attr_dereferenceable(LLVMValueRef val, uint64_t bytes)
42
-{
43
-#if HAVE_LLVM >= 0x0306
44
-   llvm::Argument *A = llvm::unwrap<llvm::Argument>(val);
45
-   llvm::AttrBuilder B;
46
-   B.addDereferenceableAttr(bytes);
47
-   A->addAttr(llvm::AttributeSet::get(A->getContext(), A->getArgNo() + 1,  B));
48
-#endif
49
-}
50
-
51
 extern "C" LLVMValueRef
52
 lp_get_called_value(LLVMValueRef call)
53
 {
54
--- src/gallium/auxiliary/gallivm/lp_bld_misc.h.orig	2017-04-01 15:33:37 UTC
55
+++ src/gallium/auxiliary/gallivm/lp_bld_misc.h
56
@@ -73,9 +73,6 @@ lp_get_default_memory_manager();
57
 extern void
58
 lp_free_memory_manager(LLVMMCJITMemoryManagerRef memorymgr);
59
 
60
-extern void
61
-lp_add_attr_dereferenceable(LLVMValueRef val, uint64_t bytes);
62
-
63
 extern LLVMValueRef
64
 lp_get_called_value(LLVMValueRef call);
65
 
66
--- src/gallium/drivers/radeonsi/si_shader.c.orig	2017-04-01 15:33:37 UTC
67
+++ src/gallium/drivers/radeonsi/si_shader.c
68
@@ -5502,7 +5502,7 @@ static void si_create_function(struct si
69
 		 */
70
 		if (LLVMGetTypeKind(LLVMTypeOf(P)) == LLVMPointerTypeKind) {
71
 			lp_add_function_attr(ctx->main_fn, i + 1, LP_FUNC_ATTR_BYVAL);
72
-			lp_add_attr_dereferenceable(P, UINT64_MAX);
73
+			ac_add_attr_dereferenceable(P, UINT64_MAX);
74
 		} else
75
 			lp_add_function_attr(ctx->main_fn, i + 1, LP_FUNC_ATTR_INREG);
76
 	}
77
--- src/gallium/state_trackers/clover/llvm/compat.hpp.orig	2017-04-01 15:33:37 UTC
78
+++ src/gallium/state_trackers/clover/llvm/compat.hpp
79
@@ -83,7 +83,14 @@ namespace clover {
80
          inline void
81
          add_link_bitcode_file(clang::CodeGenOptions &opts,
82
                                const std::string &path) {
83
-#if HAVE_LLVM >= 0x0308
84
+#if HAVE_LLVM >= 0x0500
85
+            clang::CodeGenOptions::BitcodeFileToLink F;
86
+
87
+            F.Filename = path;
88
+            F.PropagateAttrs = true;
89
+            F.LinkFlags = ::llvm::Linker::Flags::None;
90
+            opts.LinkBitcodeFiles.emplace_back(F);
91
+#elif HAVE_LLVM >= 0x0308
92
             opts.LinkBitcodeFiles.emplace_back(::llvm::Linker::Flags::None, path);
93
 #else
94
             opts.LinkBitcodeFile = path;
(-)graphics/libGL/files/patch-src_amd_common_ac__llvm__util.c (+48 lines)
Line 0 Link Here
1
commit 7372e3cf5f2d
2
Author: Dave Airlie <airlied@redhat.com>
3
Date:   Wed Mar 15 07:15:50 2017 +1000
4
5
    radv/ac: workaround regression in llvm 4.0 release
6
    
7
    LLVM 4.0 released with a pretty messy regression, that hopefully
8
    get fixed in the future.
9
    
10
    This work around was proposed by Tom, and it fixes the CTS regressions
11
    here at least, I'm not sure if this will cause any major side effects,
12
    but correctness over speed and all that.
13
    
14
    radeonsi should possibly consider the same workaround until an llvm
15
    fix can be found.
16
    
17
    Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
18
    Signed-off-by: Dave Airlie <airlied@redhat.com>
19
20
--- src/amd/common/ac_llvm_util.c.orig	2017-03-20 14:08:50 UTC
21
+++ src/amd/common/ac_llvm_util.c
22
@@ -26,7 +26,7 @@
23
 #include "ac_llvm_util.h"
24
 
25
 #include <llvm-c/Core.h>
26
-
27
+#include <llvm-c/Support.h>
28
 #include "c11/threads.h"
29
 
30
 #include <assert.h>
31
@@ -47,6 +47,17 @@ static void ac_init_llvm_target()
32
 	LLVMInitializeAMDGPUTarget();
33
 	LLVMInitializeAMDGPUTargetMC();
34
 	LLVMInitializeAMDGPUAsmPrinter();
35
+
36
+	/*
37
+	 * Workaround for bug in llvm 4.0 that causes image intrinsics
38
+	 * to disappear.
39
+	 * https://reviews.llvm.org/D26348
40
+	 */
41
+#if HAVE_LLVM >= 0x0400
42
+	const char *argv[2] = {"mesa", "-simplifycfg-sink-common=false"};
43
+	LLVMParseCommandLineOptions(2, argv, NULL);
44
+#endif
45
+
46
 #endif
47
 }
48
 

Return to bug 217016