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.2
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 = 1490018937
2
SHA256 (mesa-13.0.6.tar.xz) = 29ef104a7fc082d352b1599bd6cb1d040be424ccd22f5e0eb7ee9b0e9acd3597
2
SHA256 (mesa-17.0.2.tar.xz) = f8f191f909e01e65de38d5bdea5fb057f21649a3aed20948be02348e77a689d4
3
SIZE (mesa-13.0.6.tar.xz) = 9179236
3
SIZE (mesa-17.0.2.tar.xz) = 9451056
(-)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-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