Bug#1133121: mesa-amber does not work on PowerPC - fix added

Jeroen Diederen <[email protected]> Fri, 10 Apr 2026 12:04:25 +0700
Newsgroups gmane.linux.debian.ports.powerpc
Message-ID <177579746562.92398.14468131163800821298.reportbug__22471.7034887121$1775797649$gmane$org@2405-9800-b910.44.pool1.cmbp-mser02.myaisfibre.com>
Package: mesa-amber
Version: 21.3.9-2
Severity: important
Tags: patch
X-Debbugs-Cc: [email protected], [email protected]




-- System Information:
Debian Release: trixie/sid
  APT prefers noble-updates
  APT policy: (500, 'noble-updates'), (500, 'noble-security'), (500, 'noble'), (100, 'noble-backports')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.8.0-107-generic (SMP w/8 CPU threads; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Mesa-amber does not build on PowerPC and other arches and a bug report with a fix has been sent (https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1132854).
The following patch not only fixes the build problem but also the usability of mesa-amber on PowerPC. 

Mesa-amber at present cannot co-exist with mainline mesa, that is one problem. Mesa-amber can now co-exist with mainline mesa by changing the debian/control file and by changing meson_options.txt.

Another problem is that in meson.build, there are no entries for ppc/ppc64. This has been fixed.
 
Please take note that most of this work was done by Alexis Lavie ([email protected]). Alex and I worked together to get mesa-amber working on PowerPC.

Best regards,
Jeroen Diederen
mesa-amber-21.3.9_ppc-2.patch (text/plain, 3.5 KB)
diff --git a/debian/changelog b/debian/changelog
index 77315bdbfc5..381be8d5bfb 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,10 +1,23 @@
-mesa-amber (1:21.3.9-2) UNRELEASED; urgency=medium
+mesa-amber (1:21.3.9-2-patched) UNRELEASED; urgency=medium
 
+  [ Jeroen Diederen [email protected]] [Alexis Lavie [email protected]]
+  * /src/gtest/src/gtest-death-test.cc: added #include <cstdint> 
+  * changed control: fix libglapi-mesa
+  * meson.build: added support for powerpc, ppc64
+  * meson_options.txt: made amber coexist with Mesa >= 22.0
+
+
+ -- Jeroen Diederen <[email protected]>  Wed, 08 Apr 2026 09:55:37 +0700
+
+mesa-amber (1:21.3.9-2) unstable; urgency=medium
+
+  [ Timo Aaltonen ]
   * Build libglapi-amber, since mesa dropped the libglapi package.
   * Build libosmesa, as mesa dropped it in 25.1, and bump the epoch.
   * copyright: Updated.
   * control: Migrate to pkgconf.
 
+
  -- Timo Aaltonen <[email protected]>  Fri, 08 Aug 2025 10:51:20 +0300
 
 mesa-amber (21.3.9-1) unstable; urgency=medium
diff --git a/debian/control b/debian/control
index 3062d24159e..c98d7ae2269 100644
--- a/debian/control
+++ b/debian/control
@@ -108,7 +108,6 @@ Depends:
  ${misc:Depends},
 Pre-Depends: ${misc:Pre-Depends}
 Multi-Arch: same
-Breaks: libglapi-mesa
 Provides: libglapi-mesa
 Replaces: libglapi-mesa
 Description: free implementation of the GL API -- shared library
diff --git a/meson.build b/meson.build
index 07c77e17a65..fd682b373fc 100644
--- a/meson.build
+++ b/meson.build
@@ -181,9 +181,11 @@ system_has_kms_drm = ['openbsd', 'netbsd', 'freebsd', 'gnu/kfreebsd', 'dragonfly
 dri_drivers = get_option('dri-drivers')
 if dri_drivers.contains('auto')
   if system_has_kms_drm
-    # TODO: PPC, Sparc
+    # TODO: Sparc
     if ['x86', 'x86_64'].contains(host_machine.cpu_family())
       dri_drivers = ['i915', 'i965', 'r100', 'r200', 'nouveau']
+    elif ['ppc', 'ppc64'].contains(host_machine.cpu_family())
+      dri_drivers = ['r100', 'r200', 'nouveau']
     elif ['arm', 'aarch64'].contains(host_machine.cpu_family())
       dri_drivers = []
     elif ['mips', 'mips64', 'riscv32', 'riscv64'].contains(host_machine.cpu_family())
@@ -214,12 +216,16 @@ if gallium_drivers.contains('auto')
   if amber
     gallium_drivers = []
   elif system_has_kms_drm
-    # TODO: PPC, Sparc
+    # TODO: Sparc
     if ['x86', 'x86_64'].contains(host_machine.cpu_family())
       gallium_drivers = [
         'r300', 'r600', 'radeonsi', 'nouveau', 'virgl', 'svga', 'swrast',
         'iris', 'crocus'
       ]
+    elif ['ppc', 'ppc64'].contains(host_machine.cpu_family())
+      gallium_drivers = [
+        'r300', 'r600', 'radeonsi', 'nouveau', 'virgl', 'swrast', 'zink'
+      ]
     elif ['arm', 'aarch64'].contains(host_machine.cpu_family())
       gallium_drivers = [
         'v3d', 'vc4', 'freedreno', 'etnaviv', 'nouveau',
diff --git a/meson_options.txt b/meson_options.txt
index 6889646594f..4c61e12969e 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -536,6 +536,6 @@ option(
 option(
   'amber',
   type : 'boolean',
-  value : false,
+  value : true,
   description : 'Configure LTS build to coexist with Mesa >= 22.0'
 )
diff --git a/src/gtest/src/gtest-death-test.cc b/src/gtest/src/gtest-death-test.cc
index da09a1cfc23..d13e2399911 100644
--- a/src/gtest/src/gtest-death-test.cc
+++ b/src/gtest/src/gtest-death-test.cc
@@ -46,6 +46,7 @@
 # include <errno.h>
 # include <fcntl.h>
 # include <limits.h>
+# include <cstdint>
 
 # if GTEST_OS_LINUX
 #  include <signal.h>
mesa-amber-21.3.9_ppc-2.patch (text/plain, 3.5 KB)
diff --git a/debian/changelog b/debian/changelog
index 77315bdbfc5..381be8d5bfb 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,10 +1,23 @@
-mesa-amber (1:21.3.9-2) UNRELEASED; urgency=medium
+mesa-amber (1:21.3.9-2-patched) UNRELEASED; urgency=medium
 
+  [ Jeroen Diederen [email protected]] [Alexis Lavie [email protected]]
+  * /src/gtest/src/gtest-death-test.cc: added #include <cstdint> 
+  * changed control: fix libglapi-mesa
+  * meson.build: added support for powerpc, ppc64
+  * meson_options.txt: made amber coexist with Mesa >= 22.0
+
+
+ -- Jeroen Diederen <[email protected]>  Wed, 08 Apr 2026 09:55:37 +0700
+
+mesa-amber (1:21.3.9-2) unstable; urgency=medium
+
+  [ Timo Aaltonen ]
   * Build libglapi-amber, since mesa dropped the libglapi package.
   * Build libosmesa, as mesa dropped it in 25.1, and bump the epoch.
   * copyright: Updated.
   * control: Migrate to pkgconf.
 
+
  -- Timo Aaltonen <[email protected]>  Fri, 08 Aug 2025 10:51:20 +0300
 
 mesa-amber (21.3.9-1) unstable; urgency=medium
diff --git a/debian/control b/debian/control
index 3062d24159e..c98d7ae2269 100644
--- a/debian/control
+++ b/debian/control
@@ -108,7 +108,6 @@ Depends:
  ${misc:Depends},
 Pre-Depends: ${misc:Pre-Depends}
 Multi-Arch: same
-Breaks: libglapi-mesa
 Provides: libglapi-mesa
 Replaces: libglapi-mesa
 Description: free implementation of the GL API -- shared library
diff --git a/meson.build b/meson.build
index 07c77e17a65..fd682b373fc 100644
--- a/meson.build
+++ b/meson.build
@@ -181,9 +181,11 @@ system_has_kms_drm = ['openbsd', 'netbsd', 'freebsd', 'gnu/kfreebsd', 'dragonfly
 dri_drivers = get_option('dri-drivers')
 if dri_drivers.contains('auto')
   if system_has_kms_drm
-    # TODO: PPC, Sparc
+    # TODO: Sparc
     if ['x86', 'x86_64'].contains(host_machine.cpu_family())
       dri_drivers = ['i915', 'i965', 'r100', 'r200', 'nouveau']
+    elif ['ppc', 'ppc64'].contains(host_machine.cpu_family())
+      dri_drivers = ['r100', 'r200', 'nouveau']
     elif ['arm', 'aarch64'].contains(host_machine.cpu_family())
       dri_drivers = []
     elif ['mips', 'mips64', 'riscv32', 'riscv64'].contains(host_machine.cpu_family())
@@ -214,12 +216,16 @@ if gallium_drivers.contains('auto')
   if amber
     gallium_drivers = []
   elif system_has_kms_drm
-    # TODO: PPC, Sparc
+    # TODO: Sparc
     if ['x86', 'x86_64'].contains(host_machine.cpu_family())
       gallium_drivers = [
         'r300', 'r600', 'radeonsi', 'nouveau', 'virgl', 'svga', 'swrast',
         'iris', 'crocus'
       ]
+    elif ['ppc', 'ppc64'].contains(host_machine.cpu_family())
+      gallium_drivers = [
+        'r300', 'r600', 'radeonsi', 'nouveau', 'virgl', 'swrast', 'zink'
+      ]
     elif ['arm', 'aarch64'].contains(host_machine.cpu_family())
       gallium_drivers = [
         'v3d', 'vc4', 'freedreno', 'etnaviv', 'nouveau',
diff --git a/meson_options.txt b/meson_options.txt
index 6889646594f..4c61e12969e 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -536,6 +536,6 @@ option(
 option(
   'amber',
   type : 'boolean',
-  value : false,
+  value : true,
   description : 'Configure LTS build to coexist with Mesa >= 22.0'
 )
diff --git a/src/gtest/src/gtest-death-test.cc b/src/gtest/src/gtest-death-test.cc
index da09a1cfc23..d13e2399911 100644
--- a/src/gtest/src/gtest-death-test.cc
+++ b/src/gtest/src/gtest-death-test.cc
@@ -46,6 +46,7 @@
 # include <errno.h>
 # include <fcntl.h>
 # include <limits.h>
+# include <cstdint>
 
 # if GTEST_OS_LINUX
 #  include <signal.h>