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