Picture of Jürgen Kreileder

PER_LINUX32 Fixes for Linux/ppc64

I’ve tried to rebuild the latest Debian packages of Mozilla and Firefox with my jsarena pointer arithmetic fix on ppc32/ppc64 today. Rebuilding worked fine with older versions but this time it failed because the makefiles identified my G5 as an i386 box! The makefiles use uname -m to determine the CPU type, there’s no code to handle ‘ppc64’ and the default is ‘x86’.

As my old work-around (providing a uname command that returns ‘ppc’) didn’t work anymore, this forced me to look at the root cause of the problem.

I’ve finally found two issues with the PER_LINUX32 personality:

  • uname(2) didn’t respect PER_LINUX32
  • Child processes didn’t inherit PER_LINUX32

This patch for 2.6.12-rc1-mm4 fixes both issues:

$ uname -m
$ linux32 uname -m
$ linux32 sh -c "uname -m"

Without the patch all three commands return ‘ppc64’.

This article Jürgen Kreileder is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.

Comments are closed.