added mozilla-gcc47.patch to fix build issues when compiled with gcc 4.7
authorWolfgang Rosenauer <wr@rosenauer.org>
Mon, 16 Apr 2012 14:56:32 +0200
changeset 425 e840ed7d6878
parent 423 f036c316fb68
child 432 811ec8b462d1
child 435 df9c4a6e84f8
added mozilla-gcc47.patch to fix build issues when compiled with gcc 4.7
MozillaFirefox/MozillaFirefox.spec
MozillaFirefox/mozilla-gcc47.patch
mozilla-gcc47.patch
series
xulrunner/mozilla-gcc47.patch
xulrunner/xulrunner.spec
--- a/MozillaFirefox/MozillaFirefox.spec	Mon Apr 16 11:49:20 2012 +0200
+++ b/MozillaFirefox/MozillaFirefox.spec	Mon Apr 16 14:56:32 2012 +0200
@@ -94,6 +94,7 @@
 Patch16:        mozilla-system-nspr.patch
 Patch17:        mozilla-revert_621446.patch
 Patch18:        mozilla-libnotify.patch
+Patch19:        mozilla-gcc47.patch
 # Firefox/browser
 Patch31:        firefox-browser-css.patch
 Patch32:        firefox-cross-desktop.patch
@@ -226,6 +227,7 @@
 %patch16 -p1
 %patch17 -p1
 %patch18 -p1
+%patch19 -p1
 #
 %patch31 -p1
 %patch32 -p1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MozillaFirefox/mozilla-gcc47.patch	Mon Apr 16 14:56:32 2012 +0200
@@ -0,0 +1,1 @@
+../mozilla-gcc47.patch
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mozilla-gcc47.patch	Mon Apr 16 14:56:32 2012 +0200
@@ -0,0 +1,105 @@
+# HG changeset patch
+# Parent 11d55dfd8e3a732ea60761b259e20790b0ecec43
+Patch to make Mozilla build with gcc 4.7, including
+- Bug 734490 - "no viable overloaded 'PRIxPTR'" when building with Clang or GCC 4.7 (TM: Mozilla14)
+
+diff --git a/layout/base/tests/TestPoisonArea.cpp b/layout/base/tests/TestPoisonArea.cpp
+--- a/layout/base/tests/TestPoisonArea.cpp
++++ b/layout/base/tests/TestPoisonArea.cpp
+@@ -392,53 +392,53 @@ ReservePoisonArea()
+ {
+   if (sizeof(uintptr_t) == 8) {
+     // Use the hardware-inaccessible region.
+     // We have to avoid 64-bit constants and shifts by 32 bits, since this
+     // code is compiled in 32-bit mode, although it is never executed there.
+     uintptr_t result = (((uintptr_t(0x7FFFFFFFu) << 31) << 1 |
+                          uintptr_t(0xF0DEAFFFu)) &
+                         ~uintptr_t(PAGESIZE-1));
+-    printf("INFO | poison area assumed at 0x%.*"PRIxPTR"\n", SIZxPTR, result);
++    printf("INFO | poison area assumed at 0x%.*" PRIxPTR "\n", SIZxPTR, result);
+     return result;
+   } else {
+     // First see if we can allocate the preferred poison address from the OS.
+     uintptr_t candidate = (0xF0DEAFFF & ~(PAGESIZE-1));
+     void *result = ReserveRegion(candidate, false);
+     if (result == (void *)candidate) {
+       // success - inaccessible page allocated
+-      printf("INFO | poison area allocated at 0x%.*"PRIxPTR
++      printf("INFO | poison area allocated at 0x%.*" PRIxPTR
+              " (preferred addr)\n", SIZxPTR, (uintptr_t)result);
+       return candidate;
+     }
+ 
+     // That didn't work, so see if the preferred address is within a range
+     // of permanently inacessible memory.
+     if (ProbeRegion(candidate)) {
+       // success - selected page cannot be usable memory
+       if (result != MAP_FAILED)
+         ReleaseRegion(result);
+-      printf("INFO | poison area assumed at 0x%.*"PRIxPTR
++      printf("INFO | poison area assumed at 0x%.*" PRIxPTR
+              " (preferred addr)\n", SIZxPTR, candidate);
+       return candidate;
+     }
+ 
+     // The preferred address is already in use.  Did the OS give us a
+     // consolation prize?
+     if (result != MAP_FAILED) {
+-      printf("INFO | poison area allocated at 0x%.*"PRIxPTR
++      printf("INFO | poison area allocated at 0x%.*" PRIxPTR
+              " (consolation prize)\n", SIZxPTR, (uintptr_t)result);
+       return (uintptr_t)result;
+     }
+ 
+     // It didn't, so try to allocate again, without any constraint on
+     // the address.
+     result = ReserveRegion(0, false);
+     if (result != MAP_FAILED) {
+-      printf("INFO | poison area allocated at 0x%.*"PRIxPTR
++      printf("INFO | poison area allocated at 0x%.*" PRIxPTR
+              " (fallback)\n", SIZxPTR, (uintptr_t)result);
+       return (uintptr_t)result;
+     }
+ 
+     printf("ERROR | no usable poison area found\n");
+     return 0;
+   }
+ }
+@@ -450,17 +450,17 @@ static uintptr_t
+ ReservePositiveControl()
+ {
+ 
+   void *result = ReserveRegion(0, false);
+   if (result == MAP_FAILED) {
+     printf("ERROR | allocating positive control | %s\n", LastErrMsg());
+     return 0;
+   }
+-  printf("INFO | positive control allocated at 0x%.*"PRIxPTR"\n",
++  printf("INFO | positive control allocated at 0x%.*" PRIxPTR "\n",
+          SIZxPTR, (uintptr_t)result);
+   return (uintptr_t)result;
+ }
+ 
+ /* The "negative control" area confirms that our probe logic does detect a
+  * page that is readable, writable, or executable.
+  */
+ static uintptr_t
+@@ -481,17 +481,17 @@ ReserveNegativeControl()
+   // Now mark it executable as well as readable and writable.
+   // (mmap(PROT_EXEC) may fail when applied to anonymous memory.)
+ 
+   if (MakeRegionExecutable(result)) {
+     printf("ERROR | making negative control executable | %s\n", LastErrMsg());
+     return 0;
+   }
+ 
+-  printf("INFO | negative control allocated at 0x%.*"PRIxPTR"\n",
++  printf("INFO | negative control allocated at 0x%.*" PRIxPTR "\n",
+          SIZxPTR, (uintptr_t)result);
+   return (uintptr_t)result;
+ }
+ 
+ static void
+ JumpTo(uintptr_t opaddr)
+ {
+ #ifdef __ia64
--- a/series	Mon Apr 16 11:49:20 2012 +0200
+++ b/series	Mon Apr 16 14:56:32 2012 +0200
@@ -20,6 +20,7 @@
 mozilla-system-nspr.patch
 mozilla-revert_621446.patch
 mozilla-libnotify.patch
+mozilla-gcc47.patch
 #mozilla-yarr-pcre.patch
 
 # Firefox patches
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xulrunner/mozilla-gcc47.patch	Mon Apr 16 14:56:32 2012 +0200
@@ -0,0 +1,1 @@
+../mozilla-gcc47.patch
\ No newline at end of file
--- a/xulrunner/xulrunner.spec	Mon Apr 16 11:49:20 2012 +0200
+++ b/xulrunner/xulrunner.spec	Mon Apr 16 14:56:32 2012 +0200
@@ -83,6 +83,7 @@
 Patch17:        mozilla-revert_621446.patch
 Patch18:        mozilla-yarr-pcre.patch
 Patch19:        mozilla-libnotify.patch
+Patch20:        mozilla-gcc47.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 Requires:       mozilla-js = %{version}
 Requires(post):  update-alternatives coreutils
@@ -205,6 +206,7 @@
 #%patch17 -p1
 %patch18 -p1
 %patch19 -p1
+%patch20 -p1
 
 %build
 # no need to add build time to binaries