build/autoconf/frameptr.m4

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 dnl This Source Code Form is subject to the terms of the Mozilla Public
     2 dnl License, v. 2.0. If a copy of the MPL was not distributed with this
     3 dnl file, You can obtain one at http://mozilla.org/MPL/2.0/.
     5 dnl Set MOZ_FRAMEPTR_FLAGS to the flags that should be used for enabling or
     6 dnl disabling frame pointers in this architecture based on the configure
     7 dnl options
     9 AC_DEFUN([MOZ_SET_FRAMEPTR_FLAGS], [
    10   case "$target" in
    11   *android*)
    12     unwind_tables="-funwind-tables"
    13     ;;
    14   esac
    15   if test "$GNU_CC"; then
    16     MOZ_ENABLE_FRAME_PTR="-fno-omit-frame-pointer $unwind_tables"
    17     MOZ_DISABLE_FRAME_PTR="-fomit-frame-pointer"
    18     if test "$CPU_ARCH" = arm; then
    19       # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54398
    20       MOZ_ENABLE_FRAME_PTR="$unwind_tables"
    21     fi
    22   else
    23     case "$target" in
    24     *-mingw*)
    25       MOZ_ENABLE_FRAME_PTR="-Oy-"
    26       MOZ_DISABLE_FRAME_PTR="-Oy"
    27     ;;
    28     esac
    29   fi
    31   # if we are debugging, profiling or using ASAN, we want a frame pointer.
    32   if test -z "$MOZ_OPTIMIZE" -o \
    33           -n "$MOZ_PROFILING" -o \
    34           -n "$MOZ_DEBUG" -o \
    35           -n "$MOZ_ASAN"; then
    36     MOZ_FRAMEPTR_FLAGS="$MOZ_ENABLE_FRAME_PTR"
    37   else
    38     MOZ_FRAMEPTR_FLAGS="$MOZ_DISABLE_FRAME_PTR"
    39   fi
    40 ])

mercurial