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
1=== modified file 'debian/changelog'
2--- debian/changelog 2009-06-16 12:02:14 +0000
3+++ debian/changelog 2009-06-25 17:34:31 +0000
4@@ -1,3 +1,24 @@
5+thunderbird (2.0.0.22+build1+nobinonly-0ubuntu2) UNRELEASED; urgency=low
6+
7+ [ Loic Minier ]
8+ * debian/patches/bz322806_arm-vfp-2538:3f78d5e894bc
9+ - Created from hg rev 2538:3f78d5e894bc pulled from
10+ http://hg.mozilla.org/releases/mozilla-1.9.1/, fixes crash in
11+ JS due to usage of wrong floating point number format; thanks Michael
12+ Casadevall for the research and locating the fix; LP: #385325.
13+ - Based off Mozilla Bugzilla 322806
14+
15+ [ Michael Casadevall ]
16+ * debian/patches/bz339782_cvs_xptcinvoke_arm_backport_1.13.patch:
17+ - Backport of xptcinvoke_arm.cpp from TB3 HEAD, corrects stack corruption
18+ issues on ARM EABI. Patch based off Mozilla Bugzilla 339782
19+ * debian/rules:
20+ - Changed default compiler on ARM to gcc-4.3 due to 4.4 ICE
21+ * debian/control:
22+ - Added build dep on gcc-4.3 and g++-4.3 on ARM
23+
24+ -- Michael Casadevall <mcasadevall@ubuntu.com> Thu, 25 Jun 2009 12:37:15 -0400
25+
26 thunderbird (2.0.0.22+build1+nobinonly-0ubuntu1.nspr474) karmic; urgency=low
27
28 * security/stability update 2.0.0.22 (USN-782-1)
29
30=== modified file 'debian/control'
31--- debian/control 2009-06-16 12:01:31 +0000
32+++ debian/control 2009-06-25 17:34:31 +0000
33@@ -31,7 +31,9 @@
34 libhunspell-dev,
35 libnss3-dev,
36 libnspr4-dev (>= 4.7.4),
37- docbook-to-man
38+ docbook-to-man,
39+ gcc-4.3 [armel],
40+ g++-4.3 [armel]
41 Standards-Version: 3.7.3
42
43 Package: thunderbird
44
45=== added file 'debian/patches/bz322806_arm-vfp-2538:3f78d5e894bc.patch'
46--- debian/patches/bz322806_arm-vfp-2538:3f78d5e894bc.patch 1970-01-01 00:00:00 +0000
47+++ debian/patches/bz322806_arm-vfp-2538:3f78d5e894bc.patch 2009-06-25 17:34:31 +0000
48@@ -0,0 +1,41 @@
49+diff --git a/js/src/jsnum.h b/js/src/jsnum.h
50+index c0f5223..22ae290 100644
51+--- a/js/src/jsnum.h
52++++ b/js/src/jsnum.h
53+@@ -54,21 +54,20 @@
54+ JS_BEGIN_EXTERN_C
55+
56+ /*
57+- * Stefan Hanske <sh990154@mail.uni-greifswald.de> reports:
58+- * ARM is a little endian architecture but 64 bit double words are stored
59+- * differently: the 32 bit words are in little endian byte order, the two words
60+- * are stored in big endian`s way.
61++ * The ARM architecture supports two floating point models: VFP and FPA. When
62++ * targetting FPA, doubles are mixed-endian on little endian ARMs (meaning that
63++ * the high and low words are in big endian order).
64+ */
65+
66+ #if defined(__arm) || defined(__arm32__) || defined(__arm26__) || defined(__arm__)
67+-#ifndef __QNXNTO__
68+-#define CPU_IS_ARM
69++#if !defined(__VFP_FP__)
70++#define FPU_IS_ARM_FPA
71+ #endif
72+ #endif
73+
74+ typedef union jsdpun {
75+ struct {
76+-#if defined(IS_LITTLE_ENDIAN) && !defined(CPU_IS_ARM)
77++#if defined(IS_LITTLE_ENDIAN) && !defined(FPU_IS_ARM_FPA)
78+ uint32 lo, hi;
79+ #else
80+ uint32 hi, lo;
81+@@ -97,7 +96,7 @@ typedef union jsdpun {
82+ * so this code should work.
83+ */
84+
85+-#if defined(IS_LITTLE_ENDIAN) && !defined(CPU_IS_ARM)
86++#if defined(IS_LITTLE_ENDIAN) && !defined(FPU_IS_ARM_FPA)
87+ #define JSDOUBLE_HI32(x) (((uint32 *)&(x))[1])
88+ #define JSDOUBLE_LO32(x) (((uint32 *)&(x))[0])
89+ #else
90
91=== added file 'debian/patches/bz339782_cvs_xptcinvoke_arm_backport_1.13.patch'
92--- debian/patches/bz339782_cvs_xptcinvoke_arm_backport_1.13.patch 1970-01-01 00:00:00 +0000
93+++ debian/patches/bz339782_cvs_xptcinvoke_arm_backport_1.13.patch 2009-06-25 17:34:31 +0000
94@@ -0,0 +1,83 @@
95+Index: mozilla/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_arm.cpp
96+===================================================================
97+--- mozilla.orig/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_arm.cpp 2009-06-25 11:12:00.000000000 -0400
98++++ mozilla/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_arm.cpp 2009-06-25 11:32:55.000000000 -0400
99+@@ -43,6 +43,17 @@
100+ #error "This code is for Linux ARM only. Check that it works on your system, too.\nBeware that this code is highly compiler dependent."
101+ #endif
102+
103++/* Note that we give a "worst case" estimate of how much stack _might_ be
104++* needed (for __ARM_EABI__), rather than the real count - this should be safe */
105++
106++#ifdef __ARM_EABI__
107++#define DOUBLEWORD_ALIGN(p) ((PRUint32 *)((((PRUint32)(p)) + 7) & 0xfffffff8))
108++#define VAR_STACK_SIZE_64 3
109++#else
110++#define DOUBLEWORD_ALIGN(p) (p)
111++#define VAR_STACK_SIZE_64 2
112++#endif
113++
114+ // Remember that these 'words' are 32bit DWORDS
115+
116+ static PRUint32
117+@@ -64,7 +75,7 @@
118+ result++;
119+ break;
120+ case nsXPTType::T_I64 :
121+- result+=2;
122++ result+=VAR_STACK_SIZE_64;
123+ break;
124+ case nsXPTType::T_U8 :
125+ case nsXPTType::T_U16 :
126+@@ -72,13 +83,13 @@
127+ result++;
128+ break;
129+ case nsXPTType::T_U64 :
130+- result+=2;
131++ result+=VAR_STACK_SIZE_64 ;
132+ break;
133+ case nsXPTType::T_FLOAT :
134+ result++;
135+ break;
136+ case nsXPTType::T_DOUBLE :
137+- result+=2;
138++ result+=VAR_STACK_SIZE_64 ;
139+ break;
140+ case nsXPTType::T_BOOL :
141+ case nsXPTType::T_CHAR :
142+@@ -91,6 +102,15 @@
143+ break;
144+ }
145+ }
146++
147++#ifdef __ARM_EABI__
148++ /* Ensure stack is always aligned to doubleword boundary; we take 3 words
149++ * off the stack to r1-r3 later, so it must always be on _odd_ word
150++ * boundary after this */
151++ if (result % 2 == 0)
152++ result++;
153++#endif
154++
155+ return result;
156+ }
157+
158+@@ -109,13 +129,16 @@
159+ case nsXPTType::T_I8 : *((PRInt8*) d) = s->val.i8; break;
160+ case nsXPTType::T_I16 : *((PRInt16*) d) = s->val.i16; break;
161+ case nsXPTType::T_I32 : *((PRInt32*) d) = s->val.i32; break;
162+- case nsXPTType::T_I64 : *((PRInt64*) d) = s->val.i64; d++; break;
163++ case nsXPTType::T_I64 : d = DOUBLEWORD_ALIGN(d);
164++ *((PRInt64*) d) = s->val.i64; d++; break;
165+ case nsXPTType::T_U8 : *((PRUint8*) d) = s->val.u8; break;
166+ case nsXPTType::T_U16 : *((PRUint16*)d) = s->val.u16; break;
167+ case nsXPTType::T_U32 : *((PRUint32*)d) = s->val.u32; break;
168+- case nsXPTType::T_U64 : *((PRUint64*)d) = s->val.u64; d++; break;
169++ case nsXPTType::T_U64 : d = DOUBLEWORD_ALIGN(d);
170++ *((PRUint64*)d) = s->val.u64; d++; break;
171+ case nsXPTType::T_FLOAT : *((float*) d) = s->val.f; break;
172+- case nsXPTType::T_DOUBLE : *((double*) d) = s->val.d; d++; break;
173++ case nsXPTType::T_DOUBLE : d = DOUBLEWORD_ALIGN(d);
174++ *((double*) d) = s->val.d; d++; break;
175+ case nsXPTType::T_BOOL : *((PRBool*) d) = s->val.b; break;
176+ case nsXPTType::T_CHAR : *((char*) d) = s->val.c; break;
177+ case nsXPTType::T_WCHAR : *((wchar_t*) d) = s->val.wc; break;
178
179=== modified file 'debian/patches/series'
180--- debian/patches/series 2009-06-08 14:16:01 +0000
181+++ debian/patches/series 2009-06-25 17:34:31 +0000
182@@ -19,5 +19,7 @@
183 38_arm_xpcom_optim.dpatch
184 412610_attachment_309958.patch
185 lp345189_absolute_font_sizing.patch
186+bz322806_arm-vfp-2538:3f78d5e894bc.patch
187 ftbfs_gcc44_elif.patch
188 autoconf-regen
189+bz339782_cvs_xptcinvoke_arm_backport_1.13.patch
190
191=== modified file 'debian/rules'
192--- debian/rules 2009-04-03 09:55:19 +0000
193+++ debian/rules 2009-06-25 17:34:31 +0000
194@@ -25,6 +25,11 @@
195 OPTFLAGS = -O2 -fno-strict-aliasing
196 endif
197
198+ifeq ($(DEB_HOST_ARCH),armel)
199+ CC=gcc-4.3
200+ CXX=g++-4.3
201+endif
202+
203 OPTFLAGS += -g
204
205 #DEB_AUTO_UPDATE_DEBIAN_CONTROL=1

Subscribers

People subscribed via source and target branches