forked from sabotage-linux/sabotage
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfirefox-gregor.patch
433 lines (400 loc) · 15.3 KB
/
firefox-gregor.patch
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
diff -r 06549f98901b ipc/chromium/src/base/debug_util_posix.cc
--- a/ipc/chromium/src/base/debug_util_posix.cc Fri Aug 02 14:36:52 2013 +0000
+++ b/ipc/chromium/src/base/debug_util_posix.cc Fri Aug 02 14:42:20 2013 +0000
@@ -5,7 +5,7 @@
#include "build/build_config.h"
#include "base/debug_util.h"
-#define MOZ_HAVE_EXECINFO_H (defined(OS_LINUX) && !defined(ANDROID))
+#define MOZ_HAVE_EXECINFO_H (defined(OS_LINUX) && defined(__GLIBC__))
#include <errno.h>
#include <fcntl.h>
diff -r 06549f98901b ipc/chromium/src/base/file_util.h
--- a/ipc/chromium/src/base/file_util.h Fri Aug 02 14:36:52 2013 +0000
+++ b/ipc/chromium/src/base/file_util.h Fri Aug 02 14:42:20 2013 +0000
@@ -16,7 +16,11 @@
#include <sys/stat.h>
#elif defined(OS_POSIX)
#include <sys/types.h>
+#ifndef __GLIBC__
+#define NO_FTS
+#else
#include <fts.h>
+#endif
#include <sys/stat.h>
#endif
diff -r 06549f98901b ipc/chromium/src/base/file_util_posix.cc
--- a/ipc/chromium/src/base/file_util_posix.cc Fri Aug 02 14:36:52 2013 +0000
+++ b/ipc/chromium/src/base/file_util_posix.cc Fri Aug 02 14:42:20 2013 +0000
@@ -8,13 +8,16 @@
#include <errno.h>
#include <fcntl.h>
#include <fnmatch.h>
-#ifndef ANDROID
+#ifndef __GLIBC__
+#define NO_FTS
+#endif
+#ifndef NO_FTS
#include <fts.h>
#endif
#include <libgen.h>
#include <stdio.h>
#include <string.h>
-#include <sys/errno.h>
+#include <errno.h>
#include <sys/mman.h>
#define _DARWIN_USE_64_BIT_INODE // Use 64-bit inode data structures
#include <sys/stat.h>
@@ -121,7 +124,7 @@
if (!recursive)
return (rmdir(path_str) == 0);
-#ifdef ANDROID
+#ifdef NO_FTS
// XXX Need ftsless impl for bionic
return false;
#else
@@ -194,7 +197,7 @@
return false;
}
-#ifdef ANDROID
+#ifdef NO_FTS
// XXX Need ftsless impl for bionic
return false;
#else
diff -r 06549f98901b ipc/chromium/src/base/time_posix.cc
--- a/ipc/chromium/src/base/time_posix.cc Fri Aug 02 14:36:52 2013 +0000
+++ b/ipc/chromium/src/base/time_posix.cc Fri Aug 02 14:42:20 2013 +0000
@@ -65,8 +65,10 @@
timestruct.tm_wday = exploded.day_of_week; // mktime/timegm ignore this
timestruct.tm_yday = 0; // mktime/timegm ignore this
timestruct.tm_isdst = -1; // attempt to figure it out
+#ifdef __GLIBC__
timestruct.tm_gmtoff = 0; // not a POSIX field, so mktime/timegm ignore
timestruct.tm_zone = NULL; // not a POSIX field, so mktime/timegm ignore
+#endif
time_t seconds;
#ifdef ANDROID
diff -r 06549f98901b media/libcubeb/src/cubeb_alsa.c
--- a/media/libcubeb/src/cubeb_alsa.c Fri Aug 02 14:36:52 2013 +0000
+++ b/media/libcubeb/src/cubeb_alsa.c Fri Aug 02 14:42:20 2013 +0000
@@ -6,6 +6,7 @@
*/
#undef NDEBUG
#define _BSD_SOURCE
+#define _POSIX_C_SOURCE 200112L
#define _XOPEN_SOURCE 500
#include <pthread.h>
#include <sys/time.h>
diff -r 06549f98901b media/webrtc/trunk/testing/gtest/src/gtest.cc
--- a/media/webrtc/trunk/testing/gtest/src/gtest.cc Fri Aug 02 14:36:52 2013 +0000
+++ b/media/webrtc/trunk/testing/gtest/src/gtest.cc Fri Aug 02 14:42:20 2013 +0000
@@ -48,6 +48,8 @@
#include <sstream>
#include <vector>
+#include <sys/socket.h>
+
#if GTEST_OS_LINUX
// TODO(kenton@google.com): Use autoconf to detect availability of
diff -r 06549f98901b netwerk/sctp/src/netinet/sctp_bsd_addr.c
--- a/netwerk/sctp/src/netinet/sctp_bsd_addr.c Fri Aug 02 14:36:52 2013 +0000
+++ b/netwerk/sctp/src/netinet/sctp_bsd_addr.c Fri Aug 02 14:42:20 2013 +0000
@@ -49,11 +49,9 @@
#include <netinet/sctp_sysctl.h>
#include <netinet/sctp_indata.h>
#if !defined(__Userspace_os_Windows)
+#include <unistd.h>
#if defined(ANDROID)
-#include <unistd.h>
#include <ifaddrs-android-ext.h>
-#else
-#include <sys/unistd.h>
#endif
#endif
diff -r 06549f98901b netwerk/sctp/src/netinet/sctp_os_userspace.h
--- a/netwerk/sctp/src/netinet/sctp_os_userspace.h Fri Aug 02 14:36:52 2013 +0000
+++ b/netwerk/sctp/src/netinet/sctp_os_userspace.h Fri Aug 02 14:42:20 2013 +0000
@@ -408,7 +407,7 @@
/* #include <sys/param.h> in FreeBSD defines MSIZE */
/* #include <sys/ktr.h> */
/* #include <sys/systm.h> */
-#if defined(__Userspace_os_Windows)
+#if defined(__Userspace_os_Windows) || 1
#include <user_queue.h>
#else
#include <sys/queue.h>
diff -r 06549f98901b netwerk/sctp/src/netinet/sctp_pcb.c
--- a/netwerk/sctp/src/netinet/sctp_pcb.c Fri Aug 02 14:36:52 2013 +0000
+++ b/netwerk/sctp/src/netinet/sctp_pcb.c Fri Aug 02 14:42:20 2013 +0000
@@ -30,6 +30,8 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
+#define _BSD_SOURCE /* for IPPORT_RESERVED */
+
#ifdef __FreeBSD__
#include <sys/cdefs.h>
__FBSDID("$FreeBSD: head/sys/netinet/sctp_pcb.c 246687 2013-02-11 21:02:49Z tuexen $");
@@ -69,11 +71,10 @@
#endif
#if defined(__Userspace__)
#if !defined(__Userspace_os_Windows)
+#include <netdb.h>
+#include <unistd.h>
#if defined(ANDROID)
-#include <unistd.h>
#include <ifaddrs-android-ext.h>
-#else
-#include <sys/unistd.h>
#endif
#endif
#include <user_socketvar.h>
diff -r 06549f98901b netwerk/sctp/src/user_queue.h
--- a/netwerk/sctp/src/user_queue.h Fri Aug 02 14:36:52 2013 +0000
+++ b/netwerk/sctp/src/user_queue.h Fri Aug 02 14:42:20 2013 +0000
@@ -31,9 +31,6 @@
#ifndef _USER_QUEUE_H_
#define _USER_QUEUE_H_
-#if !defined (__Userspace_os_Windows)
-#include <sys/cdefs.h>
-#endif
/*
* This file defines four types of data structures: singly-linked lists,
* singly-linked tail queues, lists and tail queues.
diff -r 06549f98901b toolkit/crashreporter/google-breakpad/src/common/linux/dump_symbols.cc
--- a/toolkit/crashreporter/google-breakpad/src/common/linux/dump_symbols.cc Fri Aug 02 14:36:52 2013 +0000
+++ b/toolkit/crashreporter/google-breakpad/src/common/linux/dump_symbols.cc Fri Aug 02 14:42:20 2013 +0000
@@ -46,6 +46,9 @@
#include <sys/stat.h>
#include <unistd.h>
+// [Gregor] POSIX specifies dirname/basename as in libgen.h
+#include <libgen.h>
+
#include <iostream>
#include <set>
#include <string>
diff -r 06549f98901b toolkit/crashreporter/google-breakpad/src/common/stabs_reader.cc
--- a/toolkit/crashreporter/google-breakpad/src/common/stabs_reader.cc Fri Aug 02 14:36:52 2013 +0000
+++ b/toolkit/crashreporter/google-breakpad/src/common/stabs_reader.cc Fri Aug 02 14:42:20 2013 +0000
@@ -41,6 +41,10 @@
#include "common/using_std_string.h"
+#ifndef N_UNDF
+#define N_UNDF 0
+#endif
+
using std::vector;
namespace google_breakpad {
diff -r 06549f98901b toolkit/crashreporter/google-breakpad/src/common/stabs_reader.h
--- a/toolkit/crashreporter/google-breakpad/src/common/stabs_reader.h Fri Aug 02 14:36:52 2013 +0000
+++ b/toolkit/crashreporter/google-breakpad/src/common/stabs_reader.h Fri Aug 02 14:42:20 2013 +0000
@@ -53,7 +53,7 @@
#include <config.h>
#endif
-#ifdef HAVE_A_OUT_H
+#if 0
#include <a.out.h>
#endif
#ifdef HAVE_MACH_O_NLIST_H
diff -r 06549f98901b toolkit/crashreporter/google-breakpad/src/stab.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/toolkit/crashreporter/google-breakpad/src/stab.h Fri Aug 02 14:42:20 2013 +0000
@@ -0,0 +1,70 @@
+/*-
+ * Copyright (c) 1991, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)stab.h 8.1 (Berkeley) 6/2/93
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _STAB_H_
+#define _STAB_H_
+
+/*
+ * The following are symbols used by various debuggers and by the Pascal
+ * compiler. Each of them must have one (or more) of the bits defined by
+ * the N_STAB mask set.
+ */
+
+#define N_GSYM 0x20 /* global symbol */
+#define N_FNAME 0x22 /* F77 function name */
+#define N_FUN 0x24 /* procedure name */
+#define N_STSYM 0x26 /* data segment variable */
+#define N_LCSYM 0x28 /* bss segment variable */
+#define N_MAIN 0x2a /* main function name */
+#define N_PC 0x30 /* global Pascal symbol */
+#define N_RSYM 0x40 /* register variable */
+#define N_SLINE 0x44 /* text segment line number */
+#define N_DSLINE 0x46 /* data segment line number */
+#define N_BSLINE 0x48 /* bss segment line number */
+#define N_SSYM 0x60 /* structure/union element */
+#define N_SO 0x64 /* main source file name */
+#define N_LSYM 0x80 /* stack variable */
+#define N_BINCL 0x82 /* include file beginning */
+#define N_SOL 0x84 /* included source file name */
+#define N_PSYM 0xa0 /* parameter variable */
+#define N_EINCL 0xa2 /* include file end */
+#define N_ENTRY 0xa4 /* alternate entry point */
+#define N_LBRAC 0xc0 /* left bracket */
+#define N_EXCL 0xc2 /* deleted include file */
+#define N_RBRAC 0xe0 /* right bracket */
+#define N_BCOMM 0xe2 /* begin common */
+#define N_ECOMM 0xe4 /* end common */
+#define N_ECOML 0xe8 /* end common (local name) */
+#define N_LENG 0xfe /* length of preceding entry */
+
+#endif
diff -r 06549f98901b toolkit/crashreporter/google-breakpad/src/third_party/lss/linux_syscall_support.h
--- a/toolkit/crashreporter/google-breakpad/src/third_party/lss/linux_syscall_support.h Fri Aug 02 14:36:52 2013 +0000
+++ b/toolkit/crashreporter/google-breakpad/src/third_party/lss/linux_syscall_support.h Fri Aug 02 14:42:20 2013 +0000
@@ -2813,7 +2813,7 @@
LSS_INLINE _syscall6(void*, mmap, void*, s,
size_t, l, int, p,
int, f, int, d,
- __off64_t, o)
+ off_t, o)
LSS_INLINE _syscall4(int, newfstatat, int, d,
const char *, p,
diff -r 06549f98901b toolkit/mozapps/update/common/updatedefines.h
--- a/toolkit/mozapps/update/common/updatedefines.h Fri Aug 02 14:36:52 2013 +0000
+++ b/toolkit/mozapps/update/common/updatedefines.h Fri Aug 02 14:42:20 2013 +0000
@@ -106,8 +106,10 @@
#ifdef SOLARIS
# include <sys/stat.h>
#else
+#if !defined(__linux__) || defined(__GLIBC__)
# include <fts.h>
#endif
+#endif
# include <dirent.h>
#ifdef XP_MACOSX
diff -r 06549f98901b toolkit/mozapps/update/updater/updater.cpp
--- a/toolkit/mozapps/update/updater/updater.cpp Fri Aug 02 14:36:52 2013 +0000
+++ b/toolkit/mozapps/update/updater/updater.cpp Fri Aug 02 14:42:20 2013 +0000
@@ -3369,6 +3369,7 @@
int add_dir_entries(const NS_tchar *dirpath, ActionList *list)
{
int rv = OK;
+#if !defined(__linux__) || defined(__GLIBC__)
FTS *ftsdir;
FTSENT *ftsdirEntry;
NS_tchar searchpath[MAXPATHLEN];
@@ -3471,6 +3472,7 @@
}
fts_close(ftsdir);
+#endif
return rv;
}
diff -r 06549f98901b toolkit/xre/nsSigHandlers.cpp
--- a/toolkit/xre/nsSigHandlers.cpp Fri Aug 02 14:36:52 2013 +0000
+++ b/toolkit/xre/nsSigHandlers.cpp Fri Aug 02 14:42:20 2013 +0000
@@ -15,6 +15,7 @@
#include <signal.h>
#include <stdio.h>
#include <string.h>
+#include <sys/types.h>
#include "prthread.h"
#include "plstr.h"
#include "prenv.h"
@@ -152,7 +153,7 @@
status->__invalid = status->__denorm = status->__zdiv = status->__ovrfl = status->__undfl =
status->__precis = status->__stkflt = status->__errsumm = 0;
- __uint32_t *mxcsr = &uc->uc_mcontext->__fs.__fpu_mxcsr;
+ u_int32_t *mxcsr = &uc->uc_mcontext->__fs.__fpu_mxcsr;
*mxcsr |= SSE_EXCEPTION_MASK; /* disable all SSE exceptions */
*mxcsr &= ~SSE_STATUS_FLAGS; /* clear all pending SSE exceptions */
#endif
@@ -172,13 +173,13 @@
*sw &= ~FPU_STATUS_FLAGS;
#endif
#if defined(__amd64__)
- __uint16_t *cw = &uc->uc_mcontext.fpregs->cwd;
+ u_int16_t *cw = &uc->uc_mcontext.fpregs->cwd;
*cw |= FPU_EXCEPTION_MASK;
- __uint16_t *sw = &uc->uc_mcontext.fpregs->swd;
+ u_int16_t *sw = &uc->uc_mcontext.fpregs->swd;
*sw &= ~FPU_STATUS_FLAGS;
- __uint32_t *mxcsr = &uc->uc_mcontext.fpregs->mxcsr;
+ u_int32_t *mxcsr = &uc->uc_mcontext.fpregs->mxcsr;
*mxcsr |= SSE_EXCEPTION_MASK; /* disable all SSE exceptions */
*mxcsr &= ~SSE_STATUS_FLAGS; /* clear all pending SSE exceptions */
#endif
@@ -187,24 +188,24 @@
ucontext_t *uc = (ucontext_t *)context;
#if defined(__i386)
- uint32_t *cw = &uc->uc_mcontext.fpregs.fp_reg_set.fpchip_state.state[0];
+ u_int32_t *cw = &uc->uc_mcontext.fpregs.fp_reg_set.fpchip_state.state[0];
*cw |= FPU_EXCEPTION_MASK;
- uint32_t *sw = &uc->uc_mcontext.fpregs.fp_reg_set.fpchip_state.state[1];
+ u_int32_t *sw = &uc->uc_mcontext.fpregs.fp_reg_set.fpchip_state.state[1];
*sw &= ~FPU_STATUS_FLAGS;
/* address of the instruction that caused the exception */
- uint32_t *ip = &uc->uc_mcontext.fpregs.fp_reg_set.fpchip_state.state[3];
+ u_int32_t *ip = &uc->uc_mcontext.fpregs.fp_reg_set.fpchip_state.state[3];
uc->uc_mcontext.gregs[REG_PC] = *ip;
#endif
#if defined(__amd64__)
- uint16_t *cw = &uc->uc_mcontext.fpregs.fp_reg_set.fpchip_state.cw;
+ u_int16_t *cw = &uc->uc_mcontext.fpregs.fp_reg_set.fpchip_state.cw;
*cw |= FPU_EXCEPTION_MASK;
- uint16_t *sw = &uc->uc_mcontext.fpregs.fp_reg_set.fpchip_state.sw;
+ u_int16_t *sw = &uc->uc_mcontext.fpregs.fp_reg_set.fpchip_state.sw;
*sw &= ~FPU_STATUS_FLAGS;
- uint32_t *mxcsr = &uc->uc_mcontext.fpregs.fp_reg_set.fpchip_state.mxcsr;
+ u_int32_t *mxcsr = &uc->uc_mcontext.fpregs.fp_reg_set.fpchip_state.mxcsr;
*mxcsr |= SSE_EXCEPTION_MASK; /* disable all SSE exceptions */
*mxcsr &= ~SSE_STATUS_FLAGS; /* clear all pending SSE exceptions */
#endif
diff -r 06549f98901b tools/profiler/platform-linux.cc
--- a/tools/profiler/platform-linux.cc Fri Aug 02 14:36:52 2013 +0000
+++ b/tools/profiler/platform-linux.cc Fri Aug 02 14:42:20 2013 +0000
@@ -66,7 +66,7 @@
#define SIGNAL_SAVE_PROFILE SIGUSR2
-#if defined(__GLIBC__)
+#if 1
// glibc doesn't implement gettid(2).
#include <sys/syscall.h>
pid_t gettid()
diff -r 06549f98901b tools/profiler/shared-libraries-linux.cc
--- a/tools/profiler/shared-libraries-linux.cc Fri Aug 02 14:36:52 2013 +0000
+++ b/tools/profiler/shared-libraries-linux.cc Fri Aug 02 14:42:20 2013 +0000
@@ -35,7 +35,9 @@
#ifdef ANDROID
#include "ElfLoader.h" // dl_phdr_info
#else
+extern "C" { // [Gregor] musl bug
#include <link.h> // dl_phdr_info
+}
#endif
#include <features.h>
#include <dlfcn.h>
--- a/toolkit/library/Makefile.in
+++ b/toolkit/library/Makefile.in
@@ -199,7 +199,7 @@
endif
-ifdef MOZ_ALSA
+ifdef MOZ_ALSA_LIBS
EXTRA_DSO_LDOPTS += $(MOZ_ALSA_LIBS)
endif