author | Wolfgang Rosenauer <wr@rosenauer.org> |
Wed, 25 Apr 2012 08:01:11 +0200 | |
branch | firefox12 |
changeset 430 | 50cded244cd7 |
parent 424 | 44d79c1f5826 |
child 449 | feee012b5199 |
permissions | -rw-r--r-- |
422
35be97f6fdf7
fix some gcc 4.7 issues (not complete; still not building)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
1 |
# HG changeset patch |
424 | 2 |
# Parent debab900e37fdd4f8981c06beef6f193a04bd2b7 |
422
35be97f6fdf7
fix some gcc 4.7 issues (not complete; still not building)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
3 |
Patch to make Mozilla build with gcc 4.7, including |
35be97f6fdf7
fix some gcc 4.7 issues (not complete; still not building)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
4 |
- Bug 725655 - gcc 4.7 build failures (missing headers) (TM: Mozilla13) |
424 | 5 |
- Bug 734490 - "no viable overloaded 'PRIxPTR'" when building with Clang or GCC 4.7 (TM: Mozilla14) |
422
35be97f6fdf7
fix some gcc 4.7 issues (not complete; still not building)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
6 |
|
35be97f6fdf7
fix some gcc 4.7 issues (not complete; still not building)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
7 |
diff --git a/ipc/chromium/src/base/file_util_linux.cc b/ipc/chromium/src/base/file_util_linux.cc |
35be97f6fdf7
fix some gcc 4.7 issues (not complete; still not building)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
8 |
--- a/ipc/chromium/src/base/file_util_linux.cc |
35be97f6fdf7
fix some gcc 4.7 issues (not complete; still not building)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
9 |
+++ b/ipc/chromium/src/base/file_util_linux.cc |
35be97f6fdf7
fix some gcc 4.7 issues (not complete; still not building)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
10 |
@@ -1,15 +1,18 @@ |
35be97f6fdf7
fix some gcc 4.7 issues (not complete; still not building)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
11 |
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
35be97f6fdf7
fix some gcc 4.7 issues (not complete; still not building)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
12 |
// Use of this source code is governed by a BSD-style license that can be |
35be97f6fdf7
fix some gcc 4.7 issues (not complete; still not building)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
13 |
// found in the LICENSE file. |
35be97f6fdf7
fix some gcc 4.7 issues (not complete; still not building)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
14 |
|
35be97f6fdf7
fix some gcc 4.7 issues (not complete; still not building)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
15 |
#include "base/file_util.h" |
35be97f6fdf7
fix some gcc 4.7 issues (not complete; still not building)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
16 |
|
35be97f6fdf7
fix some gcc 4.7 issues (not complete; still not building)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
17 |
#include <fcntl.h> |
35be97f6fdf7
fix some gcc 4.7 issues (not complete; still not building)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
18 |
+#if defined(ANDROID) || defined(OS_POSIX) |
35be97f6fdf7
fix some gcc 4.7 issues (not complete; still not building)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
19 |
+#include <unistd.h> |
35be97f6fdf7
fix some gcc 4.7 issues (not complete; still not building)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
20 |
+#endif |
35be97f6fdf7
fix some gcc 4.7 issues (not complete; still not building)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
21 |
|
35be97f6fdf7
fix some gcc 4.7 issues (not complete; still not building)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
22 |
#include <string> |
35be97f6fdf7
fix some gcc 4.7 issues (not complete; still not building)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
23 |
#include <vector> |
35be97f6fdf7
fix some gcc 4.7 issues (not complete; still not building)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
24 |
|
35be97f6fdf7
fix some gcc 4.7 issues (not complete; still not building)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
25 |
#include "base/eintr_wrapper.h" |
35be97f6fdf7
fix some gcc 4.7 issues (not complete; still not building)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
26 |
#include "base/file_path.h" |
35be97f6fdf7
fix some gcc 4.7 issues (not complete; still not building)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
27 |
#include "base/string_util.h" |
35be97f6fdf7
fix some gcc 4.7 issues (not complete; still not building)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
28 |
|
35be97f6fdf7
fix some gcc 4.7 issues (not complete; still not building)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
29 |
diff --git a/ipc/chromium/src/base/message_pump_libevent.cc b/ipc/chromium/src/base/message_pump_libevent.cc |
35be97f6fdf7
fix some gcc 4.7 issues (not complete; still not building)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
30 |
--- a/ipc/chromium/src/base/message_pump_libevent.cc |
35be97f6fdf7
fix some gcc 4.7 issues (not complete; still not building)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
31 |
+++ b/ipc/chromium/src/base/message_pump_libevent.cc |
35be97f6fdf7
fix some gcc 4.7 issues (not complete; still not building)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
32 |
@@ -1,16 +1,19 @@ |
35be97f6fdf7
fix some gcc 4.7 issues (not complete; still not building)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
33 |
// Copyright (c) 2008 The Chromium Authors. All rights reserved. |
35be97f6fdf7
fix some gcc 4.7 issues (not complete; still not building)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
34 |
// Use of this source code is governed by a BSD-style license that can be |
35be97f6fdf7
fix some gcc 4.7 issues (not complete; still not building)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
35 |
// found in the LICENSE file. |
35be97f6fdf7
fix some gcc 4.7 issues (not complete; still not building)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
36 |
|
35be97f6fdf7
fix some gcc 4.7 issues (not complete; still not building)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
37 |
#include "base/message_pump_libevent.h" |
35be97f6fdf7
fix some gcc 4.7 issues (not complete; still not building)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
38 |
|
35be97f6fdf7
fix some gcc 4.7 issues (not complete; still not building)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
39 |
#include <errno.h> |
35be97f6fdf7
fix some gcc 4.7 issues (not complete; still not building)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
40 |
#include <fcntl.h> |
35be97f6fdf7
fix some gcc 4.7 issues (not complete; still not building)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
41 |
+#if defined(ANDROID) || defined(OS_POSIX) |
35be97f6fdf7
fix some gcc 4.7 issues (not complete; still not building)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
42 |
+#include <unistd.h> |
35be97f6fdf7
fix some gcc 4.7 issues (not complete; still not building)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
43 |
+#endif |
35be97f6fdf7
fix some gcc 4.7 issues (not complete; still not building)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
44 |
|
35be97f6fdf7
fix some gcc 4.7 issues (not complete; still not building)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
45 |
#include "eintr_wrapper.h" |
35be97f6fdf7
fix some gcc 4.7 issues (not complete; still not building)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
46 |
#include "base/logging.h" |
35be97f6fdf7
fix some gcc 4.7 issues (not complete; still not building)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
47 |
#include "base/scoped_nsautorelease_pool.h" |
35be97f6fdf7
fix some gcc 4.7 issues (not complete; still not building)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
48 |
#include "base/scoped_ptr.h" |
35be97f6fdf7
fix some gcc 4.7 issues (not complete; still not building)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
49 |
#include "base/time.h" |
35be97f6fdf7
fix some gcc 4.7 issues (not complete; still not building)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
50 |
#include "third_party/libevent/event.h" |
35be97f6fdf7
fix some gcc 4.7 issues (not complete; still not building)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
51 |
|
35be97f6fdf7
fix some gcc 4.7 issues (not complete; still not building)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
52 |
diff --git a/ipc/chromium/src/base/time_posix.cc b/ipc/chromium/src/base/time_posix.cc |
35be97f6fdf7
fix some gcc 4.7 issues (not complete; still not building)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
53 |
--- a/ipc/chromium/src/base/time_posix.cc |
35be97f6fdf7
fix some gcc 4.7 issues (not complete; still not building)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
54 |
+++ b/ipc/chromium/src/base/time_posix.cc |
35be97f6fdf7
fix some gcc 4.7 issues (not complete; still not building)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
55 |
@@ -8,16 +8,19 @@ |
35be97f6fdf7
fix some gcc 4.7 issues (not complete; still not building)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
56 |
#include <mach/mach_time.h> |
35be97f6fdf7
fix some gcc 4.7 issues (not complete; still not building)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
57 |
#endif |
35be97f6fdf7
fix some gcc 4.7 issues (not complete; still not building)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
58 |
#include <sys/time.h> |
35be97f6fdf7
fix some gcc 4.7 issues (not complete; still not building)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
59 |
#ifdef ANDROID |
35be97f6fdf7
fix some gcc 4.7 issues (not complete; still not building)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
60 |
#include <time64.h> |
35be97f6fdf7
fix some gcc 4.7 issues (not complete; still not building)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
61 |
#else |
35be97f6fdf7
fix some gcc 4.7 issues (not complete; still not building)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
62 |
#include <time.h> |
35be97f6fdf7
fix some gcc 4.7 issues (not complete; still not building)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
63 |
#endif |
35be97f6fdf7
fix some gcc 4.7 issues (not complete; still not building)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
64 |
+#if defined(ANDROID) || defined(OS_POSIX) |
35be97f6fdf7
fix some gcc 4.7 issues (not complete; still not building)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
65 |
+#include <unistd.h> |
35be97f6fdf7
fix some gcc 4.7 issues (not complete; still not building)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
66 |
+#endif |
35be97f6fdf7
fix some gcc 4.7 issues (not complete; still not building)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
67 |
|
35be97f6fdf7
fix some gcc 4.7 issues (not complete; still not building)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
68 |
#include <limits> |
35be97f6fdf7
fix some gcc 4.7 issues (not complete; still not building)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
69 |
|
35be97f6fdf7
fix some gcc 4.7 issues (not complete; still not building)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
70 |
#include "base/basictypes.h" |
35be97f6fdf7
fix some gcc 4.7 issues (not complete; still not building)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
71 |
#include "base/logging.h" |
35be97f6fdf7
fix some gcc 4.7 issues (not complete; still not building)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
72 |
|
35be97f6fdf7
fix some gcc 4.7 issues (not complete; still not building)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
73 |
namespace base { |
35be97f6fdf7
fix some gcc 4.7 issues (not complete; still not building)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
74 |
|
424 | 75 |
diff --git a/layout/base/tests/TestPoisonArea.cpp b/layout/base/tests/TestPoisonArea.cpp |
76 |
--- a/layout/base/tests/TestPoisonArea.cpp |
|
77 |
+++ b/layout/base/tests/TestPoisonArea.cpp |
|
78 |
@@ -392,53 +392,53 @@ ReservePoisonArea() |
|
79 |
{ |
|
80 |
if (sizeof(uintptr_t) == 8) { |
|
81 |
// Use the hardware-inaccessible region. |
|
82 |
// We have to avoid 64-bit constants and shifts by 32 bits, since this |
|
83 |
// code is compiled in 32-bit mode, although it is never executed there. |
|
84 |
uintptr_t result = (((uintptr_t(0x7FFFFFFFu) << 31) << 1 | |
|
85 |
uintptr_t(0xF0DEAFFFu)) & |
|
86 |
~uintptr_t(PAGESIZE-1)); |
|
87 |
- printf("INFO | poison area assumed at 0x%.*"PRIxPTR"\n", SIZxPTR, result); |
|
88 |
+ printf("INFO | poison area assumed at 0x%.*" PRIxPTR "\n", SIZxPTR, result); |
|
89 |
return result; |
|
90 |
} else { |
|
91 |
// First see if we can allocate the preferred poison address from the OS. |
|
92 |
uintptr_t candidate = (0xF0DEAFFF & ~(PAGESIZE-1)); |
|
93 |
void *result = ReserveRegion(candidate, false); |
|
94 |
if (result == (void *)candidate) { |
|
95 |
// success - inaccessible page allocated |
|
96 |
- printf("INFO | poison area allocated at 0x%.*"PRIxPTR |
|
97 |
+ printf("INFO | poison area allocated at 0x%.*" PRIxPTR |
|
98 |
" (preferred addr)\n", SIZxPTR, (uintptr_t)result); |
|
99 |
return candidate; |
|
100 |
} |
|
101 |
||
102 |
// That didn't work, so see if the preferred address is within a range |
|
103 |
// of permanently inacessible memory. |
|
104 |
if (ProbeRegion(candidate)) { |
|
105 |
// success - selected page cannot be usable memory |
|
106 |
if (result != MAP_FAILED) |
|
107 |
ReleaseRegion(result); |
|
108 |
- printf("INFO | poison area assumed at 0x%.*"PRIxPTR |
|
109 |
+ printf("INFO | poison area assumed at 0x%.*" PRIxPTR |
|
110 |
" (preferred addr)\n", SIZxPTR, candidate); |
|
111 |
return candidate; |
|
112 |
} |
|
113 |
||
114 |
// The preferred address is already in use. Did the OS give us a |
|
115 |
// consolation prize? |
|
116 |
if (result != MAP_FAILED) { |
|
117 |
- printf("INFO | poison area allocated at 0x%.*"PRIxPTR |
|
118 |
+ printf("INFO | poison area allocated at 0x%.*" PRIxPTR |
|
119 |
" (consolation prize)\n", SIZxPTR, (uintptr_t)result); |
|
120 |
return (uintptr_t)result; |
|
121 |
} |
|
122 |
||
123 |
// It didn't, so try to allocate again, without any constraint on |
|
124 |
// the address. |
|
125 |
result = ReserveRegion(0, false); |
|
126 |
if (result != MAP_FAILED) { |
|
127 |
- printf("INFO | poison area allocated at 0x%.*"PRIxPTR |
|
128 |
+ printf("INFO | poison area allocated at 0x%.*" PRIxPTR |
|
129 |
" (fallback)\n", SIZxPTR, (uintptr_t)result); |
|
130 |
return (uintptr_t)result; |
|
131 |
} |
|
132 |
||
133 |
printf("ERROR | no usable poison area found\n"); |
|
134 |
return 0; |
|
135 |
} |
|
136 |
} |
|
137 |
@@ -450,17 +450,17 @@ static uintptr_t |
|
138 |
ReservePositiveControl() |
|
139 |
{ |
|
140 |
||
141 |
void *result = ReserveRegion(0, false); |
|
142 |
if (result == MAP_FAILED) { |
|
143 |
printf("ERROR | allocating positive control | %s\n", LastErrMsg()); |
|
144 |
return 0; |
|
145 |
} |
|
146 |
- printf("INFO | positive control allocated at 0x%.*"PRIxPTR"\n", |
|
147 |
+ printf("INFO | positive control allocated at 0x%.*" PRIxPTR "\n", |
|
148 |
SIZxPTR, (uintptr_t)result); |
|
149 |
return (uintptr_t)result; |
|
150 |
} |
|
151 |
||
152 |
/* The "negative control" area confirms that our probe logic does detect a |
|
153 |
* page that is readable, writable, or executable. |
|
154 |
*/ |
|
155 |
static uintptr_t |
|
156 |
@@ -481,17 +481,17 @@ ReserveNegativeControl() |
|
157 |
// Now mark it executable as well as readable and writable. |
|
158 |
// (mmap(PROT_EXEC) may fail when applied to anonymous memory.) |
|
159 |
||
160 |
if (MakeRegionExecutable(result)) { |
|
161 |
printf("ERROR | making negative control executable | %s\n", LastErrMsg()); |
|
162 |
return 0; |
|
163 |
} |
|
164 |
||
165 |
- printf("INFO | negative control allocated at 0x%.*"PRIxPTR"\n", |
|
166 |
+ printf("INFO | negative control allocated at 0x%.*" PRIxPTR "\n", |
|
167 |
SIZxPTR, (uintptr_t)result); |
|
168 |
return (uintptr_t)result; |
|
169 |
} |
|
170 |
||
171 |
static void |
|
172 |
JumpTo(uintptr_t opaddr) |
|
173 |
{ |
|
174 |
#ifdef __ia64 |