File: 0006-strtod_arm_fix.patch

package info (click to toggle)
php5 5.6.33%2Bdfsg-0%2Bdeb8u1
  • links: PTS, VCS
  • area: main
  • in suites: jessie
  • size: 157,872 kB
  • sloc: ansic: 756,065; php: 22,030; sh: 12,311; cpp: 8,771; xml: 6,179; yacc: 1,564; exp: 1,514; makefile: 1,467; pascal: 1,147; awk: 538; perl: 315; sql: 22
file content (54 lines) | stat: -rw-r--r-- 1,813 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
From: Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>
Date: Sat, 2 May 2015 10:26:51 +0200
Subject: strtod_arm_fix

---
 Zend/zend_strtod.c | 27 +++++++++++++++++++--------
 1 file changed, 19 insertions(+), 8 deletions(-)

diff --git a/Zend/zend_strtod.c b/Zend/zend_strtod.c
index e74cf0e..7ec0366 100644
--- a/Zend/zend_strtod.c
+++ b/Zend/zend_strtod.c
@@ -152,14 +152,25 @@ typedef unsigned long int uint32_t;
 #define IEEE_LITTLE_ENDIAN
 #endif
 
-#if defined(__arm__) && !defined(__VFP_FP__)
-/*
- *  * Although the CPU is little endian the FP has different
- *   * byte and word endianness. The byte order is still little endian
- *    * but the word order is big endian.
- *     */
-#define IEEE_BIG_ENDIAN
+#if defined(__arm__) || defined(__thumb__)
+/* ARM traditionally used big-endian words; and within those words the
+   byte ordering was big or little endian depending upon the target.
+   Modern floating-point formats are naturally ordered; in this case
+   __VFP_FP__ will be defined, even if soft-float. */
 #undef IEEE_LITTLE_ENDIAN
+#undef IEEE_BIG_ENDIAN
+#if defined(__VFP_FP__) || defined(__MAVERICK__)
+# ifdef __ARMEL__
+#  define IEEE_LITTLE_ENDIAN
+# else
+#  define IEEE_BIG_ENDIAN
+# endif
+#else
+# define IEEE_BIG_ENDIAN
+# ifdef __ARMEL__
+#  define IEEE_BYTES_LITTLE_ENDIAN
+# endif
+#endif
 #endif
 
 #ifdef __vax__
@@ -287,7 +298,7 @@ BEGIN_EXTERN_C()
  * An alternative that might be better on some machines is
  * #define Storeinc(a,b,c) (*a++ = b << 16 | c & 0xffff)
  */
-#if defined(IEEE_LITTLE_ENDIAN) + defined(VAX) + defined(__arm__)
+#if defined(IEEE_LITTLE_ENDIAN) + defined(VAX) + defined(IEEE_BYTES_LITTLE_ENDIAN)
 #define Storeinc(a,b,c) (((unsigned short *)a)[1] = (unsigned short)b, \
 		((unsigned short *)a)[0] = (unsigned short)c, a++)
 #else