Your message dated Wed, 12 Sep 2018 19:54:11 +0200
with message-id <[email protected]>
and subject line Re: Bug#824449: firefox: FTBFS on sparc64 due to wrong 
platform definitions
has caused the Debian Bug report #824449,
regarding firefox: Fix broken sparc64 build support
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
824449: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=824449
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Source: firefox
Version: 46.0.1-1
Severity: normal
Tags: patch
User: [email protected]
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@landau:~# dpkg --print-architecture
sparc64
root@landau:~# echo | gcc -E -dM - |grep sparc64
root@landau:~#

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

root@landau:~# echo | gcc -E -dM - |grep __sparc__
#define __sparc__ 1
root@landau:~# echo | gcc -E -dM - |grep __arch64__
#define __arch64__ 1
root@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 - [email protected]
`. `'   Freie Universitaet Berlin - [email protected]
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913

--- End Message ---
--- Begin Message ---
Hi!

Both firefox and firefox-esr now build fine on sparc64.

There is still one alignment-related crash though [1], but that should
be addressed in a separate bug report and patch. I'll try to propose
a less intrusive patch upstream.

Adrian

> [1] https://bugzilla.mozilla.org/show_bug.cgi?id=1434726

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - [email protected]
`. `'   Freie Universitaet Berlin - [email protected]
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913

--- End Message ---

Reply via email to