michael@0: dnl This Source Code Form is subject to the terms of the Mozilla Public michael@0: dnl License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: dnl file, You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: michael@0: dnl Set MOZ_FRAMEPTR_FLAGS to the flags that should be used for enabling or michael@0: dnl disabling frame pointers in this architecture based on the configure michael@0: dnl options michael@0: michael@0: AC_DEFUN([MOZ_SET_FRAMEPTR_FLAGS], [ michael@0: case "$target" in michael@0: *android*) michael@0: unwind_tables="-funwind-tables" michael@0: ;; michael@0: esac michael@0: if test "$GNU_CC"; then michael@0: MOZ_ENABLE_FRAME_PTR="-fno-omit-frame-pointer $unwind_tables" michael@0: MOZ_DISABLE_FRAME_PTR="-fomit-frame-pointer" michael@0: if test "$CPU_ARCH" = arm; then michael@0: # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54398 michael@0: MOZ_ENABLE_FRAME_PTR="$unwind_tables" michael@0: fi michael@0: else michael@0: case "$target" in michael@0: *-mingw*) michael@0: MOZ_ENABLE_FRAME_PTR="-Oy-" michael@0: MOZ_DISABLE_FRAME_PTR="-Oy" michael@0: ;; michael@0: esac michael@0: fi michael@0: michael@0: # if we are debugging, profiling or using ASAN, we want a frame pointer. michael@0: if test -z "$MOZ_OPTIMIZE" -o \ michael@0: -n "$MOZ_PROFILING" -o \ michael@0: -n "$MOZ_DEBUG" -o \ michael@0: -n "$MOZ_ASAN"; then michael@0: MOZ_FRAMEPTR_FLAGS="$MOZ_ENABLE_FRAME_PTR" michael@0: else michael@0: MOZ_FRAMEPTR_FLAGS="$MOZ_DISABLE_FRAME_PTR" michael@0: fi michael@0: ])