[xulrunner] Used backported upstream patch from mozb#734335 for fixing the sps profiler build

Dan Horák sharkcz at fedoraproject.org
Mon May 7 11:26:47 UTC 2012


commit bb57e42f22d1e459900ce8502703be674848d3ef
Author: Dan Horák <dan at danny.cz>
Date:   Mon May 7 13:26:43 2012 +0200

    Used backported upstream patch from mozb#734335 for fixing the sps profiler build
    
    - Fixed build of jemalloc on ppc (patch by Gustavo Luiz Duarte/IBM)

 mozilla-734335.patch              |  212 +++++++++++++++++++++++++++++++++++++
 xulrunner-12.0-jemalloc-ppc.patch |   14 +++
 xulrunner-12.0-secondary.patch    |   43 --------
 xulrunner.spec                    |   13 ++-
 4 files changed, 236 insertions(+), 46 deletions(-)
---
diff --git a/mozilla-734335.patch b/mozilla-734335.patch
new file mode 100644
index 0000000..1b7670b
--- /dev/null
+++ b/mozilla-734335.patch
@@ -0,0 +1,212 @@
+diff -up xulrunner-12.0/mozilla-release/configure.in.734335 xulrunner-12.0/mozilla-release/configure.in
+--- xulrunner-12.0/mozilla-release/configure.in.734335	2012-04-20 18:03:44.000000000 -0400
++++ xulrunner-12.0/mozilla-release/configure.in	2012-05-07 04:40:57.526363561 -0400
+@@ -2124,10 +2124,33 @@ fi
+ dnl ========================================================
+ dnl SPS Profiler
+ dnl ========================================================
+-MOZ_ARG_ENABLE_BOOL(sps,
+-[  --enable-sps          Enable sps profiling tool.],
+-    MOZ_ENABLE_PROFILER_SPS=1,
+-    MOZ_ENABLE_PROFILER_SPS= )
++MOZ_ENABLE_PROFILER_SPS=1
++
++case "${OS_TARGET}" in
++Android)
++    case "${CPU_ARCH}" in
++    x86 | arm) ;;
++    *)
++        MOZ_ENABLE_PROFILER_SPS=
++    esac
++    ;;
++Linux)
++    case "${CPU_ARCH}" in
++    x86 | x86_64) ;;
++    *)
++        MOZ_ENABLE_PROFILER_SPS=
++    esac
++    ;;
++WINNT|Darwin) ;;
++*)
++    MOZ_ENABLE_PROFILER_SPS=
++    ;;
++esac
++
++MOZ_ARG_DISABLE_BOOL(sps,
++[  --disable-sps         Disable sps profiling tool.],
++    MOZ_ENABLE_PROFILER_SPS=,
++    MOZ_ENABLE_PROFILER_SPS=1)
+ if test -n "$MOZ_ENABLE_PROFILER_SPS"; then
+     AC_DEFINE(MOZ_ENABLE_PROFILER_SPS)
+ fi
+diff -up xulrunner-12.0/mozilla-release/configure.734335 xulrunner-12.0/mozilla-release/configure
+--- xulrunner-12.0/mozilla-release/configure.734335	2012-05-07 04:49:48.696360057 -0400
++++ xulrunner-12.0/mozilla-release/configure	2012-05-07 04:50:10.396360262 -0400
+@@ -119,7 +119,7 @@ ac_help="$ac_help
+ ac_help="$ac_help
+   --enable-jprof          Enable jprof profiling tool (needs mozilla/tools/jprof). Implies --enable-profiling."
+ ac_help="$ac_help
+-  --enable-sps          Enable sps profiling tool."
++  --disable-sps         Disable sps profiling tool."
+ ac_help="$ac_help
+   --enable-shark          Enable shark remote profiling. Implies --enable-profiling."
+ ac_help="$ac_help
+@@ -7255,13 +7255,36 @@ EOF
+ 
+ fi
+ 
++MOZ_ENABLE_PROFILER_SPS=1
++
++case "${OS_TARGET}" in
++Android)
++    case "${CPU_ARCH}" in
++    x86 | arm) ;;
++    *)
++        MOZ_ENABLE_PROFILER_SPS=
++    esac
++    ;;
++Linux)
++    case "${CPU_ARCH}" in
++    x86 | x86_64) ;;
++    *)
++        MOZ_ENABLE_PROFILER_SPS=
++    esac
++    ;;
++WINNT|Darwin) ;;
++*)
++    MOZ_ENABLE_PROFILER_SPS=
++    ;;
++esac
++
+ # Check whether --enable-sps or --disable-sps was given.
+ if test "${enable_sps+set}" = set; then
+   enableval="$enable_sps"
+-  if test "$enableval" = "yes"; then
++  if test "$enableval" = "no"; then
++    MOZ_ENABLE_PROFILER_SPS=
++  elif test "$enableval" = "yes"; then
+     MOZ_ENABLE_PROFILER_SPS=1
+-  elif test "$enableval" = "no"; then
+-    MOZ_ENABLE_PROFILER_SPS= 
+   else
+     { echo "configure: error: Option, sps, does not take an argument ($enableval)." 1>&2; exit 1; }
+   fi
+diff -up xulrunner-12.0/mozilla-release/toolkit/library/Makefile.in.734335 xulrunner-12.0/mozilla-release/toolkit/library/Makefile.in
+--- xulrunner-12.0/mozilla-release/toolkit/library/Makefile.in.734335	2012-04-20 18:04:09.000000000 -0400
++++ xulrunner-12.0/mozilla-release/toolkit/library/Makefile.in	2012-05-07 04:40:57.526363561 -0400
+@@ -315,7 +315,9 @@ endif
+ 
+ STATIC_LIBS += thebes gl ycbcr
+ 
++ifdef MOZ_ENABLE_PROFILER_SPS
+ COMPONENT_LIBS += profiler
++endif
+ 
+ ifeq (windows,$(MOZ_WIDGET_TOOLKIT))
+ COMPONENT_LIBS += widget_windows
+diff -up xulrunner-12.0/mozilla-release/toolkit/library/nsStaticXULComponents.cpp.734335 xulrunner-12.0/mozilla-release/toolkit/library/nsStaticXULComponents.cpp
+--- xulrunner-12.0/mozilla-release/toolkit/library/nsStaticXULComponents.cpp.734335	2012-04-20 18:04:09.000000000 -0400
++++ xulrunner-12.0/mozilla-release/toolkit/library/nsStaticXULComponents.cpp	2012-05-07 04:40:57.526363561 -0400
+@@ -198,6 +198,12 @@
+ #endif
+ #endif
+ 
++#if defined(MOZ_ENABLE_PROFILER_SPS)
++#define PROFILER_MODULE MODULE(nsProfilerModule)
++#else
++#define PROFILER_MODULE
++#endif
++
+ #define XUL_MODULES                          \
+     MODULE(nsUConvModule)                    \
+     MODULE(nsI18nModule)                     \
+@@ -214,7 +220,7 @@
+     MODULE(nsWindowDataSourceModule)         \
+     MODULE(nsParserModule)                   \
+     MODULE(nsGfxModule)                      \
+-    MODULE(nsProfilerModule)                 \
++    PROFILER_MODULE                          \
+     WIDGET_MODULES                           \
+     MODULE(nsImageLib2Module)                \
+     ICON_MODULE                              \
+diff -up xulrunner-12.0/mozilla-release/tools/profiler/Makefile.in.734335 xulrunner-12.0/mozilla-release/tools/profiler/Makefile.in
+--- xulrunner-12.0/mozilla-release/tools/profiler/Makefile.in.734335	2012-04-20 18:04:10.000000000 -0400
++++ xulrunner-12.0/mozilla-release/tools/profiler/Makefile.in	2012-05-07 04:40:57.526363561 -0400
+@@ -48,8 +48,10 @@ VPATH       = \
+ 
+ include $(DEPTH)/config/autoconf.mk
+ 
+-EXPORTS = \
+-  sampler.h \
++EXPORTS = sampler.h
++
++ifdef MOZ_ENABLE_PROFILER_SPS
++EXPORTS += \
+   sps_sampler.h \
+   thread_helper.h \
+   $(NULL)
+@@ -68,6 +70,7 @@ IS_COMPONENT    = 1
+ CPPSRCS		= \
+   nsProfilerFactory.cpp \
+   nsProfiler.cpp \
++  TableTicker.cpp \
+   $(NULL)
+ 
+ XPIDLSRCS = \
+@@ -79,42 +82,31 @@ EXTRA_JS_MODULES = \
+   $(NULL)
+ 
+ ifneq (,$(filter Android Linux,$(OS_TARGET)))
+-
+-DEFINES += -DMOZ_ENABLE_PROFILER_SPS
+-
+ CPPSRCS += \
+   shared-libraries-linux.cc \
+   platform-linux.cc \
+-  TableTicker.cpp \
+   $(NULL)
+ endif
++
+ ifeq ($(OS_TARGET),Darwin)
+ # For now we use platform-linux.cc because we can't unwind
+ # another thread on mac using backtrace(), the implementation
+ # for platform-macosx.cc is in the hg history and should be
+ # used when we can stackwalk using a thread handle.
+-
+-DEFINES += -DMOZ_ENABLE_PROFILER_SPS
+-
+ CPPSRCS += \
+   shared-libraries-macos.cc \
+   platform-linux.cc \
+-  TableTicker.cpp \
+   $(NULL)
+ endif
+ 
+ ifeq ($(OS_TARGET),WINNT)
+-
+-DEFINES += -DMOZ_ENABLE_PROFILER_SPS
+-
+ CPPSRCS += \
+   shared-libraries-win32.cc \
+   platform-win32.cc \
+-  TableTicker.cpp \
+   $(NULL)
+ endif
+ 
+-
++endif
+ 
+ include $(topsrcdir)/config/rules.mk
+ 
+diff -up xulrunner-12.0/mozilla-release/tools/profiler/sampler.h.734335 xulrunner-12.0/mozilla-release/tools/profiler/sampler.h
+--- xulrunner-12.0/mozilla-release/tools/profiler/sampler.h.734335	2012-04-20 18:04:10.000000000 -0400
++++ xulrunner-12.0/mozilla-release/tools/profiler/sampler.h	2012-05-07 04:40:57.526363561 -0400
+@@ -78,7 +78,7 @@
+ #define SAMPLER_H
+ 
+ // Redefine the macros for platforms where SPS is supported.
+-#if defined(ANDROID) || defined(__linux__) || defined(XP_MACOSX) || defined(XP_WIN)
++#ifdef MOZ_ENABLE_PROFILER_SPS
+ 
+ #include "sps_sampler.h"
+ 
diff --git a/xulrunner-12.0-jemalloc-ppc.patch b/xulrunner-12.0-jemalloc-ppc.patch
new file mode 100644
index 0000000..036f560
--- /dev/null
+++ b/xulrunner-12.0-jemalloc-ppc.patch
@@ -0,0 +1,14 @@
+Index: xulrunner-11.0/mozilla-release/memory/jemalloc/jemalloc.c
+===================================================================
+--- xulrunner-11.0.orig/mozilla-release/memory/jemalloc/jemalloc.c
++++ xulrunner-11.0/mozilla-release/memory/jemalloc/jemalloc.c
+@@ -1089,7 +1089,9 @@ static unsigned		ncpus;
+  * controlling the malloc behavior are defined as compile-time constants
+  * for best performance and cannot be altered at runtime.
+  */
++#if !(defined(__powerpc__))
+ #define MALLOC_STATIC_SIZES 1
++#endif
+ 
+ #ifdef MALLOC_STATIC_SIZES
+ 
diff --git a/xulrunner.spec b/xulrunner.spec
index d5c44da..51dd573 100644
--- a/xulrunner.spec
+++ b/xulrunner.spec
@@ -73,7 +73,7 @@
 Summary:        XUL Runtime for Gecko Applications
 Name:           xulrunner
 Version:        12.0
-Release:        4%{?pre_tag}%{?dist}
+Release:        5%{?pre_tag}%{?dist}
 URL:            http://developer.mozilla.org/En/XULRunner
 License:        MPLv1.1 or GPLv2+ or LGPLv2+
 Group:          Applications/Internet
@@ -91,7 +91,8 @@ Patch14:        xulrunner-2.0-chromium-types.patch
 Patch16:        add-gtkmozembed-11.0.patch
 %endif
 Patch17:        xulrunner-10.0-gcc47.patch
-Patch18:        xulrunner-12.0-secondary.patch
+# https://bugzilla.redhat.com/show_bug.cgi?id=814879#c3
+Patch18:        xulrunner-12.0-jemalloc-ppc.patch
 
 
 # Fedora specific patches
@@ -104,6 +105,7 @@ Patch39:        xulrunner-8.0-fix-maemo-checks-in-npapi.patch
 Patch43:        mozilla-file.patch
 Patch46:        mozilla-724615.patch
 Patch47:        mozilla-691898.patch
+Patch48:        mozilla-734335.patch
 
 # ---------------------------------------------------
 
@@ -235,7 +237,7 @@ sed -e 's/__RPM_VERSION_INTERNAL__/%{gecko_dir_ver}/' %{P:%%PATCH0} \
 %patch16 -p2 -b .gtkmozembed
 %endif
 %patch17 -p1 -b .gcc47
-%patch18 -p2 -b .secondary
+%patch18 -p2 -b .jemalloc-ppc
 
 %patch20 -p2 -b .pk
 %patch24 -p1 -b .static
@@ -244,6 +246,7 @@ sed -e 's/__RPM_VERSION_INTERNAL__/%{gecko_dir_ver}/' %{P:%%PATCH0} \
 %patch43 -p1 -b .file
 %patch46 -p1 -b .724615
 %patch47 -p2 -b .691898
+%patch48 -p2 -b .734335
 
 %{__rm} -f .mozconfig
 %{__cp} %{SOURCE10} .mozconfig
@@ -501,6 +504,10 @@ fi
 #---------------------------------------------------------------------
 
 %changelog
+* Mon May 7 2012 Dan Horák <dan[at]danny.cz> - 12.0-5
+- Used backported upstream patch from mozb#734335 for fixing the sps profiler build
+- Fixed build of jemalloc on ppc (patch by Gustavo Luiz Duarte/IBM)
+
 * Fri May 4 2012 Dan Horák <dan[at]danny.cz> - 12.0-4
 - Added new patch for 691898 - backport from trunk
 - Added build fix for secondary arches


More information about the scm-commits mailing list