mozilla-aarch64-bmo-963023.patch
author Wolfgang Rosenauer <wr@rosenauer.org>
Mon, 14 Apr 2014 09:09:11 +0200
changeset 716 cef565f1c325
parent 715 e1c226a4de34
permissions -rw-r--r--
update to Firefox 29.0b7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
715
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
     1
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
     2
# HG changeset patch
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
     3
# User Marcin Juszkiewicz <mjuszkiewicz@redhat.com>
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
     4
# Date 1392217668 18000
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
     5
# Node ID 4e9b713f435ade266a68a8d7ba08aad65c3fa6c5
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
     6
# Parent  282b6e88f9d4c2367a72836f6f9efeab2aadaa58
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
     7
Bug 963023 - AArch64 support for libevent. r=froydnj
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
     8
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
     9
diff --git a/ipc/chromium/src/third_party/libevent-use-non-deprecated-syscalls.patch b/ipc/chromium/src/third_party/libevent-use-non-deprecated-syscalls.patch
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    10
new file mode 100644
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    11
--- /dev/null
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    12
+++ b/ipc/chromium/src/third_party/libevent-use-non-deprecated-syscalls.patch
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    13
@@ -0,0 +1,43 @@
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    14
+---
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    15
+ ipc/chromium/src/third_party/libevent/epoll_sub.c |   13 +++++++++++++
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    16
+ 1 file changed, 13 insertions(+)
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    17
+
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    18
+--- mozilla-central.orig/ipc/chromium/src/third_party/libevent/epoll_sub.c
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    19
++++ mozilla-central/ipc/chromium/src/third_party/libevent/epoll_sub.c
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    20
+@@ -29,15 +29,24 @@
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    21
+ #include <sys/param.h>
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    22
+ #include <sys/types.h>
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    23
+ #include <sys/syscall.h>
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    24
+ #include <sys/epoll.h>
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    25
+ #include <unistd.h>
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    26
++#include <errno.h>
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    27
+
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    28
+ int
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    29
+ epoll_create(int size)
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    30
+ {
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    31
++#if !defined(__NR_epoll_create) && defined(__NR_epoll_create1)
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    32
++	if (size <= 0) {
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    33
++		errno = EINVAL;
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    34
++		return -1;
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    35
++	}
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    36
++	return (syscall(__NR_epoll_create1, 0));
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    37
++#else
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    38
+ 	return (syscall(__NR_epoll_create, size));
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    39
++#endif
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    40
+ }
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    41
+
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    42
+ int
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    43
+ epoll_ctl(int epfd, int op, int fd, struct epoll_event *event)
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    44
+ {
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    45
+@@ -46,7 +55,11 @@ epoll_ctl(int epfd, int op, int fd, stru
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    46
+ }
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    47
+
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    48
+ int
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    49
+ epoll_wait(int epfd, struct epoll_event *events, int maxevents, int timeout)
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    50
+ {
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    51
++#if !defined(__NR_epoll_wait) && defined(__NR_epoll_pwait)
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    52
++	return (syscall(__NR_epoll_pwait, epfd, events, maxevents, timeout, NULL, 0));
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    53
++#else
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    54
+ 	return (syscall(__NR_epoll_wait, epfd, events, maxevents, timeout));
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    55
++#endif
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    56
+ }
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    57
diff --git a/ipc/chromium/src/third_party/libevent/README.mozilla b/ipc/chromium/src/third_party/libevent/README.mozilla
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    58
--- a/ipc/chromium/src/third_party/libevent/README.mozilla
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    59
+++ b/ipc/chromium/src/third_party/libevent/README.mozilla
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    60
@@ -8,8 +8,10 @@ android/event2/event-config.h
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    61
 
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    62
 These files are taken from libevent-2.0.21-stable built on the development environment indicated by the first path component. You have to run "./configure" and "make" to get all of the pre-processing done. The file can then be found in "include/event2/".
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    63
 
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    64
 2. This is ugly, prepare yourself. OS X has a weird problem with how the "TAILQ_END(head)" is used, causing a linking error. Just replace all use of the "TAILQ_END(head)" macro with "NULL".
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    65
 
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    66
 3. Apply "add mac-arc4random-buf.patch", which removes some bad OS X compatibility code. This will allow libevent to compile on all supported versions of OS X.
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    67
 
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    68
 4. Apply "openbsd-no-arc4random_addrandom.patch", which fixes the build on OpenBSD (which doesnt provide arc4random_addrandom anymore, see #931354)
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    69
+
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    70
+5. Apply "libevent-use-non-deprecated-syscalls.patch", which fixes the build on AArch64 architecture (which does not provide deprecated syscalls)
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    71
diff --git a/ipc/chromium/src/third_party/libevent/epoll_sub.c b/ipc/chromium/src/third_party/libevent/epoll_sub.c
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    72
--- a/ipc/chromium/src/third_party/libevent/epoll_sub.c
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    73
+++ b/ipc/chromium/src/third_party/libevent/epoll_sub.c
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    74
@@ -26,27 +26,40 @@
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    75
  */
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    76
 #include <stdint.h>
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    77
 
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    78
 #include <sys/param.h>
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    79
 #include <sys/types.h>
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    80
 #include <sys/syscall.h>
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    81
 #include <sys/epoll.h>
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    82
 #include <unistd.h>
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    83
+#include <errno.h>
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    84
 
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    85
 int
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    86
 epoll_create(int size)
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    87
 {
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    88
+#if !defined(__NR_epoll_create) && defined(__NR_epoll_create1)
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    89
+	if (size <= 0) {
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    90
+		errno = EINVAL;
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    91
+		return -1;
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    92
+	}
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    93
+	return (syscall(__NR_epoll_create1, 0));
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    94
+#else
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    95
 	return (syscall(__NR_epoll_create, size));
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    96
+#endif
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    97
 }
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    98
 
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
    99
 int
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
   100
 epoll_ctl(int epfd, int op, int fd, struct epoll_event *event)
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
   101
 {
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
   102
 
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
   103
 	return (syscall(__NR_epoll_ctl, epfd, op, fd, event));
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
   104
 }
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
   105
 
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
   106
 int
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
   107
 epoll_wait(int epfd, struct epoll_event *events, int maxevents, int timeout)
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
   108
 {
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
   109
+#if !defined(__NR_epoll_wait) && defined(__NR_epoll_pwait)
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
   110
+	return (syscall(__NR_epoll_pwait, epfd, events, maxevents, timeout, NULL, 0));
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
   111
+#else
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
   112
 	return (syscall(__NR_epoll_wait, epfd, events, maxevents, timeout));
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
   113
+#endif
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
   114
 }
e1c226a4de34 AArch64 porting
Dirk M?ller <dmueller@suse.com>
parents:
diff changeset
   115