Bug#824449: firefox: FTBFS on sparc64 due to wrong platform definitions

John Paul Adrian Glaubitz glaubitz at physik.fu-berlin.de
Mon May 16 08:15:03 UTC 2016


Source: firefox
Version: 46.0.1-1
Severity: normal
Tags: patch
User: debian-sparc at lists.debian.org
Usertags: sparc64

Hi!

I have had a look at the firefox package on sparc64 and I was able to detect
two problems with platform definitions which prevent an almost successful
build on this architecture.

Firstly, the embedded version of protobuf contains the same bug that we
have already fixed in the protobuf package in Debian which is basically
a missing #ifdef for 'sparc64' [1]:

--- firefox-46.0.1.orig/toolkit/components/protobuf/src/google/protobuf/stubs/platform_macros.h
+++ firefox-46.0.1/toolkit/components/protobuf/src/google/protobuf/stubs/platform_macros.h
@@ -67,7 +67,7 @@
 #define GOOGLE_PROTOBUF_ARCH_32_BIT 1
 #elif defined(sparc)
 #define GOOGLE_PROTOBUF_ARCH_SPARC 1
-#ifdef SOLARIS_64BIT_ENABLED
+#if defined(SOLARIS_64BIT_ENABLED) || defined(__LP64__)
 #define GOOGLE_PROTOBUF_ARCH_64_BIT 1
 #else
 #define GOOGLE_PROTOBUF_ARCH_32_BIT 1

Note: This cannot be fixed by checking for '__sparc64__' as the compiler
does not generate this definition on sparc64:

root at landau:~# dpkg --print-architecture
sparc64
root at landau:~# echo | gcc -E -dM - |grep sparc64
root at landau:~#

Instead, we need to check for both __sparc__ and __arch64__:

root at landau:~# echo | gcc -E -dM - |grep __sparc__
#define __sparc__ 1
root at landau:~# echo | gcc -E -dM - |grep __arch64__
#define __arch64__ 1
root at landau:~#

Which will bring us also directly to the second problem which prevents
building of firefox on sparc64. It's actually the incorrect checking
for __sparc64__ in ipc/chromium which can be trivially fixed with:

--- firefox-46.0.1.orig/ipc/chromium/src/build/build_config.h
+++ firefox-46.0.1/ipc/chromium/src/build/build_config.h
@@ -81,7 +81,7 @@
 #elif defined(__ppc__) || defined(__powerpc__)
 #define ARCH_CPU_PPC 1
 #define ARCH_CPU_32_BITS 1
-#elif defined(__sparc64__)
+#elif defined(__sparc__) && defined(__arch64__)
 #define ARCH_CPU_SPARC 1
 #define ARCH_CPU_64_BITS 1
 #elif defined(__sparc__)

After applying both patches, the build *almost* finishes on sparc64,
in fact, it fails at dh_auto_install with [2]:

Executing /<<PKGBUILDDIR>>/build-browser/dist/bin/xpcshell -g /<<PKGBUILDDIR>>/build-browser/dist/bin/ -a /<<PKGBUILDDIR>>/build-browser/dist/bin/ -f /<<PKGBUILDDIR>>/toolkit/mozapps/installer/precompile_cache.js -e precompile_startupcache("resource://gre/");
Traceback (most recent call last):
  File "/<<PKGBUILDDIR>>/toolkit/mozapps/installer/packager.py", line 410, in <module>
    main()
  File "/<<PKGBUILDDIR>>/toolkit/mozapps/installer/packager.py", line 404, in main
    args.source, gre_path, base)
  File "/<<PKGBUILDDIR>>/toolkit/mozapps/installer/packager.py", line 161, 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

which seems to be the exact same problem which also prevents the build on hppa [3].

It would be great if the two above changes could be merged into the firefox package
in Debian plus someone should also forward this bug report upstream. Then we just
need to figure out what's wrong with the startup cache precompiliation and might
be able to fix firefox on both hppa and sparc64.

Cheers,
Adrian

> [1] https://anonscm.debian.org/cgit/pkg-protobuf/pkg-protobuf.git/tree/debian/patches/02-fix-sparc64-builds.patch
> [2] https://buildd.debian.org/status/fetch.php?pkg=firefox&arch=sparc64&ver=46.0.1-1&stamp=1463370916
> [3] https://buildd.debian.org/status/fetch.php?pkg=firefox&arch=hppa&ver=46.0.1-1&stamp=1462743802

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaubitz at debian.org
`. `'   Freie Universitaet Berlin - glaubitz at physik.fu-berlin.de
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913



More information about the pkg-mozilla-maintainers mailing list