From d35474dc7fc86ed44dbf38cda42d8bd4dd0dbe3c Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Thu, 1 Mar 2012 08:18:59 +0000 Subject: main/gnash: rebuild against mesa-8.0 and add aslr fix for jemalloc --- testing/gnash/APKBUILD | 8 ++++--- testing/gnash/aslr-fix.patch | 52 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+), 3 deletions(-) create mode 100644 testing/gnash/aslr-fix.patch diff --git a/testing/gnash/APKBUILD b/testing/gnash/APKBUILD index 5b2b407adf..9f791462b3 100644 --- a/testing/gnash/APKBUILD +++ b/testing/gnash/APKBUILD @@ -2,7 +2,7 @@ # Maintainer: William Pitcock pkgname=gnash pkgver=0.8.10 -pkgrel=0 +pkgrel=1 pkgdesc="GNU flash player implementation" url="http://www.gnashdev.org/" arch="all" @@ -17,7 +17,8 @@ install="" subpackages="$pkgname-doc $pkgname-dev $pkgname-mozilla $pkgname-sdl $pkgname-fb $pkgname-lang" source="http://ftp.gnu.org/pub/gnu/gnash/$pkgver/gnash-$pkgver.tar.bz2 - gnash-ffmpeg.patch" + gnash-ffmpeg.patch + aslr-fix.patch" _builddir="$srcdir"/gnash-$pkgver prepare() { @@ -69,4 +70,5 @@ mozilla() { } md5sums="63e9f79c41d93d48c5a2fa94856548c4 gnash-0.8.10.tar.bz2 -b324b3fee1e017d8fcc4d991146266f8 gnash-ffmpeg.patch" +b324b3fee1e017d8fcc4d991146266f8 gnash-ffmpeg.patch +64cea4c0b4963b7fd5308beb1b20fed6 aslr-fix.patch" diff --git a/testing/gnash/aslr-fix.patch b/testing/gnash/aslr-fix.patch new file mode 100644 index 0000000000..632443b602 --- /dev/null +++ b/testing/gnash/aslr-fix.patch @@ -0,0 +1,52 @@ +diff -Naur gnash-0.8.10.alt/libbase/jemalloc.c gnash-0.8.10/libbase/jemalloc.c +--- gnash-0.8.10.alt/libbase/jemalloc.c 2012-02-07 09:39:41.000000000 +0100 ++++ gnash-0.8.10/libbase/jemalloc.c 2012-02-24 18:36:47.000000000 +0100 +@@ -429,7 +429,7 @@ + static const bool __isthreaded = true; + #endif + +-#if defined(MOZ_MEMORY_SOLARIS) && defined(MAP_ALIGN) && !defined(JEMALLOC_NEVER_USES_MAP_ALIGN) ++#if defined(MOZ_MEMORY_SOLARIS) && defined(MAP_ALIGN) && !defined(JEMALLOC_NEVER_USES_MAP_ALIGN) || defined(MOZ_MEMORY_LINUX) + #define JEMALLOC_USES_MAP_ALIGN /* Required on Solaris 10. Might improve performance elsewhere. */ + #endif + +@@ -2238,6 +2238,7 @@ + * We don't use MAP_FIXED here, because it can cause the *replacement* + * of existing mappings, and we only want to create new mappings. + */ ++#ifndef MOZ_MEMORY_LINUX + #ifdef MALLOC_PAGEFILE + if (pfd != -1) { + ret = mmap((void *)alignment, size, PROT_READ | PROT_WRITE, MAP_PRIVATE | +@@ -2252,6 +2253,31 @@ + + if (ret == MAP_FAILED) + ret = NULL; ++#else /* MOZ_MEMORY_LINUX */ ++#ifdef MALLOC_PAGEFILE ++ if (pfd != -1) { ++ ret = mmap((void *)alignment, size, PROT_READ | PROT_WRITE, MAP_PRIVATE | ++ MAP_NOSYNC, pfd, 0); ++ } else ++#endif ++ { ++ ret = mmap(NULL, size + alignment, PROT_READ | PROT_WRITE, MAP_PRIVATE | ++ MAP_NOSYNC | MAP_ANON, -1, 0); ++ } ++ assert(ret != NULL); ++ ++ if (ret == MAP_FAILED) ++ return NULL; ++ ++ uintptr_t aligned_ret; ++ size_t extra_size; ++ aligned_ret = (uintptr_t)ret + alignment - 1; ++ aligned_ret &= ~(alignment - 1); ++ extra_size = aligned_ret - (uintptr_t)ret; ++ munmap(ret, extra_size); ++ munmap(ret + extra_size + size, alignment - extra_size); ++ ret = (void*)aligned_ret; ++#endif /* ifndef MOZ_MEMORY_LINUX*/ + return (ret); + } + #endif -- cgit v1.2.3