Gentoo Archives: gentoo-commits

From: "Jory Pratt (anarchy)" <anarchy@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo commit in src/patchsets/mozilla-thunderbird/3.1.1: 1000-thunderbird_shared_error.patch 1001-xulrunner_fix_jemalloc_vs_aslr.patch 1002-fix_double_buffer.diff 1003-fix_arms_detections.patch 1003-fix_sparc_build.patch 1004-fix_sparc_build.patch 2000-thunderbird_gentoo_install_dirs.patch README
Date: Sat, 31 Jul 2010 22:02:08
Message-Id: 20100731211723.5E3782CE15@corvid.gentoo.org
anarchy     10/07/31 21:17:23

  Added:                1000-thunderbird_shared_error.patch
                        1001-xulrunner_fix_jemalloc_vs_aslr.patch
                        1002-fix_double_buffer.diff
                        1003-fix_arms_detections.patch
                        1004-fix_sparc_build.patch
                        2000-thunderbird_gentoo_install_dirs.patch README
  Removed:              1003-fix_sparc_build.patch
  Log:
  Bring patchset in sync with new naming scheme, remove unneeded patches

Revision  Changes    Path
1.1                  src/patchsets/mozilla-thunderbird/3.1.1/1000-thunderbird_shared_error.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/mozilla-thunderbird/3.1.1/1000-thunderbird_shared_error.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/mozilla-thunderbird/3.1.1/1000-thunderbird_shared_error.patch?rev=1.1&content-type=text/plain

Index: 1000-thunderbird_shared_error.patch
===================================================================
diff -up thunderbird-3.0/mail/installer/Makefile.in.shared-error thunderbird-3.0/mail/installer/Makefile.in
--- thunderbird-3.0/mail/installer/Makefile.in.shared-error	2009-07-13 14:56:36.000000000 +0200
+++ thunderbird-3.0/mail/installer/Makefile.in	2009-07-14 12:41:16.000000000 +0200
@@ -94,9 +94,11 @@ endif
 # mozconfig instead.
 ifndef MAIL_PKG_SHARED
 ifndef BUILD_STATIC_LIBS
+ifeq (BUILD_STATIC_LIBS, 1)
 $(error you need an "--enable-static" build to package a build)
 endif
 endif
+endif
 
 include $(MOZILLA_SRCDIR)/toolkit/mozapps/installer/packager.mk
 



1.1                  src/patchsets/mozilla-thunderbird/3.1.1/1001-xulrunner_fix_jemalloc_vs_aslr.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/mozilla-thunderbird/3.1.1/1001-xulrunner_fix_jemalloc_vs_aslr.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/mozilla-thunderbird/3.1.1/1001-xulrunner_fix_jemalloc_vs_aslr.patch?rev=1.1&content-type=text/plain

Index: 1001-xulrunner_fix_jemalloc_vs_aslr.patch
===================================================================
diff -urpx 'cscope*' -x '.*.swp' mozilla-1.9.1-orig/memory/jemalloc/jemalloc.c mozilla-1.9.1/memory/jemalloc/jemalloc.c
--- mozilla-orig/memory/jemalloc/jemalloc.c	2009-07-30 17:30:25.000000000 +0200
+++ mozilla/memory/jemalloc/jemalloc.c	2009-08-10 14:28:59.000000000 +0200
@@ -392,7 +392,7 @@ __FBSDID("$FreeBSD: head/lib/libc/stdlib
 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(MOZ_MEMORY_LINUX) || defined(MOZ_MEMORY_BSD)
 #define JEMALLOC_USES_MAP_ALIGN	 /* Required on Solaris 10. Might improve performance elsewhere. */
 #endif
 
@@ -2305,20 +2305,31 @@ pages_map_align(size_t size, int pfd, si
 	 * 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((void *)alignment, size, PROT_READ | PROT_WRITE, MAP_PRIVATE |
-		    MAP_NOSYNC | MAP_ALIGN, pfd, 0);
-	} else
-#endif
-	       {
-		ret = mmap((void *)alignment, size, PROT_READ | PROT_WRITE, MAP_PRIVATE |
-		    MAP_NOSYNC | MAP_ALIGN | MAP_ANON, -1, 0);
-	}
+	ret = mmap(NULL, size + alignment, PROT_READ | PROT_WRITE, MAP_PRIVATE |
+		    MAP_NOSYNC| MAP_ANON, -1, 0);
 	assert(ret != NULL);
 
 	if (ret == MAP_FAILED)
 		ret = NULL;
+	else {
+		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;
+#ifdef MALLOC_PAGEFILE
+		if (pfd != -1) {
+			ret = mmap(ret, size, PROT_READ | PROT_WRITE, MAP_PRIVATE |
+			    MAP_NOSYNC | MAP_FIXED, pfd, 0);
+		}
+		if (ret == MAP_FAILED)
+			ret = NULL;
+#endif
+	}
 	return (ret);
 }
 #endif




1.1                  src/patchsets/mozilla-thunderbird/3.1.1/1002-fix_double_buffer.diff

file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/mozilla-thunderbird/3.1.1/1002-fix_double_buffer.diff?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/mozilla-thunderbird/3.1.1/1002-fix_double_buffer.diff?rev=1.1&content-type=text/plain

Index: 1002-fix_double_buffer.diff
===================================================================
http://bugs.gentoo.org/324863

Fix buffer overflow with GCC 4.5 and -U_FORTIFY_SOURCE=2

Patch by Harald van Dijk

--- comm-1.9.2/mozilla/extensions/spellcheck/hunspell/src/hashmgr.cpp
+++ comm-1.9.2/mozilla/extensions/spellcheck/hunspell/src/hashmgr.cpp
@@ -187,7 +187,7 @@
     struct hentry* hp = 
 	(struct hentry *) malloc (sizeof(struct hentry) + wbl + descl);
     if (!hp) return 1;
-    char * hpw = &(hp->word);
+    char * hpw = HENTRY_WORD(hp);
     strcpy(hpw, word);
     if (ignorechars != NULL) {
       if (utf8) {
--- comm-1.9.2/mozilla/extensions/spellcheck/hunspell/src/htypes.hxx
+++ comm-1.9.2/mozilla/extensions/spellcheck/hunspell/src/htypes.hxx
@@ -57,6 +57,8 @@
 #ifndef _HTYPES_HXX_
 #define _HTYPES_HXX_
 
+#include <cstddef>
+
 #define ROTATE_LEN   5
 
 #define ROTATE(v,q) \
@@ -68,7 +70,7 @@
 #define H_OPT_PHON   (1 << 2)
 
 // see also csutil.hxx
-#define HENTRY_WORD(h) &(h->word)
+#define HENTRY_WORD(h) ((char *) h + offsetof(struct hentry, word))
 
 // approx. number  of user defined words
 #define USERWORD 1000



1.1                  src/patchsets/mozilla-thunderbird/3.1.1/1003-fix_arms_detections.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/mozilla-thunderbird/3.1.1/1003-fix_arms_detections.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/mozilla-thunderbird/3.1.1/1003-fix_arms_detections.patch?rev=1.1&content-type=text/plain

Index: 1003-fix_arms_detections.patch
===================================================================
Fix arm OS detection

https://bugs.gentoo.org/327783
https://bugzilla.mozilla.org/show_bug.cgi?id=577319
---
--- configure.in
+++ configure.in
@@ -1424,9 +1424,11 @@
     CPU_ARCH="$OS_TEST"
     ;;
 
-arm)
+arm*)
     if test "$OS_TARGET" = "WINCE"; then
         CPU_ARCH="$OS_TEST"
+    else
+        CPU_ARCH="arm"
     fi
     ;;
 esac
--- mozilla/js/src/configure.in
+++ mozilla/js/src/configure.in
@@ -1162,9 +1162,11 @@
     CPU_ARCH="$OS_TEST"
     ;;
 
-arm)
+arm*)
     if test "$OS_TARGET" = "WINCE"; then
         CPU_ARCH="$OS_TEST"
+    else
+        CPU_ARCH="arm"
     fi
     ;;
 esac



1.1                  src/patchsets/mozilla-thunderbird/3.1.1/1004-fix_sparc_build.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/mozilla-thunderbird/3.1.1/1004-fix_sparc_build.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/mozilla-thunderbird/3.1.1/1004-fix_sparc_build.patch?rev=1.1&content-type=text/plain

Index: 1004-fix_sparc_build.patch
===================================================================
--- comm-1.9.2/mozilla/js/src/nanojit/CodeAlloc.cpp
+++ comm-1.9.2/mozilla/js/src/nanojit/CodeAlloc.cpp
@@ -247,8 +247,20 @@
 #endif
 
 #ifdef AVMPLUS_SPARC
+#ifdef __linux__  // bugzilla 502369
+void sync_instruction_memory(caddr_t v, u_int len)
+{
+    caddr_t end = v + len;
+    caddr_t p = v;
+    while (p < end) {
+        asm("flush %0" : : "r" (p));
+        p += 32;
+    }
+}
+#else
 extern  "C" void sync_instruction_memory(caddr_t v, u_int len);
 #endif
+#endif
 
 #if defined NANOJIT_IA32 || defined NANOJIT_X64
     // intel chips have dcache/icache interlock


1.1                  src/patchsets/mozilla-thunderbird/3.1.1/2000-thunderbird_gentoo_install_dirs.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/mozilla-thunderbird/3.1.1/2000-thunderbird_gentoo_install_dirs.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/mozilla-thunderbird/3.1.1/2000-thunderbird_gentoo_install_dirs.patch?rev=1.1&content-type=text/plain

Index: 2000-thunderbird_gentoo_install_dirs.patch
===================================================================
diff -ur work.orig/config/autoconf.mk.in work/config/autoconf.mk.in
--- work.orig/config/autoconf.mk.in	2009-04-28 16:55:24.000000000 +0000
+++ work/config/autoconf.mk.in	2009-04-28 16:57:12.000000000 +0000
@@ -60,14 +60,14 @@
 prefix		= @prefix@
 exec_prefix	= @exec_prefix@
 bindir		= @bindir@
-includedir	= @includedir@/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION)
+includedir	= @includedir@/thunderbird
 libdir		= @libdir@
 datadir		= @datadir@
 mandir		= @mandir@
-idldir		= $(datadir)/idl/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION)
+idldir		= $(datadir)/idl/thunderbird
 
-installdir	= $(libdir)/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION)
-sdkdir		= $(libdir)/$(MOZ_APP_NAME)-devel-$(MOZ_APP_VERSION)
+installdir	= $(libdir)/thunderbird
+sdkdir		= $(libdir)/thunderbird-devel
 
 MOZDEPTH	= $(DEPTH)/mozilla
 DIST		= $(MOZDEPTH)/dist



1.1                  src/patchsets/mozilla-thunderbird/3.1.1/README

file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/mozilla-thunderbird/3.1.1/README?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/mozilla-thunderbird/3.1.1/README?rev=1.1&content-type=text/plain

Index: README
===================================================================
1000 - upstream patches
2000 - gentoo specific patches
2010 - prefix specific patches
3000 - other distro patches