Package: arch-test
Version: 0.22-1.1
Tags: patch, bullseye, bookworm, trixie, forky, duke, sid, experimental
Control: found -1 0.20-1
Control: found -1 0.22-1
Control: found -1 0.22-1.1

Running arch-test doesn't list powerpcspe, though Qemu can support it. Running the helper directly shows:

$ /usr/lib/arch-test/powerpcspe
qemu: uncaught target signal 4 (Illegal instruction) - core dumped
Illegal instruction (core dumped)

QEMU_CPU=e500v2 needs to be passed.

$ QEMU_CPU=e500v2 arch-test powerpcspe
works correctly.

Patch attached and MR pending
https://github.com/kilobyte/arch-test/pull/16

From e03ddff37e0e76f238b9beb26f391e27d79a3315 Mon Sep 17 00:00:00 2001
From: Ken Sharp <[email protected]>
Date: Mon, 15 Jun 2026 23:09:14 +0100
Subject: [PATCH] arch-test: special handling for powerpcspe

binfmt cannot distinguish between powerpc and powerpcspe, and Qemu sends a SIGILL.

The only way to fix this is to send the QEMU_CPU environment variable.
---
 arch-test | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/arch-test b/arch-test
index 844e0b2..8d1867d 100755
--- a/arch-test
+++ b/arch-test
@@ -56,9 +56,14 @@ if [ $# -eq 1 ]
         HELPER_F="$(basename $HELPERS$1)"
         cp -p "$HELPERS$1" "$CHROOT/$HELPER_F"
         trap "rm '$CHROOT/$HELPER_F'" 0
-        MSG=`chroot "$CHROOT" /"$HELPER_F" 2>/dev/null`
-      else
-        MSG=`$HELPERS$1 2>/dev/null`
+		if [ "${1}" = 'powerpcspe' ]
+          then MSG=$( chroot "${CHROOT}" sh -c "QEMU_CPU='e500v2' /"$HELPER_F"" 2>/dev/null )
+		  else MSG=$( chroot "${CHROOT}" /"${HELPER_F}" 2>/dev/null )
+		fi
+      elif [ "${1}" = 'powerpcspe' ]; then
+	    MSG=$( QEMU_CPU='e500v2' "${HELPERS}${1}" 2>/dev/null )
+	  else
+        MSG=$( "${HELPERS}${1}" 2>/dev/null )
     fi
     if [ $? -eq 0 -a "x$MSG" = "xok" ]
       then echo "$1: ok"; exit 0
@@ -70,7 +75,10 @@ for x in $HELPERS*
   do
     ARCH="$(basename "$x")"
     ARCH="${ARCH##arch-test-}"
-    MSG=`"$x" 2>/dev/null|tr -d '\r'`
+	if [ "${ARCH}" = 'powerpcspe' ]
+	  then MSG=$( QEMU_CPU='e500v2' "${x}" 2>/dev/null | tr -d '\r' )
+      else MSG=$( "${x}" 2>/dev/null | tr -d '\r' )
+	fi
     if [ $? -eq 0 -a "x$MSG" = "xok" ]
       then echo "$ARCH"
     fi
--
2.43.0

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

Reply via email to