Bug#1105090: firefox: Please build with gcc and g++ on ppc64

John Paul Adrian Glaubitz <[email protected]>
Newsgroups gmane.linux.debian.ports.powerpc
Message-ID <174691646244.1467488.101556754611008800.reportbug__15437.8321183444$1746916587$gmane$org@z6>
Source: firefox
Version: 138.0.1-1
Severity: normal
Tags: patch
User: [email protected]
Usertags: ppc64
X-Debbugs-Cc: [email protected]

Hi,

the firefox package fails to build on ppc64 since it tries to use lld
which does not support PowerPC ELF v1:

checking what kind of list files are supported by the linker... 
DEBUG: Creating `/tmp/conftest44pjfr9k.c` with content:
DEBUG: | int main() {}
DEBUG: Executing: `/usr/bin/clang /tmp/conftest44pjfr9k.c -c -o /tmp/conftest8a8_h03u.o`
DEBUG: Executing: `/usr/bin/clang -fuse-ld=lld -o /tmp/conftestyqnf9t8a.out -Wl,@/tmp/conftestn8cgmdg6.list`
DEBUG: The command returned non-zero exit status 1.
DEBUG: Its error output was:
DEBUG: | ld.lld: error: /lib/powerpc64-linux-gnu/Scrt1.o: ABI version 1 is not supported
DEBUG: | clang: error: linker command failed with exit code 1 (use -v to see invocation)
DEBUG: Executing: `/usr/bin/clang -fuse-ld=lld -o /tmp/conftestyqnf9t8a.out -Wl,@/tmp/conftestn8cgmdg6.list`
DEBUG: The command returned non-zero exit status 1.
DEBUG: Its error output was:
DEBUG: | ld.lld: error: /lib/powerpc64-linux-gnu/Scrt1.o: ABI version 1 is not supported
DEBUG: | clang: error: linker command failed with exit code 1 (use -v to see invocation)
DEBUG: Executing: `/usr/bin/clang -fuse-ld=lld -o /tmp/conftestyqnf9t8a.out @/tmp/conftestn8cgmdg6.list`
DEBUG: The command returned non-zero exit status 1.
DEBUG: Its error output was:
DEBUG: | ld.lld: error: /lib/powerpc64-linux-gnu/Scrt1.o: ABI version 1 is not supported
DEBUG: | clang: error: linker command failed with exit code 1 (use -v to see invocation)
ERROR: Couldn't find one that works

This can be fixed by overriding the default C and C++ compilers which forces firefox to
use the bfd linker instead of lld:

--- /home/glaubitz/rules.orig   2025-05-10 04:12:23.154624384 -0700
+++ debian/rules        2025-05-10 14:35:20.765215119 -0700
@@ -113,6 +113,11 @@
        CONFIGURE_FLAGS += --disable-webrtc
 endif
 
+ifneq (,$(filter ppc64,$(DEB_HOST_ARCH)))
+       CC := gcc
+       CXX := g++
+endif
+
 ifeq (default,$(origin CC))
 ifneq (,$(filter-out bullseye bookworm,$(DIST)))
 CC := clang

Could you apply this change for the next upload? I'm attaching the patch.

Thanks,
Adrian

--
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer
`. `'   Physicist
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
ppc64-use-gcc.diff (text/plain, 348 B)
--- debian/rules.orig	2025-05-10 04:12:23.154624384 -0700
+++ debian/rules	2025-05-10 14:35:20.765215119 -0700
@@ -113,6 +113,11 @@
 	CONFIGURE_FLAGS += --disable-webrtc
 endif
 
+ifneq (,$(filter ppc64,$(DEB_HOST_ARCH)))
+	CC := gcc
+	CXX := g++
+endif
+
 ifeq (default,$(origin CC))
 ifneq (,$(filter-out bullseye bookworm,$(DIST)))
 CC := clang
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.