Package: thunderbird / 1:60.8.0-1~deb9u1

porting-armel/Bug-1463035-Remove-MOZ_SIGNAL_TRAMPOLINE.-r-darchons.patch Patch series | 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
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
From: Mike Hommey <mh+mozilla@glandium.org>
Date: Mon, 21 May 2018 12:04:22 +0900
Subject: Bug 1463035 - Remove MOZ_SIGNAL_TRAMPOLINE. r?darchons

For some reason, GNU as is not happy with the assembly generated after
bug 1238661 anymore on Debian armel.

OTOH, as mentioned in bug 1238661 comment 4, we actually don't need this
workaround anymore, so let's just kill it.
---
 mfbt/LinuxSignal.h                             | 38 --------------------------
 mfbt/moz.build                                 |  4 ---
 tools/profiler/core/platform-linux-android.cpp |  3 +-
 3 files changed, 1 insertion(+), 44 deletions(-)
 delete mode 100644 mfbt/LinuxSignal.h

diff --git a/mfbt/LinuxSignal.h b/mfbt/LinuxSignal.h
deleted file mode 100644
index 112b6a1..0000000
--- a/mfbt/LinuxSignal.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_LinuxSignal_h
-#define mozilla_LinuxSignal_h
-
-namespace mozilla {
-
-#if defined(__arm__)
-
-// Some (old) Linux kernels on ARM have a bug where a signal handler
-// can be called without clearing the IT bits in CPSR first. The result
-// is that the first few instructions of the handler could be skipped,
-// ultimately resulting in crashes. To workaround this bug, the handler
-// on ARM is a trampoline that starts with enough NOP instructions, so
-// that even if the IT bits are not cleared, only the NOP instructions
-// will be skipped over.
-
-template <void (*H)(int, siginfo_t*, void*)>
-__attribute__((naked)) void SignalTrampoline(int aSignal, siginfo_t* aInfo,
-                                             void* aContext) {
-  asm volatile("nop; nop; nop; nop" : : : "memory");
-
-  asm volatile("b %0" : : "X"(H) : "memory");
-}
-
-#define MOZ_SIGNAL_TRAMPOLINE(h) (mozilla::SignalTrampoline<h>)
-
-#else  // __arm__
-
-#define MOZ_SIGNAL_TRAMPOLINE(h) (h)
-
-#endif  // __arm__
-
-}  // namespace mozilla
-
-#endif  // mozilla_LinuxSignal_h
diff --git a/mfbt/moz.build b/mfbt/moz.build
index 87c7d3f..587dbc5 100644
--- a/mfbt/moz.build
+++ b/mfbt/moz.build
@@ -120,10 +120,6 @@ if CONFIG['OS_ARCH'] == 'WINNT':
     EXPORTS.mozilla += [
         'WindowsVersion.h',
     ]
-elif CONFIG['OS_ARCH'] == 'Linux':
-    EXPORTS.mozilla += [
-        'LinuxSignal.h',
-    ]
 
 UNIFIED_SOURCES += [
     'Assertions.cpp',
diff --git a/tools/profiler/core/platform-linux-android.cpp b/tools/profiler/core/platform-linux-android.cpp
index 09eb943..79f0067 100644
--- a/tools/profiler/core/platform-linux-android.cpp
+++ b/tools/profiler/core/platform-linux-android.cpp
@@ -60,7 +60,6 @@
 #include <stdarg.h>
 
 #include "prenv.h"
-#include "mozilla/LinuxSignal.h"
 #include "mozilla/PodOperations.h"
 #include "mozilla/DebugOnly.h"
 
@@ -253,7 +252,7 @@ Sampler::Sampler(PSLockRef aLock)
 
   // Request profiling signals.
   struct sigaction sa;
-  sa.sa_sigaction = MOZ_SIGNAL_TRAMPOLINE(SigprofHandler);
+  sa.sa_sigaction = SigprofHandler;
   sigemptyset(&sa.sa_mask);
   sa.sa_flags = SA_RESTART | SA_SIGINFO;
   if (sigaction(SIGPROF, &sa, &mOldSigprofHandler) != 0) {