Merge lp:~mcasadevall/thunderbird/arm-segfault-fixes into lp:thunderbird/3.3

Proposed by Michael Casadevall
Status: Merged
Approved by: Alexander Sack
Approved revision: 110
Merged at revision: not available
Proposed branch: lp:~mcasadevall/thunderbird/arm-segfault-fixes
Merge into: lp:thunderbird/3.3
Diff against target: None lines
To merge this branch: bzr merge lp:~mcasadevall/thunderbird/arm-segfault-fixes
Reviewer Review Type Date Requested Status
Alexander Sack Pending
Review via email: mp+7902@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/changelog'
--- debian/changelog 2009-06-16 12:02:14 +0000
+++ debian/changelog 2009-06-25 17:34:31 +0000
@@ -1,3 +1,24 @@
1thunderbird (2.0.0.22+build1+nobinonly-0ubuntu2) UNRELEASED; urgency=low
2
3 [ Loic Minier ]
4 * debian/patches/bz322806_arm-vfp-2538:3f78d5e894bc
5 - Created from hg rev 2538:3f78d5e894bc pulled from
6 http://hg.mozilla.org/releases/mozilla-1.9.1/, fixes crash in
7 JS due to usage of wrong floating point number format; thanks Michael
8 Casadevall for the research and locating the fix; LP: #385325.
9 - Based off Mozilla Bugzilla 322806
10
11 [ Michael Casadevall ]
12 * debian/patches/bz339782_cvs_xptcinvoke_arm_backport_1.13.patch:
13 - Backport of xptcinvoke_arm.cpp from TB3 HEAD, corrects stack corruption
14 issues on ARM EABI. Patch based off Mozilla Bugzilla 339782
15 * debian/rules:
16 - Changed default compiler on ARM to gcc-4.3 due to 4.4 ICE
17 * debian/control:
18 - Added build dep on gcc-4.3 and g++-4.3 on ARM
19
20 -- Michael Casadevall <mcasadevall@ubuntu.com> Thu, 25 Jun 2009 12:37:15 -0400
21
1thunderbird (2.0.0.22+build1+nobinonly-0ubuntu1.nspr474) karmic; urgency=low22thunderbird (2.0.0.22+build1+nobinonly-0ubuntu1.nspr474) karmic; urgency=low
223
3 * security/stability update 2.0.0.22 (USN-782-1)24 * security/stability update 2.0.0.22 (USN-782-1)
425
=== modified file 'debian/control'
--- debian/control 2009-06-16 12:01:31 +0000
+++ debian/control 2009-06-25 17:34:31 +0000
@@ -31,7 +31,9 @@
31 libhunspell-dev,31 libhunspell-dev,
32 libnss3-dev,32 libnss3-dev,
33 libnspr4-dev (>= 4.7.4),33 libnspr4-dev (>= 4.7.4),
34 docbook-to-man34 docbook-to-man,
35 gcc-4.3 [armel],
36 g++-4.3 [armel]
35Standards-Version: 3.7.337Standards-Version: 3.7.3
3638
37Package: thunderbird39Package: thunderbird
3840
=== added file 'debian/patches/bz322806_arm-vfp-2538:3f78d5e894bc.patch'
--- debian/patches/bz322806_arm-vfp-2538:3f78d5e894bc.patch 1970-01-01 00:00:00 +0000
+++ debian/patches/bz322806_arm-vfp-2538:3f78d5e894bc.patch 2009-06-25 17:34:31 +0000
@@ -0,0 +1,41 @@
1diff --git a/js/src/jsnum.h b/js/src/jsnum.h
2index c0f5223..22ae290 100644
3--- a/js/src/jsnum.h
4+++ b/js/src/jsnum.h
5@@ -54,21 +54,20 @@
6 JS_BEGIN_EXTERN_C
7
8 /*
9- * Stefan Hanske <sh990154@mail.uni-greifswald.de> reports:
10- * ARM is a little endian architecture but 64 bit double words are stored
11- * differently: the 32 bit words are in little endian byte order, the two words
12- * are stored in big endian`s way.
13+ * The ARM architecture supports two floating point models: VFP and FPA. When
14+ * targetting FPA, doubles are mixed-endian on little endian ARMs (meaning that
15+ * the high and low words are in big endian order).
16 */
17
18 #if defined(__arm) || defined(__arm32__) || defined(__arm26__) || defined(__arm__)
19-#ifndef __QNXNTO__
20-#define CPU_IS_ARM
21+#if !defined(__VFP_FP__)
22+#define FPU_IS_ARM_FPA
23 #endif
24 #endif
25
26 typedef union jsdpun {
27 struct {
28-#if defined(IS_LITTLE_ENDIAN) && !defined(CPU_IS_ARM)
29+#if defined(IS_LITTLE_ENDIAN) && !defined(FPU_IS_ARM_FPA)
30 uint32 lo, hi;
31 #else
32 uint32 hi, lo;
33@@ -97,7 +96,7 @@ typedef union jsdpun {
34 * so this code should work.
35 */
36
37-#if defined(IS_LITTLE_ENDIAN) && !defined(CPU_IS_ARM)
38+#if defined(IS_LITTLE_ENDIAN) && !defined(FPU_IS_ARM_FPA)
39 #define JSDOUBLE_HI32(x) (((uint32 *)&(x))[1])
40 #define JSDOUBLE_LO32(x) (((uint32 *)&(x))[0])
41 #else
042
=== added file 'debian/patches/bz339782_cvs_xptcinvoke_arm_backport_1.13.patch'
--- debian/patches/bz339782_cvs_xptcinvoke_arm_backport_1.13.patch 1970-01-01 00:00:00 +0000
+++ debian/patches/bz339782_cvs_xptcinvoke_arm_backport_1.13.patch 2009-06-25 17:34:31 +0000
@@ -0,0 +1,83 @@
1Index: mozilla/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_arm.cpp
2===================================================================
3--- mozilla.orig/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_arm.cpp 2009-06-25 11:12:00.000000000 -0400
4+++ mozilla/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_arm.cpp 2009-06-25 11:32:55.000000000 -0400
5@@ -43,6 +43,17 @@
6 #error "This code is for Linux ARM only. Check that it works on your system, too.\nBeware that this code is highly compiler dependent."
7 #endif
8
9+/* Note that we give a "worst case" estimate of how much stack _might_ be
10+* needed (for __ARM_EABI__), rather than the real count - this should be safe */
11+
12+#ifdef __ARM_EABI__
13+#define DOUBLEWORD_ALIGN(p) ((PRUint32 *)((((PRUint32)(p)) + 7) & 0xfffffff8))
14+#define VAR_STACK_SIZE_64 3
15+#else
16+#define DOUBLEWORD_ALIGN(p) (p)
17+#define VAR_STACK_SIZE_64 2
18+#endif
19+
20 // Remember that these 'words' are 32bit DWORDS
21
22 static PRUint32
23@@ -64,7 +75,7 @@
24 result++;
25 break;
26 case nsXPTType::T_I64 :
27- result+=2;
28+ result+=VAR_STACK_SIZE_64;
29 break;
30 case nsXPTType::T_U8 :
31 case nsXPTType::T_U16 :
32@@ -72,13 +83,13 @@
33 result++;
34 break;
35 case nsXPTType::T_U64 :
36- result+=2;
37+ result+=VAR_STACK_SIZE_64 ;
38 break;
39 case nsXPTType::T_FLOAT :
40 result++;
41 break;
42 case nsXPTType::T_DOUBLE :
43- result+=2;
44+ result+=VAR_STACK_SIZE_64 ;
45 break;
46 case nsXPTType::T_BOOL :
47 case nsXPTType::T_CHAR :
48@@ -91,6 +102,15 @@
49 break;
50 }
51 }
52+
53+#ifdef __ARM_EABI__
54+ /* Ensure stack is always aligned to doubleword boundary; we take 3 words
55+ * off the stack to r1-r3 later, so it must always be on _odd_ word
56+ * boundary after this */
57+ if (result % 2 == 0)
58+ result++;
59+#endif
60+
61 return result;
62 }
63
64@@ -109,13 +129,16 @@
65 case nsXPTType::T_I8 : *((PRInt8*) d) = s->val.i8; break;
66 case nsXPTType::T_I16 : *((PRInt16*) d) = s->val.i16; break;
67 case nsXPTType::T_I32 : *((PRInt32*) d) = s->val.i32; break;
68- case nsXPTType::T_I64 : *((PRInt64*) d) = s->val.i64; d++; break;
69+ case nsXPTType::T_I64 : d = DOUBLEWORD_ALIGN(d);
70+ *((PRInt64*) d) = s->val.i64; d++; break;
71 case nsXPTType::T_U8 : *((PRUint8*) d) = s->val.u8; break;
72 case nsXPTType::T_U16 : *((PRUint16*)d) = s->val.u16; break;
73 case nsXPTType::T_U32 : *((PRUint32*)d) = s->val.u32; break;
74- case nsXPTType::T_U64 : *((PRUint64*)d) = s->val.u64; d++; break;
75+ case nsXPTType::T_U64 : d = DOUBLEWORD_ALIGN(d);
76+ *((PRUint64*)d) = s->val.u64; d++; break;
77 case nsXPTType::T_FLOAT : *((float*) d) = s->val.f; break;
78- case nsXPTType::T_DOUBLE : *((double*) d) = s->val.d; d++; break;
79+ case nsXPTType::T_DOUBLE : d = DOUBLEWORD_ALIGN(d);
80+ *((double*) d) = s->val.d; d++; break;
81 case nsXPTType::T_BOOL : *((PRBool*) d) = s->val.b; break;
82 case nsXPTType::T_CHAR : *((char*) d) = s->val.c; break;
83 case nsXPTType::T_WCHAR : *((wchar_t*) d) = s->val.wc; break;
084
=== modified file 'debian/patches/series'
--- debian/patches/series 2009-06-08 14:16:01 +0000
+++ debian/patches/series 2009-06-25 17:34:31 +0000
@@ -19,5 +19,7 @@
1938_arm_xpcom_optim.dpatch1938_arm_xpcom_optim.dpatch
20412610_attachment_309958.patch20412610_attachment_309958.patch
21lp345189_absolute_font_sizing.patch21lp345189_absolute_font_sizing.patch
22bz322806_arm-vfp-2538:3f78d5e894bc.patch
22ftbfs_gcc44_elif.patch23ftbfs_gcc44_elif.patch
23autoconf-regen24autoconf-regen
25bz339782_cvs_xptcinvoke_arm_backport_1.13.patch
2426
=== modified file 'debian/rules'
--- debian/rules 2009-04-03 09:55:19 +0000
+++ debian/rules 2009-06-25 17:34:31 +0000
@@ -25,6 +25,11 @@
25 OPTFLAGS = -O2 -fno-strict-aliasing25 OPTFLAGS = -O2 -fno-strict-aliasing
26endif26endif
2727
28ifeq ($(DEB_HOST_ARCH),armel)
29 CC=gcc-4.3
30 CXX=g++-4.3
31endif
32
28OPTFLAGS += -g33OPTFLAGS += -g
2934
30#DEB_AUTO_UPDATE_DEBIAN_CONTROL=135#DEB_AUTO_UPDATE_DEBIAN_CONTROL=1

Subscribers

People subscribed via source and target branches