diff -u pixman-0.12.0/debian/changelog pixman-0.12.0/debian/changelog --- pixman-0.12.0/debian/changelog +++ pixman-0.12.0/debian/changelog @@ -1,3 +1,11 @@ +pixman (0.12.0-1ubuntu1) jaunty; urgency=low + + * pixman/pixman-pict.c: applying upstream patch, less fragile Linux + altivec detection (LP: #293702) + http://cgit.freedesktop.org/pixman/commit/?id=cd2a79ab81045aa7e35bc901081e57dea6ac4845 + + -- Dustin Kirkland Mon, 24 Nov 2008 22:25:01 -0600 + pixman (0.12.0-1) experimental; urgency=low * New upstream release. diff -u pixman-0.12.0/debian/control pixman-0.12.0/debian/control --- pixman-0.12.0/debian/control +++ pixman-0.12.0/debian/control @@ -1,7 +1,8 @@ Source: pixman Section: devel Priority: optional -Maintainer: Debian X Strike Force +Maintainer: Ubuntu Core Developers +XSBC-Original-Maintainer: Debian X Strike Force Uploaders: Julien Cristau , David Nusinow Build-Depends: debhelper, automake, autoconf, libtool, pkg-config Standards-Version: 3.7.3 only in patch2: unchanged: --- pixman-0.12.0.orig/pixman/pixman-pict.c +++ pixman-0.12.0/pixman/pixman-pict.c @@ -1918,7 +1918,59 @@ return have_vmx; } -#else +#elif defined (__linux__) +#include +#include +#include +#include +#include +#include +#include + +pixman_bool_t pixman_have_vmx (void) +{ + if (!initialized) { + char fname[64]; + unsigned long buf[64]; + ssize_t count = 0; + pid_t pid; + int fd, i; + + pid = getpid(); + snprintf(fname, sizeof(fname)-1, "/proc/%d/auxv", pid); + + fd = open(fname, O_RDONLY); + if (fd >= 0) { + for (i = 0; i <= (count / sizeof(unsigned long)); i += 2) { + /* Read more if buf is empty... */ + if (i == (count / sizeof(unsigned long))) { + count = read(fd, buf, sizeof(buf)); + if (count <= 0) + break; + i = 0; + } + + if (buf[i] == AT_HWCAP) { + have_vmx = !!(buf[i+1] & PPC_FEATURE_HAS_ALTIVEC); + initialized = TRUE; + break; + } else if (buf[i] == AT_NULL) { + break; + } + } + close(fd); + } + } + if (!initialized) { + /* Something went wrong. Assume 'no' rather than playing + fragile tricks with catching SIGILL. */ + have_vmx = FALSE; + initialized = TRUE; + } + + return have_vmx; +} +#else /* !__APPLE__ && !__linux__ */ #include #include