summaryrefslogtreecommitdiffstats
path: root/build/autoconf/frameptr.m4
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /build/autoconf/frameptr.m4
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'build/autoconf/frameptr.m4')
-rw-r--r--build/autoconf/frameptr.m444
1 files changed, 44 insertions, 0 deletions
diff --git a/build/autoconf/frameptr.m4 b/build/autoconf/frameptr.m4
new file mode 100644
index 000000000..e7e50330e
--- /dev/null
+++ b/build/autoconf/frameptr.m4
@@ -0,0 +1,44 @@
+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/.
+
+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], [
+ case "$target" in
+ *android*)
+ unwind_tables="-funwind-tables"
+ ;;
+ esac
+ if test "$GNU_CC"; then
+ MOZ_ENABLE_FRAME_PTR="-fno-omit-frame-pointer $unwind_tables"
+ MOZ_DISABLE_FRAME_PTR="-fomit-frame-pointer"
+ if test "$CPU_ARCH" = arm; then
+ # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54398
+ MOZ_ENABLE_FRAME_PTR="$unwind_tables"
+ fi
+ else
+ case "$target" in
+ dnl Oy (Frame-Pointer Omission) is only support on x86 compilers
+ *-mingw32*)
+ MOZ_ENABLE_FRAME_PTR="-Oy-"
+ MOZ_DISABLE_FRAME_PTR="-Oy"
+ ;;
+ esac
+ fi
+
+ # If we are debugging, profiling, using sanitizers, or on win32 we want a
+ # frame pointer.
+ if test -z "$MOZ_OPTIMIZE" -o \
+ -n "$MOZ_PROFILING" -o \
+ -n "$MOZ_DEBUG" -o \
+ -n "$MOZ_MSAN" -o \
+ -n "$MOZ_ASAN" -o \
+ "$OS_ARCH:$CPU_ARCH" = "WINNT:x86"; then
+ MOZ_FRAMEPTR_FLAGS="$MOZ_ENABLE_FRAME_PTR"
+ else
+ MOZ_FRAMEPTR_FLAGS="$MOZ_DISABLE_FRAME_PTR"
+ fi
+])