[xulrunner/f15] s390(x) build fixes

Martin Stransky stransky at fedoraproject.org
Fri Nov 25 12:04:30 UTC 2011


commit 86ab3b2855cb5c96af5932a47dd1891de2227895
Author: Martin Stransky <stransky at anakreon.cz>
Date:   Fri Nov 25 13:04:24 2011 +0100

    s390(x) build fixes

 mozilla-589735.patch |   93 ++++++++++++++++++++++++++++++++++++++++++++++++++
 mozilla-680917.patch |   12 ++++++
 xulrunner.spec       |   21 +++++++++--
 3 files changed, 122 insertions(+), 4 deletions(-)
---
diff --git a/mozilla-589735.patch b/mozilla-589735.patch
new file mode 100644
index 0000000..fdd34da
--- /dev/null
+++ b/mozilla-589735.patch
@@ -0,0 +1,93 @@
+diff --git a/memory/jemalloc/jemalloc.c b/memory/jemalloc/jemalloc.c
+--- a/memory/jemalloc/jemalloc.c
++++ b/memory/jemalloc/jemalloc.c
+@@ -2198,16 +2198,36 @@ pages_map_align(size_t size, int pfd, si
+ 	return (ret);
+ }
+ #endif
+ 
+ static void *
+ pages_map(void *addr, size_t size, int pfd)
+ {
+ 	void *ret;
++#if defined(__ia64__)
++        /*
++         * The JS engine assumes that all allocated pointers have their high 17 bits clear,
++         * which ia64's mmap doesn't support directly. However, we can emulate it by passing
++         * mmap an "addr" parameter with those bits clear. The mmap will return that address,
++         * or the nearest available memory above that address, providing a near-guarantee
++         * that those bits are clear. If they are not, we return NULL below to indicate
++         * out-of-memory.
++         * 
++         * The addr is chosen as 0x0000070000000000, which still allows about 120TB of virtual 
++         * address space.
++         * 
++         * See Bug 589735 for more information.
++         */
++	bool check_placement = true;
++        if (addr == NULL) {
++		addr = (void*)0x0000070000000000;
++		check_placement = false;
++	}
++#endif
+ 
+ 	/*
+ 	 * We don't use MAP_FIXED here, because it can cause the *replacement*
+ 	 * of existing mappings, and we only want to create new mappings.
+ 	 */
+ #ifdef MALLOC_PAGEFILE
+ 	if (pfd != -1) {
+ 		ret = mmap(addr, size, PROT_READ | PROT_WRITE, MAP_PRIVATE |
+@@ -2217,34 +2237,52 @@ pages_map(void *addr, size_t size, int p
+ 	       {
+ 		ret = mmap(addr, size, PROT_READ | PROT_WRITE, MAP_PRIVATE |
+ 		    MAP_ANON, -1, 0);
+ 	}
+ 	assert(ret != NULL);
+ 
+ 	if (ret == MAP_FAILED)
+ 		ret = NULL;
++#if defined(__ia64__)
++        /* 
++         * If the allocated memory doesn't have its upper 17 bits clear, consider it 
++         * as out of memory.
++        */
++        else if ((long long)ret & 0xffff800000000000) {
++		munmap(ret, size);
++                ret = NULL;
++        }
++        /* If the caller requested a specific memory location, verify that's what mmap returned. */
++	else if (check_placement && ret != addr) {
++#else
+ 	else if (addr != NULL && ret != addr) {
++#endif
+ 		/*
+ 		 * We succeeded in mapping memory, but not in the right place.
+ 		 */
+ 		if (munmap(ret, size) == -1) {
+ 			char buf[STRERROR_BUF];
+ 
+ 			strerror_r(errno, buf, sizeof(buf));
+ 			_malloc_message(_getprogname(),
+ 			    ": (malloc) Error in munmap(): ", buf, "\n");
+ 			if (opt_abort)
+ 				abort();
+ 		}
+ 		ret = NULL;
+ 	}
+ 
++#if defined(__ia64__)
++	assert(ret == NULL || (!check_placement && ret != NULL)
++	    || (check_placement && ret == addr));
++#else
+ 	assert(ret == NULL || (addr == NULL && ret != addr)
+ 	    || (addr != NULL && ret == addr));
++#endif
+ 	return (ret);
+ }
+ 
+ static void
+ pages_unmap(void *addr, size_t size)
+ {
+ 
+ 	if (munmap(addr, size) == -1) {
diff --git a/mozilla-680917.patch b/mozilla-680917.patch
new file mode 100644
index 0000000..b9b8859
--- /dev/null
+++ b/mozilla-680917.patch
@@ -0,0 +1,12 @@
+diff -up tip/js/src/yarr/BumpPointerAllocator.h.ia64-assert tip/js/src/yarr/BumpPointerAllocator.h
+--- tip/js/src/yarr/BumpPointerAllocator.h.ia64-assert	2011-08-23 04:50:06.000000000 -0400
++++ tip/js/src/yarr/BumpPointerAllocator.h	2011-08-23 04:50:12.000000000 -0400
+@@ -36,6 +36,8 @@ namespace WTF {
+ 
+ #if WTF_CPU_SPARC
+ #define MINIMUM_BUMP_POOL_SIZE 0x2000
++#elif WTF_CPU_IA64
++#define MINIMUM_BUMP_POOL_SIZE 0x4000
+ #else
+ #define MINIMUM_BUMP_POOL_SIZE 0x1000
+ #endif
diff --git a/xulrunner.spec b/xulrunner.spec
index 34444fb..63abf16 100644
--- a/xulrunner.spec
+++ b/xulrunner.spec
@@ -50,7 +50,7 @@
 Summary:        XUL Runtime for Gecko Applications
 Name:           xulrunner
 Version:        8.0
-Release:        1%{?pre_tag}%{?dist}
+Release:        2%{?pre_tag}%{?dist}
 URL:            http://developer.mozilla.org/En/XULRunner
 License:        MPLv1.1 or GPLv2+ or LGPLv2+
 Group:          Applications/Internet
@@ -81,6 +81,8 @@ Patch34:        xulrunner-2.0-network-link-service.patch
 Patch35:        xulrunner-2.0-NetworkManager09.patch
 Patch36:        mozilla-670719.patch
 Patch37:        mozilla-686280.patch
+Patch38:        mozilla-589735.patch
+Patch39:        mozilla-680917.patch
 
 # ---------------------------------------------------
 
@@ -205,6 +207,8 @@ sed -e 's/__RPM_VERSION_INTERNAL__/%{gecko_dir_ver}/' %{P:%%PATCH0} \
 %patch35 -p1 -b .NetworkManager09
 %patch36 -p1 -b .670719
 %patch37 -p1 -b .686280
+%patch38 -p1 -b .589735
+%patch39 -p1 -b .680917
 
 %{__rm} -f .mozconfig
 %{__cp} %{SOURCE10} .mozconfig
@@ -212,9 +216,15 @@ sed -e 's/__RPM_VERSION_INTERNAL__/%{gecko_dir_ver}/' %{P:%%PATCH0} \
 %{__cat} %{SOURCE11} >> .mozconfig
 %endif
 
-# Upstream bug filed without resolution
-# for now make sure jit is not enabled on sparc64
-%ifarch sparc64
+# s390(x) fails to start with jemalloc enabled
+%ifarch s390 s390x
+echo "ac_add_options --disable-jemalloc" >> .mozconfig
+%endif
+
+%ifnarch %{ix86} x86_64
+echo "ac_add_options --disable-methodjit" >> .mozconfig
+echo "ac_add_options --disable-monoic" >> .mozconfig
+echo "ac_add_options --disable-polyic" >> .mozconfig
 echo "ac_add_options --disable-tracejit" >> .mozconfig
 %endif
 
@@ -443,6 +453,9 @@ fi
 #---------------------------------------------------------------------
 
 %changelog
+* Fri Nov 25 2011 Martin Stransky <stransky at redhat.com> 8.0-2
+- s390 build fixes
+
 * Mon Nov 7 2011 Martin Stransky <stransky at redhat.com> 8.0-1
 - Updated to 8.0
 


More information about the scm-commits mailing list