Bug 751355 - Linux and Fennec profiling builds should be built with disable elfhack and not strip symbols. r=ted
authorBenoit Girard <b56girard@gmail.com>
Fri, 04 May 2012 15:35:02 -0400
changeset 94596 4ec6652da8b9e0384ce080effd7d42cc6a7aa6e5
parent 94595 aa59a28665b0d2ea22c9df30e1b45c9732bcfd00
child 94597 c41d847fb36ecefb712bd7f6278cb503429fcc9b
push idunknown
push userunknown
push dateunknown
reviewersted
bugs751355
milestone15.0a1
Bug 751355 - Linux and Fennec profiling builds should be built with disable elfhack and not strip symbols. r=ted
configure.in
--- a/configure.in
+++ b/configure.in
@@ -1921,16 +1921,21 @@ AC_SUBST(MOZ_OS2_HIGH_MEMORY)
 dnl ========================================================
 dnl = Use profiling compile flags
 dnl ========================================================
 MOZ_ARG_ENABLE_BOOL(profiling,
 [  --enable-profiling      Set compile flags necessary for using sampling profilers (e.g. shark, perf)],
     MOZ_PROFILING=1,
     MOZ_PROFILING= )
 
+# For profiling builds keep the symbol information
+if test "$MOZ_PROFILING" -a -z "$STRIP_FLAGS"; then
+    STRIP_FLAGS="--strip-debug"
+fi
+
 dnl ========================================================
 dnl = Use Valgrind
 dnl ========================================================
 MOZ_ARG_ENABLE_BOOL(valgrind,
 [  --enable-valgrind       Enable Valgrind integration hooks (default=no)],
     MOZ_VALGRIND=1,
     MOZ_VALGRIND= )
 if test -n "$MOZ_VALGRIND"; then
@@ -7433,16 +7438,23 @@ dnl = --disable-elf-hack
 dnl ========================================================
 
 USE_ELF_HACK=1
 MOZ_ARG_DISABLE_BOOL(elf-hack,
 [  --disable-elf-hack      Disable elf hacks],
     USE_ELF_HACK=,
     USE_ELF_HACK=1)
 
+# Disable elf hack for profiling because the built in profiler
+# doesn't read the segments properly with elf hack. This is
+# temporary and should be fixed soon in the profiler.
+if test "$MOZ_PROFILING" = 1; then
+  USE_ELF_HACK=
+fi
+
 # Only enable elfhack where supported
 if test "$USE_ELF_HACK" = 1; then
     case "${HOST_OS_ARCH},${OS_ARCH}" in
     Linux,Linux)
         case "${CPU_ARCH}" in
         arm | x86 | x86_64)
             USE_ELF_HACK=1
             ;;