[PPPC64] Steps to successfully build Pale Moon 34.3.0.1 on Linux/PPC (BigEndian)

Talk about code development, features, specific bugs, enhancements, patches, and similar things.
Forum rules
Please keep everything here strictly on-topic.
This board is meant for Pale Moon source code development related subjects only like code snippets, patches, specific bugs, git, the repositories, etc.

This is not for tech support! Please do not post tech support questions in the "Development" board!
Please make sure not to use this board for support questions. Please post issues with specific websites, extensions, etc. in the relevant boards for those topics.

Please keep things on-topic as this forum will be used for reference for Pale Moon development. Expect topics that aren't relevant as such to be moved or deleted.
User avatar
rpxrpx
New to the forum
New to the forum
Posts: 1
Joined: 2026-06-25, 18:20

[PPPC64] Steps to successfully build Pale Moon 34.3.0.1 on Linux/PPC (BigEndian)

Post by rpxrpx » 2026-06-25, 19:38

Hi.

The problem: Cloning the git repository and building Pale Moon on older PPC970, Power5, Power6 and most probably Power7 hardware results in a binary that contains vector instructions for power cpus like Power8 and newer. This binary is (of course) not executable on the older hardware.

In this post I will describe what needs to be done to get a working build.


The problem is located in the platform module.

The solution is to patch the following 3 files:

Code: Select all

       platform/security/nss/lib/freebl/freebl.gyp
       platform/security/nss/lib/freebl/gcm-ppc.c
       platform/security/nss/lib/freebl/ppc-crypto.h

The developers of the freebl code have some code to select the right CPU platform and version but it does not work as we need it.
However by inserting/changing some really small patterns it works.

The following is a "git diff" output:

Code: Select all

diff --git a/security/nss/lib/freebl/freebl.gyp b/security/nss/lib/freebl/freebl.gyp
index 23940ef774..f9f5c6e575 100644
--- a/security/nss/lib/freebl/freebl.gyp
+++ b/security/nss/lib/freebl/freebl.gyp
@@ -291,7 +291,6 @@
       'type': 'static_library',
       'sources': [
         'gcm-ppc.c',
-        'sha512-p8.s',
       ],
       'dependencies': [
         '<(DEPTH)/exports.gyp:nss_exports'
@@ -415,16 +414,13 @@
       'conditions': [
         [ 'disable_crypto_vsx==0', {
           'cflags': [
-            '-mcrypto',
             '-maltivec',
-            '-mvsx',
             '-funroll-loops',
             '-fpeel-loops'
            ],
            'cflags_mozilla': [
             '-mcrypto',
             '-maltivec',
-            '-mvsx',
             '-funroll-loops',
             '-fpeel-loops'
            ],
diff --git a/security/nss/lib/freebl/gcm-ppc.c b/security/nss/lib/freebl/gcm-ppc.c
index 9bd4f29569..327dec740c 100644
--- a/security/nss/lib/freebl/gcm-ppc.c
+++ b/security/nss/lib/freebl/gcm-ppc.c
@@ -8,6 +8,10 @@
 #include "gcm.h"
 #include "secerr.h"
 
+#if defined(USE_PPC_CRYPTO)
+#undef USE_PPC_CRYPTO
+#endif
+
 #if defined(USE_PPC_CRYPTO)
 
 SECStatus
diff --git a/security/nss/lib/freebl/ppc-crypto.h b/security/nss/lib/freebl/ppc-crypto.h
index 4d283895f2..c3b45c3329 100644
--- a/security/nss/lib/freebl/ppc-crypto.h
+++ b/security/nss/lib/freebl/ppc-crypto.h
@@ -23,7 +23,7 @@
  */
 #if (defined(__clang__) || (defined(__GNUC__) && __GNUC__ >= 8)) && \
     defined(IS_LITTLE_ENDIAN) && defined(__VSX__)
-#define USE_PPC_CRYPTO
+// #define USE_PPC_CRYPTO
 #endif
 
 #endif /* defined(__powerpc64__) && !defined(NSS_DISABLE_ALTIVEC) && defined(__ALTIVEC__) */

Here are some infos on the build environment:

hardware: PowerMac G5 with Debian Sid
gcc version: 15.2.0-12
optimization level: -O1

Quality of the build: acceptable for every day use; will crash after some hours of use (but this is another problem...)

I hope this may be usefull.

Best regards.

User avatar
andyprough
Forum staff
Forum staff
Posts: 1574
Joined: 2020-05-31, 04:33

Re: [PPPC64] Steps to successfully build Pale Moon 34.3.0.1 on Linux/PPC (BigEndian)

Post by andyprough » 2026-06-26, 04:05

Impressive! Do you know of others that are trying Pale Moon builds on PPC970, Power5, Power6 and Power7? I wonder if we should try to have community builds for them?

dbsoft
Project Contributor
Project Contributor
Posts: 551
Joined: 2020-02-21, 17:35

Re: [PPPC64] Steps to successfully build Pale Moon 34.3.0.1 on Linux/PPC (BigEndian)

Post by dbsoft » 2026-06-26, 05:36

I do builds of Pale Moon (branded as White Star) for PowerPC64 Linux all this year:

https://dbsoft.org/whitestar.php
https://dbsoft.org/forum/showthread.php?tid=254
https://github.com/dbsoft/White-Star

(I do not need to make any of the changes you listed, and it is stable, I have it running for weeks)
Last edited by dbsoft on 2026-06-26, 06:05, edited 1 time in total.

User avatar
andyprough
Forum staff
Forum staff
Posts: 1574
Joined: 2020-05-31, 04:33

Re: [PPPC64] Steps to successfully build Pale Moon 34.3.0.1 on Linux/PPC (BigEndian)

Post by andyprough » 2026-06-26, 06:00

dbsoft wrote:
2026-06-26, 05:36
I do builds of Pale Moon (branded as White Star) for PowerPC64 Linux all this year:

https://dbsoft.org/whitestar.php
https://dbsoft.org/forum/showthread.php?tid=254

(I do not need to make any of the changes you listed, and it is stable, I have it running for weeks)
Oh, I see, I do not have any experience with this architecture. Are there many users @dbsoft?

dbsoft
Project Contributor
Project Contributor
Posts: 551
Joined: 2020-02-21, 17:35

Re: [PPPC64] Steps to successfully build Pale Moon 34.3.0.1 on Linux/PPC (BigEndian)

Post by dbsoft » 2026-06-26, 06:04

I have no idea! LOL... I use it... not sure who else... but I make the builds available for people.

User avatar
Moonchild
Project founder
Project founder
Posts: 39633
Joined: 2011-08-28, 17:27
Location: Sweden

Re: [PPPC64] Steps to successfully build Pale Moon 34.3.0.1 on Linux/PPC (BigEndian)

Post by Moonchild » 2026-06-26, 07:27

dbsoft wrote:
2026-06-26, 06:04
I have no idea! LOL... I use it... not sure who else... but I make the builds available for people.
You could make a guess by looking at your web logs?
"Sales hates anything that can't be turned into a confident sentence." - anonymous warehouse worker
"Why debate someone you fundamentally don't trust?" - Dario Amodei
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

dbsoft
Project Contributor
Project Contributor
Posts: 551
Joined: 2020-02-21, 17:35

Re: [PPPC64] Steps to successfully build Pale Moon 34.3.0.1 on Linux/PPC (BigEndian)

Post by dbsoft » 2026-06-26, 15:24

Well, my web logs had been filled with AI bots sucking down everything and more likely stuff would be downloaded from GitHub which does not really have useful logs.

Edit: My web logs show it downloaded about 40 times, but the user agents all seem pretty suspicious... Android, Linux x64, Half are Spiders including Google.

User avatar
OPNA2608
Hobby Astronomer
Hobby Astronomer
Posts: 27
Joined: 2019-09-27, 09:30

Re: [PPPC64] Steps to successfully build Pale Moon 34.3.0.1 on Linux/PPC (BigEndian)

Post by OPNA2608 » 2026-06-29, 08:47

Another Power Mac G5 user here, have also been looking into getting this to build on old, big-endian POWER (though via Nixpkgs instead of Debian's packages & build environments).

Regarding sha512-p8.s: Upstream NSS only adds it when targeting the ELFv2 ABI (code checking the ABI version is at the bottom of the same file): https://hg-edge.mozilla.org/projects/nss/file/635e02b363fec457c48f48fad6d5139a7cd38365/lib/freebl/freebl.gyp#l186
I think it only needs AltiVec extensions, so that condition might be fine? But I don't have a setup that requires ELFv2 (powerpc64le-linux), nor do I maintain one that has opted into it (powerpc64-linux w/ musl only supports ELFv2; powerpc64-linux w/ glibc can be built targeting ELFv2, but it's not the default), so I haven't tested that.

The rest of the changes… disable_crypto_vsx is being set to 1 in /platform/security/moz.build, so /platform/security/nss/lib/freebl/freebl.gyp defines NSS_DISABLE_CRYPTO_VSX for afew targets. Adding a check for !defined(NSS_DISABLE_CRYPTO_VSX) to the condition for USE_PPC_CRYPTO to be defined in /platform/security/nss/lib/freebl/ppc-crypto.h seems like it would do the trick?

Do defines from a target propagate to its dependency targets in GYP? I'm not familiar with that build system… If not, then maybe that same conditional define just needs to be added to the gcm-aes-ppc_c_lib target?

User avatar
OPNA2608
Hobby Astronomer
Hobby Astronomer
Posts: 27
Joined: 2019-09-27, 09:30

Re: [PPPC64] Steps to successfully build Pale Moon 34.3.0.1 on Linux/PPC (BigEndian)

Post by OPNA2608 » 2026-06-30, 13:12

I can get Pale Moon to build on my end, but running mach install seems to get stuck at the cache precompilation:

Code: Select all

palemoon>  0:02.38 /nix/store/w2b72qx8dr6b8kzpp32v49bw7h46p56s-gnumake-4.4.1/bin/make -C . -j2 -s -w install
palemoon>  0:02.40 make: Entering directory '/build/source/obj-powerpc64-unknown-linux-gnu'
palemoon>  0:02.58 make[1]: Entering directory '/build/source/obj-powerpc64-unknown-linux-gnu/palemoon/installer'
palemoon>  0:08.77 Executing /build/source/obj-powerpc64-unknown-linux-gnu/dist/bin/xpcshell -g /build/source/obj-powerpc64-unknown-linux-gnu/dist/bin/ -a /build/source/obj-powerpc64-unknown-linux-gnu/dist/bin/ -f /build/source/platform/toolkit/mozapps/installer/precompile_cache.js -e precompile_startupcache("resource://gre/");
The spawned threads seem to be sleeping. It has been stuck at this for many hours with no change. Maybe someone here has an idea what could be going wrong, or how I could get more information out of this?

User avatar
Moonchild
Project founder
Project founder
Posts: 39633
Joined: 2011-08-28, 17:27
Location: Sweden

Re: [PPPC64] Steps to successfully build Pale Moon 34.3.0.1 on Linux/PPC (BigEndian)

Post by Moonchild » 2026-06-30, 13:33

You'll want to use ac_add_options --disable-precompiled-startupcache in your .mozconfig. It's not actually used in official releases, and is known to be temperamental.
"Sales hates anything that can't be turned into a confident sentence." - anonymous warehouse worker
"Why debate someone you fundamentally don't trust?" - Dario Amodei
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

User avatar
OPNA2608
Hobby Astronomer
Hobby Astronomer
Posts: 27
Joined: 2019-09-27, 09:30

Re: [PPPC64] Steps to successfully build Pale Moon 34.3.0.1 on Linux/PPC (BigEndian)

Post by OPNA2608 » 2026-07-03, 10:23

Gotcha, that got it past mach install. Resulting binary's help & version output works, but trying to start the browser just leaves me with one zombie and abunch of sleeping threads. Tried building with Debian's binaries & libraries as well, and launching from a proper DE instead of just startx, just to make sure.

Code: Select all

 S  CPU% MEM%   TIME+  Command                                                                                                                                               
 S   0.0  0.1  0:00.19 ├─ login -- puna
 S   0.0  0.2  0:01.03 │  └─ -fish
 S   0.0  0.0  0:00.01 │     └─ /bin/sh /usr/bin/startx /home/puna/Development/Pale-Moon/install/bin/palemoon
 S   0.0  0.0  0:00.01 │        └─ xinit /home/puna/Development/Pale-Moon/install/bin/palemoon -- /etc/X11/xinit/xserverrc :0 vt1 -keeptty -auth /tmp/serverauth.0XjN86rF71  
 S   0.0  1.3  0:01.07 │           ├─ /usr/lib/xorg/Xorg -nolisten tcp :0 vt1 -keeptty -auth /tmp/serverauth.0XjN86rF71
 S   0.0  1.3  0:00.02 │           │  └─ /usr/lib/xorg/Xorg -nolisten tcp :0 vt1 -keeptty -auth /tmp/serverauth.0XjN86rF71
 S   0.0  2.1  0:00.40 │           └─ /home/puna/Development/Pale-Moon/install/bin/palemoon
 Z   0.0  0.0  0:00.44 │              ├─ palemoon
 S   0.0  2.1  0:00.00 │              ├─ /home/puna/Development/Pale-Moon/install/bin/palemoon
 S   0.0  2.1  0:00.00 │              ├─ /home/puna/Development/Pale-Moon/install/bin/palemoon
 S   0.0  2.1  0:00.00 │              ├─ /home/puna/Development/Pale-Moon/install/bin/palemoon
 S   0.0  2.1  0:00.00 │              └─ /home/puna/Development/Pale-Moon/install/bin/palemoon
Current patch applied to 34.3.1:

Code: Select all

diff '--color=auto' -ruN a/platform/security/nss/lib/freebl/freebl.gyp b/platform/security/nss/lib/freebl/freebl.gyp
--- a/platform/security/nss/lib/freebl/freebl.gyp       2026-06-29 11:07:46.943647767 +0200
+++ b/platform/security/nss/lib/freebl/freebl.gyp       2026-06-29 10:57:30.511834118 +0200
@@ -291,12 +291,16 @@
       'type': 'static_library',
       'sources': [
         'gcm-ppc.c',
-        'sha512-p8.s',
       ],
       'dependencies': [
         '<(DEPTH)/exports.gyp:nss_exports'
       ],
       'conditions': [
+        [ 'ppc_abi==2', {
+          'sources': [
+            'sha512-p8.s',
+          ],
+        }],
         [ 'disable_crypto_vsx==0', {
           'cflags': [
             '-mcrypto',
@@ -313,6 +317,11 @@
           'cflags_mozilla': [
             '-maltivec'
           ],
+        }],
+        [ 'disable_crypto_vsx==1 and (target_arch=="ppc" or target_arch=="ppc64" or target_arch=="ppc64le")', {
+          'defines!': [
+            'NSS_DISABLE_CRYPTO_VSX',
+          ],
         }]
       ]
     },
@@ -938,6 +947,9 @@
         # Confusingly, __SOFTFP__ is the name of the define for the softfloat ABI, not for the softfp ABI.
         'softfp_cflags': '<!(${CC:-cc} -o - -E -dM - ${CFLAGS} < /dev/null | grep __SOFTFP__ > /dev/null && echo -mfloat-abi=softfp || true)',
       }],
+      [ 'target_arch=="ppc64" or target_arch=="ppc64le"', {
+        'ppc_abi': '<!(sh -c "${CC:-cc} -dM -E - < /dev/null | awk \'\\$2 == \\"_CALL_ELF\\" {print \\$3}\'")',
+      }]
     ],
   }
 }
diff '--color=auto' -ruN a/platform/security/nss/lib/freebl/ppc-crypto.h b/platform/security/nss/lib/freebl/ppc-crypto.h
--- a/platform/security/nss/lib/freebl/ppc-crypto.h     2026-06-29 11:07:46.944541301 +0200
+++ b/platform/security/nss/lib/freebl/ppc-crypto.h     2026-06-29 11:08:19.513889087 +0200
@@ -22,7 +22,8 @@
  * please send a patch.
  */
 #if (defined(__clang__) || (defined(__GNUC__) && __GNUC__ >= 8)) && \
-    defined(IS_LITTLE_ENDIAN) && defined(__VSX__)
+    defined(IS_LITTLE_ENDIAN) && defined(__VSX__) && \
+    !defined(NSS_DISABLE_CRYPTO_VSX)
 #define USE_PPC_CRYPTO
 #endif
mozconfig looks p much like the one required for official branding (_BUILD_64=1, _GTK_VERSION=3), just with these additions:

Code: Select all

ac_add_options --prefix=/home/puna/Development/Pale-Moon/install

mk_add_options MOZ_MAKE_FLAGS=-j2

ac_add_options --disable-precompiled-startupcache
Maybe OP has an idea, since they seemed to have gotten this to work on their G5 Debian Sid system? If this was due to an unsupported POWER instruction, I'd expect the process to halt with a SIGILL or smth.

In case it helps, this is a 2.3GHz dual-processor G5 w/ a Radeon 9600. Tried GCCs were 15.3.0 (Debian), 15.2.0 (Nixpkgs), 13.4.0 (closest to the recommended version that's still in Nixpkgs).

User avatar
Moonchild
Project founder
Project founder
Posts: 39633
Joined: 2011-08-28, 17:27
Location: Sweden

Re: [PPPC64] Steps to successfully build Pale Moon 34.3.0.1 on Linux/PPC (BigEndian)

Post by Moonchild » 2026-07-03, 11:09

I'm not entirely sure about the current state of mach install in our tree. the normal way of using it is running mach package and using the resulting archive.
"Sales hates anything that can't be turned into a confident sentence." - anonymous warehouse worker
"Why debate someone you fundamentally don't trust?" - Dario Amodei
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

dbsoft
Project Contributor
Project Contributor
Posts: 551
Joined: 2020-02-21, 17:35

Re: [PPPC64] Steps to successfully build Pale Moon 34.3.0.1 on Linux/PPC (BigEndian)

Post by dbsoft » 2026-07-03, 16:02

You can just set the ABI to 1 in that file and that file links successfully, it isn't clear what requires ABI 1 and 2 to me, so I just change the ABI version in the file if it complains.

I didn't want to change that in the repo in case ABI 2 is required for other things.