[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#849838: firefox: Fix broken hppa build support

Source: firefox
Version: 50.1.0-1
Severity: normal
Tags: patch
User: debian-hppa@lists.debian.org
Usertags: hppa


Firefox currently fails to build from source on hppa due to a bug
in the xpcom code. The resulting crash happens during 'make install':

Traceback (most recent call last):
  File "/<<PKGBUILDDIR>>/toolkit/mozapps/installer/packager.py", line 415, in <module>
  File "/<<PKGBUILDDIR>>/toolkit/mozapps/installer/packager.py", line 409, in main
    args.source, gre_path, base)
  File "/<<PKGBUILDDIR>>/toolkit/mozapps/installer/packager.py", line 166, in precompile_cache
    errors.fatal('Error while running startup cache precompilation')
  File "/<<PKGBUILDDIR>>/python/mozbuild/mozpack/errors.py", line 103, in fatal
    self._handle(self.FATAL, msg)
  File "/<<PKGBUILDDIR>>/python/mozbuild/mozpack/errors.py", line 98, in _handle
    raise ErrorMessage(msg)
mozpack.errors.ErrorMessage: Error: Error while running startup cache precompilation

The attached patch fixes the problem by fixing the hppa-specific xpcom
code. Furthermore, it enables the PowerPC atomic operations for hppa
as these are generic enough to be used on other targets as well.


 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaubitz@debian.org
`. `'   Freie Universitaet Berlin - glaubitz@physik.fu-berlin.de
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
Description: Fix build on hppa
Author: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Forwarded: https://bugzilla.mozilla.org/show_bug.cgi?id=1325495
Last-Update: 2017-01-01

Index: firefox-50.1.0/js/src/jit/AtomicOperations.h
--- firefox-50.1.0.orig/js/src/jit/AtomicOperations.h
+++ firefox-50.1.0/js/src/jit/AtomicOperations.h
@@ -324,6 +324,8 @@ AtomicOperations::isLockfree(int32_t siz
 # include "jit/arm/AtomicOperations-arm.h"
 #elif defined(JS_CODEGEN_ARM64)
 # include "jit/arm64/AtomicOperations-arm64.h"
+#elif defined(__hppa__)
+# include "jit/none/AtomicOperations-ppc.h"
 #elif defined(JS_CODEGEN_MIPS32) || defined(JS_CODEGEN_MIPS64)
 # include "jit/mips-shared/AtomicOperations-mips-shared.h"
 #elif defined(__ppc__) || defined(__PPC__)
Index: firefox-50.1.0/xpcom/reflect/xptcall/md/unix/xptcstubs_pa32.cpp
--- firefox-50.1.0.orig/xpcom/reflect/xptcall/md/unix/xptcstubs_pa32.cpp
+++ firefox-50.1.0/xpcom/reflect/xptcall/md/unix/xptcstubs_pa32.cpp
@@ -126,11 +126,20 @@ PrepareAndDispatch(nsXPTCStubBase* self,
 extern "C" nsresult SharedStub(int);
+#ifdef __GNUC__
 #define STUB_ENTRY(n)       \
 nsresult nsXPTCStubBase::Stub##n()  \
 {                           \
+    __asm__ __volatile__ ("STW %r26, -36-64(%sp)"); \
     return SharedStub(n);   \
+#define STUB_ENTRY(n)       \
+nsresult nsXPTCStubBase::Stub##n()  \
+{                           \
+    return SharedStub(n);   \
 #define SENTINEL_ENTRY(n) \
 nsresult nsXPTCStubBase::Sentinel##n() \

Reply to: