Bug 1463035 - Remove MOZ_SIGNAL_TRAMPOLINE. r?darchons
authorMike Hommey <mh+mozilla@glandium.org>
Mon, 21 May 2018 03:04:22 +0000 (12:04 +0900)
committerCarsten Schoenert <c.schoenert@t-online.de>
Tue, 20 Apr 2021 17:33:42 +0000 (18:33 +0100)
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.

Gbp-Pq: Topic porting-armel
Gbp-Pq: Name Bug-1463035-Remove-MOZ_SIGNAL_TRAMPOLINE.-r-darchons.patch

mfbt/LinuxSignal.h [deleted file]
mfbt/moz.build
mozglue/baseprofiler/core/platform-linux-android.cpp
tools/profiler/core/platform-linux-android.cpp

diff --git a/mfbt/LinuxSignal.h b/mfbt/LinuxSignal.h
deleted file mode 100644 (file)
index cdebb77..0000000
+++ /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__) && defined(__ANDROID__)
-
-// 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
index bd0885a36d1460b2a9fac2a29e16a2f1bf296f34..78a526850ddc22a93f5c33da3446a2e1e9be3ca8 100644 (file)
@@ -137,10 +137,6 @@ if CONFIG['OS_ARCH'] == 'WINNT':
     EXPORTS.mozilla += [
         'WindowsVersion.h',
     ]
-elif CONFIG['OS_ARCH'] == 'Linux' or CONFIG['OS_ARCH'] == 'FreeBSD':
-    EXPORTS.mozilla += [
-        'LinuxSignal.h',
-    ]
 
 if CONFIG['MOZ_TSAN']:
     EXPORTS.mozilla += [
index 8e69569be1015c0de1ccd937a01afe32d98a2285..1dfd64b2483acd2386ce7e2d1a4c427ae49bfccd 100644 (file)
@@ -63,7 +63,6 @@
 #include <stdarg.h>
 
 #include "prenv.h"
-#include "mozilla/LinuxSignal.h"
 #include "mozilla/PodOperations.h"
 #include "mozilla/DebugOnly.h"
 
@@ -294,7 +293,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) {
index 296d3ed01b3af4f0e01d18c2bedd0633fae92eb8..ea401b799a95d80845c618200853c38b74ef976a 100644 (file)
@@ -63,7 +63,6 @@
 #include <stdarg.h>
 
 #include "prenv.h"
-#include "mozilla/LinuxSignal.h"
 #include "mozilla/PodOperations.h"
 #include "mozilla/DebugOnly.h"
 #if defined(GP_OS_linux) || defined(GP_OS_android)
@@ -288,7 +287,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) {