mesa: big update, and related improvements (close #6367)

* Remove upstreamed patch
* EGL driver dirs are no longer a thing, see mesa commit
  407450eb84f5a1b466a2eff19b85cdee7ac15dfb
  Patching runtime search dir in sources instead (by vcunat).
* static-gallium patch dropped as it causes visibility issues with
  nouveau
* rtti patch dropped as it the relevant configuration has been removed
  upstream; properly fixed by an LLVM flag now
* Checks disabled. This is known and solved upstream. Checks will be
  re-enabled in a future commit when updating to a version containing
  the fixes
* Use llvm-3.5 now (by vcunat).
This commit is contained in:
Eduard Bachmakov 2015-02-22 19:11:38 +01:00 committed by Vladimír Čunát
parent c0def4a169
commit 0e9a0c9913
4 changed files with 11 additions and 159 deletions

View File

@ -15,16 +15,15 @@ else
- The basic mesa ($out) contains headers and libraries (GLU is in mesa_glu now).
This or the mesa attribute (which also contains GLU) are small (~ 2 MB, mostly headers)
and are designed to be the buildInput of other packages.
- DRI and EGL drivers are compiled into $drivers output,
which is much bigger and depends on LLVM.
These should be searched at runtime in "/run/opengl-driver{,-32}/lib/*"
and so are kind-of impure (given by NixOS).
- DRI drivers are compiled into $drivers output, which is much bigger and
depends on LLVM. These should be searched at runtime in
"/run/opengl-driver{,-32}/lib/*" and so are kind-of impure (given by NixOS).
(I suppose on non-NixOS one would create the appropriate symlinks from there.)
- libOSMesa is in $osmesa (~4 MB)
*/
let
version = "10.2.9";
version = "10.4.5";
# this is the default search path for DRI drivers
driverLink = "/run/opengl-driver" + stdenv.lib.optionalString stdenv.isi686 "-32";
in
@ -38,46 +37,35 @@ stdenv.mkDerivation {
"https://launchpad.net/mesa/trunk/${version}/+download/MesaLib-${version}.tar.bz2"
"ftp://ftp.freedesktop.org/pub/mesa/${version}/MesaLib-${version}.tar.bz2"
];
sha256 = "f6031f8b7113a92325b60635c504c510490eebb2e707119bbff7bd86aa34657d";
sha256 = "bf60000700a9d58e3aca2bfeee7e781053b0d839e61a95b1883e05a2dee247a0";
};
prePatch = "patchShebangs .";
patches = [
./static-gallium.patch
./glx_ro_text_segm.patch # fix for grsecurity/PaX
# TODO: revive ./dricore-gallium.patch when it gets ported (from Ubuntu),
# as it saved ~35 MB in $drivers; watch https://launchpad.net/ubuntu/+source/mesa/+changelog
(fetchpatch {
name = "fix-lp_test_arit.diff";
url = "http://cgit.freedesktop.org/mesa/mesa/patch/"
+ "?id=8148a06b8fdb734f7f9a11ce787ee6505939fdaa";
sha256 = "0k2bnl7d28nx2y88jchw6jj4f3xfdjjvz4vpvhc40060c2iz8fla";
})
] ++ optional stdenv.isLinux
(substituteAll {
src = ./dlopen-absolute-paths.diff;
inherit udev;
});
# Change the search path for EGL drivers from $drivers/* to driverLink
postPatch = ''
sed '/D_EGL_DRIVER_SEARCH_DIR=/s,EGL_DRIVER_INSTALL_DIR,${driverLink}/lib/egl,' \
-i src/egl/main/Makefile.am
'' + /* work around RTTI LLVM problems */ ''
patch -R -p1 < ${./rtti.patch}
substituteInPlace src/egl/main/egldriver.c \
--replace _EGL_DRIVER_SEARCH_DIR '"${driverLink}"'
'';
outputs = ["out" "drivers" "osmesa"];
configureFlags = [
"--with-dri-driverdir=$(drivers)/lib/dri"
"--with-egl-driver-dir=$(drivers)/lib/egl"
"--with-dri-searchpath=${driverLink}/lib/dri"
"--enable-dri"
"--enable-glx-tls"
"--enable-shared-glapi" "--enable-shared-gallium"
"--enable-shared-glapi"
"--enable-driglx-direct" # seems enabled anyway
"--enable-gallium-llvm" "--enable-llvm-shared-libs"
"--enable-xa" # used in vmware driver
@ -112,7 +100,7 @@ stdenv.mkDerivation {
;
enableParallelBuilding = true;
doCheck = true;
doCheck = false;
# move gallium-related stuff to $drivers, so $out doesn't depend on LLVM;
# also move libOSMesa to $osmesa, as it's relatively big
@ -178,6 +166,6 @@ stdenv.mkDerivation {
homepage = http://www.mesa3d.org/;
license = "bsd";
platforms = stdenv.lib.platforms.mesaPlatforms;
maintainers = with stdenv.lib.maintainers; [ simons vcunat ];
maintainers = with stdenv.lib.maintainers; [ eduarrrd simons vcunat ];
};
}

View File

@ -1,72 +0,0 @@
http://lists.freedesktop.org/archives/mesa-dev/2013-October/046311.html
* As discussed on the mailing list,
forced no-rtti breaks C++ public
API's such as the Haiku C++ libGL.so
* -fno-rtti *can* be still set however
instead of blindly forcing -fno-rtti,
we can rely on the llvm-config
--cppflags output.
If the system llvm is built without
rtti (default), the no-rtti flag will be
present in llvm-config --cppflags
(which we pick up on)
If llvm is built with rtti
(REQUIRES_RTTI=1), then -fno-rtti is
removed from llvm-config --cppflags.
* We could selectively add / remove rtti
from various components, however mixing
rtti and non-rtti code is tricky and
could introduce bugs.
* This needs impact tested.
---
configure.ac | 1 -
scons/llvm.py | 3 ---
src/gallium/auxiliary/Makefile.am | 6 ------
3 files changed, 10 deletions(-)
diff --git a/configure.ac b/configure.ac
index 0d082d2..3335575 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1943,7 +1943,6 @@ AM_CONDITIONAL(HAVE_LOADER_GALLIUM, test x$enable_gallium_loader = xyes)
AM_CONDITIONAL(HAVE_DRM_LOADER_GALLIUM, test x$enable_gallium_drm_loader = xyes)
AM_CONDITIONAL(HAVE_GALLIUM_COMPUTE, test x$enable_opencl = xyes)
AM_CONDITIONAL(HAVE_MESA_LLVM, test x$MESA_LLVM = x1)
-AM_CONDITIONAL(LLVM_NEEDS_FNORTTI, test $LLVM_VERSION_INT -ge 302)
AC_SUBST([ELF_LIB])
diff --git a/scons/llvm.py b/scons/llvm.py
index 7cd609c..c1c3736 100644
--- a/scons/llvm.py
+++ b/scons/llvm.py
@@ -195,9 +195,6 @@ def generate(env):
if llvm_version >= distutils.version.LooseVersion('3.1'):
components.append('mcjit')
- if llvm_version >= distutils.version.LooseVersion('3.2'):
- env.Append(CXXFLAGS = ('-fno-rtti',))
-
env.ParseConfig('llvm-config --libs ' + ' '.join(components))
env.ParseConfig('llvm-config --ldflags')
except OSError:
diff --git a/src/gallium/auxiliary/Makefile.am b/src/gallium/auxiliary/Makefile.am
index 670e124..2d2d8d4 100644
--- a/src/gallium/auxiliary/Makefile.am
+++ b/src/gallium/auxiliary/Makefile.am
@@ -25,12 +25,6 @@ AM_CXXFLAGS += \
$(GALLIUM_CFLAGS) \
$(LLVM_CXXFLAGS)
-if LLVM_NEEDS_FNORTTI
-
-AM_CXXFLAGS += -fno-rtti
-
-endif
-
libgallium_la_SOURCES += \
$(GALLIVM_SOURCES) \
$(GALLIVM_CPP_SOURCES)
--
1.8.4

View File

@ -1,64 +0,0 @@
117-static-gallium.patch from Ubuntu Trusty
diff --git a/configure.ac b/configure.ac
index b9fcb0b..be89843 100644
--- a/configure.ac
+++ b/configure.ac
@@ -747,6 +747,19 @@ if test "x$enable_shared_glapi" = xyes; then
fi
AM_CONDITIONAL(HAVE_SHARED_GLAPI, test "x$enable_shared_glapi" = xyes)
+AC_ARG_ENABLE([shared-gallium],
+ [AS_HELP_STRING([--enable-shared-gallium],
+ [Enable shared gallium core @<:@default=yes@:>@])],
+ [enable_shared_gallium="$enableval"],
+ [enable_shared_gallium=yes])
+
+SHARED_GALLIUM="0"
+if test "x$enable_shared_gallium" = xyes; then
+ SHARED_GALLIUM="1"
+fi
+AC_SUBST([SHARED_GALLIUM])
+AM_CONDITIONAL(HAVE_SHARED_GALLIUM, test $SHARED_GALLIUM = 1)
+
dnl
dnl Driver specific build directories
dnl
diff --git a/src/gallium/auxiliary/Makefile.am b/src/gallium/auxiliary/Makefile.am
index f14279b..3cdec83 100644
--- a/src/gallium/auxiliary/Makefile.am
+++ b/src/gallium/auxiliary/Makefile.am
@@ -3,14 +3,19 @@ AUTOMAKE_OPTIONS = subdir-objects
include Makefile.sources
include $(top_srcdir)/src/gallium/Automake.inc
-noinst_LTLIBRARIES = libgallium.la
-
AM_CFLAGS = \
-I$(top_srcdir)/src/gallium/auxiliary/util \
- $(GALLIUM_CFLAGS) \
- $(VISIBILITY_CFLAGS)
+ $(GALLIUM_CFLAGS)
-AM_CXXFLAGS = $(VISIBILITY_CXXFLAGS)
+AM_CXXFLAGS =
+
+if HAVE_SHARED_GALLIUM
+lib_LTLIBRARIES = libgallium.la
+else
+noinst_LTLIBRARIES = libgallium.la
+AM_CFLAGS += $(VISIBILITY_CFLAGS)
+AM_CXXFLAGS += $(VISIBILITY_CXXFLAGS)
+endif
libgallium_la_SOURCES = \
$(C_SOURCES) \
@@ -29,6 +34,8 @@ if LLVM_NEEDS_FNORTTI
AM_CXXFLAGS += -fno-rtti
+libgallium_la_LIBADD = $(LLVM_LIBS)
+
endif
libgallium_la_SOURCES += \

View File

@ -6744,7 +6744,7 @@ let
# makes it slower, but during runtime we link against just mesa_drivers
# through /run/opengl-driver*, which is overriden according to config.grsecurity
grsecEnabled = true;
llvm = llvm_34;
llvm = llvm_35;
});
mesa_glu = mesaDarwinOr (callPackage ../development/libraries/mesa-glu { });
mesa_drivers = mesaDarwinOr (