mozilla-bmo1463035.patch
author Guillaume GARDET <guillaume.gardet@opensuse.org>
Mon, 29 Oct 2018 15:14:41 +0100
branchfirefox63
changeset 1076 2823eb50c9a9
permissions -rw-r--r--
ARM updates
1076
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
     1
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
     2
# HG changeset patch
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
     3
# User Mike Hommey <mh+mozilla@glandium.org>
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
     4
# Date 1526871862 -32400
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
     5
# Node ID 94f21505ff13cd089f7129cd24927cf8b31a0f43
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
     6
# Parent  1800b8895c08bc0c60302775dc0a4b5ea4deb310
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
     7
Bug 1463035 - Remove MOZ_SIGNAL_TRAMPOLINE. r?darchons
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
     8
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
     9
For some reason, GNU as is not happy with the assembly generated after
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    10
bug 1238661 anymore on Debian armel.
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    11
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    12
OTOH, as mentioned in bug 1238661 comment 4, we actually don't need this
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    13
workaround anymore, so let's just kill it.
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    14
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    15
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    16
diff --git a/mfbt/LinuxSignal.h b/mfbt/LinuxSignal.h
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    17
deleted file mode 100644
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    18
--- a/mfbt/LinuxSignal.h
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    19
+++ /dev/null
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    20
@@ -1,45 +0,0 @@
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    21
-/* This Source Code Form is subject to the terms of the Mozilla Public
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    22
- * License, v. 2.0. If a copy of the MPL was not distributed with this
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    23
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    24
-
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    25
-#ifndef mozilla_LinuxSignal_h
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    26
-#define mozilla_LinuxSignal_h
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    27
-
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    28
-namespace mozilla {
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    29
-
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    30
-#if defined(__arm__)
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    31
-
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    32
-// Some (old) Linux kernels on ARM have a bug where a signal handler
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    33
-// can be called without clearing the IT bits in CPSR first. The result
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    34
-// is that the first few instructions of the handler could be skipped,
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    35
-// ultimately resulting in crashes. To workaround this bug, the handler
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    36
-// on ARM is a trampoline that starts with enough NOP instructions, so
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    37
-// that even if the IT bits are not cleared, only the NOP instructions
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    38
-// will be skipped over.
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    39
-
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    40
-template <void (*H)(int, siginfo_t*, void*)>
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    41
-__attribute__((naked)) void
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    42
-SignalTrampoline(int aSignal, siginfo_t* aInfo, void* aContext)
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    43
-{
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    44
-  asm volatile (
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    45
-    "nop; nop; nop; nop"
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    46
-    : : : "memory");
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    47
-
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    48
-  asm volatile (
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    49
-    "b %0"
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    50
-    :
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    51
-    : "X"(H)
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    52
-    : "memory");
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    53
-}
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    54
-
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    55
-# define MOZ_SIGNAL_TRAMPOLINE(h) (mozilla::SignalTrampoline<h>)
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    56
-
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    57
-#else // __arm__
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    58
-
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    59
-# define MOZ_SIGNAL_TRAMPOLINE(h) (h)
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    60
-
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    61
-#endif // __arm__
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    62
-
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    63
-} // namespace mozilla
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    64
-
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    65
-#endif // mozilla_LinuxSignal_h
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    66
diff --git a/mfbt/moz.build b/mfbt/moz.build
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    67
--- a/mfbt/moz.build
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    68
+++ b/mfbt/moz.build
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    69
@@ -117,20 +117,16 @@ EXPORTS["double-conversion"] = [
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    70
 LOCAL_INCLUDES += [
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    71
     '/mfbt/double-conversion',
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    72
 ]
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    73
 
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    74
 if CONFIG['OS_ARCH'] == 'WINNT':
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    75
     EXPORTS.mozilla += [
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    76
         'WindowsVersion.h',
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    77
     ]
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    78
-elif CONFIG['OS_ARCH'] == 'Linux':
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    79
-    EXPORTS.mozilla += [
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    80
-        'LinuxSignal.h',
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    81
-    ]
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    82
 
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    83
 UNIFIED_SOURCES += [
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    84
     'Assertions.cpp',
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    85
     'ChaosMode.cpp',
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    86
     'double-conversion/double-conversion/bignum-dtoa.cc',
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    87
     'double-conversion/double-conversion/bignum.cc',
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    88
     'double-conversion/double-conversion/cached-powers.cc',
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    89
     'double-conversion/double-conversion/diy-fp.cc',
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    90
diff --git a/tools/profiler/core/platform-linux-android.cpp b/tools/profiler/core/platform-linux-android.cpp
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    91
--- a/tools/profiler/core/platform-linux-android.cpp
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    92
+++ b/tools/profiler/core/platform-linux-android.cpp
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    93
@@ -55,17 +55,16 @@
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    94
 #ifdef __GLIBC__
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    95
 #include <execinfo.h>   // backtrace, backtrace_symbols
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    96
 #endif  // def __GLIBC__
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    97
 #include <strings.h>    // index
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    98
 #include <errno.h>
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
    99
 #include <stdarg.h>
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
   100
 
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
   101
 #include "prenv.h"
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
   102
-#include "mozilla/LinuxSignal.h"
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
   103
 #include "mozilla/PodOperations.h"
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
   104
 #include "mozilla/DebugOnly.h"
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
   105
 
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
   106
 #include <string.h>
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
   107
 #include <list>
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
   108
 
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
   109
 using namespace mozilla;
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
   110
 
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
   111
@@ -272,17 +271,17 @@ Sampler::Sampler(PSLockRef aLock)
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
   112
 
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
   113
   // NOTE: We don't initialize LUL here, instead initializing it in
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
   114
   // SamplerThread's constructor. This is because with the
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
   115
   // profiler_suspend_and_sample_thread entry point, we want to be able to
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
   116
   // sample without waiting for LUL to be initialized.
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
   117
 
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
   118
   // Request profiling signals.
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
   119
   struct sigaction sa;
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
   120
-  sa.sa_sigaction = MOZ_SIGNAL_TRAMPOLINE(SigprofHandler);
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
   121
+  sa.sa_sigaction = SigprofHandler;
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
   122
   sigemptyset(&sa.sa_mask);
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
   123
   sa.sa_flags = SA_RESTART | SA_SIGINFO;
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
   124
   if (sigaction(SIGPROF, &sa, &mOldSigprofHandler) != 0) {
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
   125
     MOZ_CRASH("Error installing SIGPROF handler in the profiler");
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
   126
   }
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
   127
 }
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
   128
 
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
   129
 void
2823eb50c9a9 ARM updates
Guillaume GARDET <guillaume.gardet@opensuse.org>
parents:
diff changeset
   130