diff options
author | Rémi Cardona <remi@gentoo.org> | 2009-12-11 10:32:52 +0000 |
---|---|---|
committer | Rémi Cardona <remi@gentoo.org> | 2009-12-11 10:32:52 +0000 |
commit | e1dfee2f887964637457b44de6b50bb0870eb5fb (patch) | |
tree | 89e8c82df7aef04e55fe7fe82d21ac17c0d52513 /x11-libs/libdrm | |
parent | Fixed webkit USE flag logic, bug 296424, thank Nikoli for report. Updated lan... (diff) | |
download | gentoo-2-e1dfee2f887964637457b44de6b50bb0870eb5fb.tar.gz gentoo-2-e1dfee2f887964637457b44de6b50bb0870eb5fb.tar.bz2 gentoo-2-e1dfee2f887964637457b44de6b50bb0870eb5fb.zip |
x11-libs/libdrm: fix build on !intel arches wrt atomic ops (see bug #296482)
(Portage version: 2.2_rc58/cvs/Linux i686)
Diffstat (limited to 'x11-libs/libdrm')
5 files changed, 180 insertions, 3 deletions
diff --git a/x11-libs/libdrm/ChangeLog b/x11-libs/libdrm/ChangeLog index a6e63e7b1c60..51ff02be238c 100644 --- a/x11-libs/libdrm/ChangeLog +++ b/x11-libs/libdrm/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for x11-libs/libdrm # Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/x11-libs/libdrm/ChangeLog,v 1.92 2009/12/11 09:50:22 remi Exp $ +# $Header: /var/cvsroot/gentoo-x86/x11-libs/libdrm/ChangeLog,v 1.93 2009/12/11 10:32:52 remi Exp $ + + 11 Dec 2009; Rémi Cardona <remi@gentoo.org> + +files/2.4.15-0001-configure-Conditionally-build-libdrm_intel.patch, + libdrm-2.4.15.ebuild, + +files/2.4.15-0002-configure-Typo-in-error-message.patch, + +files/2.4.15-0003-intel-Fallback-to-atomic-ops.h-libatomic-ops-dev.patch: + fix build on !intel arches wrt atomic ops (see bug #296482) 11 Dec 2009; Rémi Cardona <remi@gentoo.org> -libdrm-2.4.11.ebuild, -libdrm-2.4.12.ebuild, -libdrm-2.4.14.ebuild: diff --git a/x11-libs/libdrm/files/2.4.15-0001-configure-Conditionally-build-libdrm_intel.patch b/x11-libs/libdrm/files/2.4.15-0001-configure-Conditionally-build-libdrm_intel.patch new file mode 100644 index 000000000000..fa800efdf72d --- /dev/null +++ b/x11-libs/libdrm/files/2.4.15-0001-configure-Conditionally-build-libdrm_intel.patch @@ -0,0 +1,64 @@ +From fc8f6be5a9bd84e10149770b76ff9353d25ce2a7 Mon Sep 17 00:00:00 2001 +From: Chris Wilson <chris@chris-wilson.co.uk> +Date: Mon, 12 Oct 2009 23:58:47 +0100 +Subject: [PATCH 1/3] configure: Conditionally build libdrm_intel + +Only build libdrm_intel automatically if we have support for atomic +operations. To force configure to build drm pass --enable-intel, which +will cause the configure to error if no support is found. Or pass +--disable-intel to explicitly prevent libdrm_intel from being built. + +Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> +--- + configure.ac | 19 ++++++++++++++----- + 1 files changed, 14 insertions(+), 5 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 870c056..0c216ce 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -45,8 +45,8 @@ AC_ARG_ENABLE(udev, AS_HELP_STRING([--enable-udev], + + AC_ARG_ENABLE(intel, + AS_HELP_STRING([--disable-intel], +- [Enable support for intel's KMS API (default: enabled)]), +- [INTEL=$enableval], [INTEL=yes]) ++ [Enable support for intel's KMS API (default: auto)]), ++ [INTEL=$enableval], [INTEL=auto]) + + AC_ARG_ENABLE(nouveau-experimental-api, + AS_HELP_STRING([--enable-nouveau-experimental-api], +@@ -151,9 +151,7 @@ if test "x$HAVE_LIBUDEV" = xyes; then + fi + AM_CONDITIONAL(HAVE_LIBUDEV, [test "x$HAVE_LIBUDEV" = xyes]) + +-AM_CONDITIONAL(HAVE_INTEL, [test "x$INTEL" = xyes]) +- +-if test "x$INTEL" = xyes; then ++if test "x$INTEL" != "xno"; then + # Check for atomic intrinsics + AC_CACHE_CHECK([for native atomic primitives], drm_cv_atomic_primitives, + [ +@@ -170,8 +168,19 @@ if test "x$INTEL" = xyes; then + AC_DEFINE(HAVE_INTEL_ATOMIC_PRIMITIVES, 1, + [Enable if your compiler supports the Intel __sync_* atomic primitives]) + fi ++ ++ if test "x$drm_cv_atomic_primitives" = "xnone"; then ++ if test "x$INTEL" != "xauto"; then ++ AC_MSG_ERROR([libdrm_intel depends upon atomic operations, which were not found for your compiler/cpu. Try compiling with -march=native, or disable support for Intel GPUs by passing --disable-intel to ./configue]) ++ else ++ INTEL=no ++ fi ++ fi + fi + ++AM_CONDITIONAL(HAVE_INTEL, [test "x$INTEL" != "xno"]) ++ ++ + AC_SUBST(WARN_CFLAGS) + AC_OUTPUT([ + Makefile +-- +1.6.5.5 + diff --git a/x11-libs/libdrm/files/2.4.15-0002-configure-Typo-in-error-message.patch b/x11-libs/libdrm/files/2.4.15-0002-configure-Typo-in-error-message.patch new file mode 100644 index 000000000000..4cc3e907b941 --- /dev/null +++ b/x11-libs/libdrm/files/2.4.15-0002-configure-Typo-in-error-message.patch @@ -0,0 +1,26 @@ +From 24c905f84120a7b0bcd7c5e86c58e908b9e850f9 Mon Sep 17 00:00:00 2001 +From: Chris Wilson <chris@chris-wilson.co.uk> +Date: Tue, 13 Oct 2009 14:25:54 +0100 +Subject: [PATCH 2/3] configure: Typo in error message. + +Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> +--- + configure.ac | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 0c216ce..fd6f696 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -171,7 +171,7 @@ if test "x$INTEL" != "xno"; then + + if test "x$drm_cv_atomic_primitives" = "xnone"; then + if test "x$INTEL" != "xauto"; then +- AC_MSG_ERROR([libdrm_intel depends upon atomic operations, which were not found for your compiler/cpu. Try compiling with -march=native, or disable support for Intel GPUs by passing --disable-intel to ./configue]) ++ AC_MSG_ERROR([libdrm_intel depends upon atomic operations, which were not found for your compiler/cpu. Try compiling with -march=native, or disable support for Intel GPUs by passing --disable-intel to ./configure]) + else + INTEL=no + fi +-- +1.6.5.5 + diff --git a/x11-libs/libdrm/files/2.4.15-0003-intel-Fallback-to-atomic-ops.h-libatomic-ops-dev.patch b/x11-libs/libdrm/files/2.4.15-0003-intel-Fallback-to-atomic-ops.h-libatomic-ops-dev.patch new file mode 100644 index 000000000000..98d043131774 --- /dev/null +++ b/x11-libs/libdrm/files/2.4.15-0003-intel-Fallback-to-atomic-ops.h-libatomic-ops-dev.patch @@ -0,0 +1,74 @@ +From 901bacd29cb5b242f68302b8384de6e193413a49 Mon Sep 17 00:00:00 2001 +From: Chris Wilson <chris@chris-wilson.co.uk> +Date: Tue, 13 Oct 2009 15:13:00 +0100 +Subject: [PATCH 3/3] intel: Fallback to atomic-ops.h [libatomic-ops-dev] + +Use the external implementation for atomic operations across a wide +range of architectures. + +Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> +--- + configure.ac | 10 +++++++++- + libdrm/intel/intel_atomic.h | 17 +++++++++++++++++ + 2 files changed, 26 insertions(+), 1 deletions(-) + +diff --git a/configure.ac b/configure.ac +index fd6f696..7efc4d4 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -163,15 +163,23 @@ if test "x$INTEL" != "xno"; then + ], [], + drm_cv_atomic_primitives="Intel" + ) ++ ++ if test "x$drm_cv_atomic_primitives" = "xnone"; then ++ AC_CHECK_HEADER([atomic_ops.h], drm_cv_atomic_primitives="libatomic-ops") ++ fi ++ + ]) + if test "x$drm_cv_atomic_primitives" = xIntel; then + AC_DEFINE(HAVE_INTEL_ATOMIC_PRIMITIVES, 1, + [Enable if your compiler supports the Intel __sync_* atomic primitives]) + fi ++ if test "x$drm_cv_atomic_primitives" = "xlibatomic-ops"; then ++ AC_DEFINE(HAVE_LIB_ATOMIC_OPS, 1, [Enable if you have libatomic-ops-dev installed]) ++ fi + + if test "x$drm_cv_atomic_primitives" = "xnone"; then + if test "x$INTEL" != "xauto"; then +- AC_MSG_ERROR([libdrm_intel depends upon atomic operations, which were not found for your compiler/cpu. Try compiling with -march=native, or disable support for Intel GPUs by passing --disable-intel to ./configure]) ++ AC_MSG_ERROR([libdrm_intel depends upon atomic operations, which were not found for your compiler/cpu. Try compiling with -march=native, or install the libatomics-op-dev package, or, failing both of those, disable support for Intel GPUs by passing --disable-intel to ./configure]) + else + INTEL=no + fi +diff --git a/libdrm/intel/intel_atomic.h b/libdrm/intel/intel_atomic.h +index 9eb50a1..e725c4a 100644 +--- a/libdrm/intel/intel_atomic.h ++++ b/libdrm/intel/intel_atomic.h +@@ -54,6 +54,23 @@ typedef struct { + + #endif + ++#if HAVE_LIB_ATOMIC_OPS ++#include <atomic_ops.h> ++ ++#define HAS_ATOMIC_OPS 1 ++ ++typedef struct { ++ AO_t atomic; ++} atomic_t; ++ ++# define atomic_read(x) AO_load_full(&(x)->atomic) ++# define atomic_set(x, val) AO_store_full(&(x)->atomic, (val)) ++# define atomic_inc(x) ((void) AO_fetch_and_add1_full(&(x)->atomic)) ++# define atomic_dec_and_test(x) (AO_fetch_and_sub1_full(&(x)->atomic) == 1) ++# define atomic_cmpxchg(x, oldv, newv) AO_compare_and_swap_full(&(x)->atomic, oldv, newv) ++ ++#endif ++ + #if ! HAS_ATOMIC_OPS + #error libdrm-intel requires atomic operations, please define them for your CPU/compiler. + #endif +-- +1.6.5.5 + diff --git a/x11-libs/libdrm/libdrm-2.4.15.ebuild b/x11-libs/libdrm/libdrm-2.4.15.ebuild index a21ed8be7e71..a3a00be2ca79 100644 --- a/x11-libs/libdrm/libdrm-2.4.15.ebuild +++ b/x11-libs/libdrm/libdrm-2.4.15.ebuild @@ -1,9 +1,9 @@ # Copyright 1999-2009 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/x11-libs/libdrm/libdrm-2.4.15.ebuild,v 1.3 2009/12/10 19:45:46 fauli Exp $ +# $Header: /var/cvsroot/gentoo-x86/x11-libs/libdrm/libdrm-2.4.15.ebuild,v 1.4 2009/12/11 10:32:52 remi Exp $ # Must be before x-modular eclass is inherited -#SNAPSHOT="yes" +SNAPSHOT="yes" inherit x-modular @@ -26,6 +26,12 @@ DEPEND="${RDEPEND}" CONFIGURE_OPTIONS="--enable-udev --enable-nouveau-experimental-api --enable-radeon-experimental-api" +PATCHES=( +"${FILESDIR}/2.4.15-0001-configure-Conditionally-build-libdrm_intel.patch" +"${FILESDIR}/2.4.15-0002-configure-Typo-in-error-message.patch" +"${FILESDIR}/2.4.15-0003-intel-Fallback-to-atomic-ops.h-libatomic-ops-dev.patch" +) + pkg_postinst() { x-modular_pkg_postinst |