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
9 AC_DEFUN([MOZ_SET_FRAMEPTR_FLAGS], [
12 unwind_tables="-funwind-tables"
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"
25 MOZ_ENABLE_FRAME_PTR="-Oy-"
26 MOZ_DISABLE_FRAME_PTR="-Oy"
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 \
36 MOZ_FRAMEPTR_FLAGS="$MOZ_ENABLE_FRAME_PTR"
38 MOZ_FRAMEPTR_FLAGS="$MOZ_DISABLE_FRAME_PTR"