2012-05-21 15:12:37 +04:00
|
|
|
dnl This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
dnl License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
dnl file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
|
2011-09-03 21:36:18 +04:00
|
|
|
dnl Set MOZ_FRAMEPTR_FLAGS to the flags that should be used for enabling or
|
|
|
|
dnl disabling frame pointers in this architecture based on the configure
|
|
|
|
dnl options
|
|
|
|
|
|
|
|
AC_DEFUN([MOZ_SET_FRAMEPTR_FLAGS], [
|
2012-03-02 01:24:04 +04:00
|
|
|
case "$target" in
|
|
|
|
*android*)
|
|
|
|
unwind_tables="-funwind-tables"
|
|
|
|
;;
|
|
|
|
esac
|
2011-09-03 21:36:18 +04:00
|
|
|
if test "$GNU_CC"; then
|
2012-03-02 01:24:04 +04:00
|
|
|
MOZ_ENABLE_FRAME_PTR="-fno-omit-frame-pointer $unwind_tables"
|
2011-09-03 21:36:18 +04:00
|
|
|
MOZ_DISABLE_FRAME_PTR="-fomit-frame-pointer"
|
2013-05-30 16:10:02 +04:00
|
|
|
if test "$CPU_ARCH" = arm; then
|
|
|
|
# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54398
|
|
|
|
MOZ_ENABLE_FRAME_PTR="$unwind_tables"
|
|
|
|
fi
|
2011-09-03 21:36:18 +04:00
|
|
|
else
|
|
|
|
case "$target" in
|
2016-01-14 02:35:23 +03:00
|
|
|
dnl Oy (Frame-Pointer Omission) is only support on x86 compilers
|
|
|
|
*-mingw32*)
|
2011-09-03 21:36:18 +04:00
|
|
|
MOZ_ENABLE_FRAME_PTR="-Oy-"
|
|
|
|
MOZ_DISABLE_FRAME_PTR="-Oy"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
2014-09-12 01:21:46 +04:00
|
|
|
# if we are debugging, profiling or using sanitizers, we want a frame pointer.
|
2011-09-03 21:36:18 +04:00
|
|
|
if test -z "$MOZ_OPTIMIZE" -o \
|
2014-03-19 01:25:40 +04:00
|
|
|
-n "$MOZ_PROFILING" -o \
|
|
|
|
-n "$MOZ_DEBUG" -o \
|
2014-09-12 01:21:46 +04:00
|
|
|
-n "$MOZ_MSAN" -o \
|
2014-03-19 01:25:40 +04:00
|
|
|
-n "$MOZ_ASAN"; then
|
2011-09-03 21:36:18 +04:00
|
|
|
MOZ_FRAMEPTR_FLAGS="$MOZ_ENABLE_FRAME_PTR"
|
|
|
|
else
|
|
|
|
MOZ_FRAMEPTR_FLAGS="$MOZ_DISABLE_FRAME_PTR"
|
|
|
|
fi
|
|
|
|
])
|