From: Stefano Rivera <stefanor@debian.org>
Date: Thu, 3 Dec 2026 23:02:43 -0400
Subject: Add support for more architectures to to vmprof_config

This should cover all the architectures currently supported in Debian and
Debian ports.

We aren't using vmprof on any of these archs, but a valid macro still
seems to be required.

Forwarded: https://github.com/pypy/pypy/pull/5858
---
 rpython/rlib/rvmprof/src/shared/vmprof_config.h | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/rpython/rlib/rvmprof/src/shared/vmprof_config.h b/rpython/rlib/rvmprof/src/shared/vmprof_config.h
index 35d2727..66a76ad 100644
--- a/rpython/rlib/rvmprof/src/shared/vmprof_config.h
+++ b/rpython/rlib/rvmprof/src/shared/vmprof_config.h
@@ -34,6 +34,20 @@
   #define PC_FROM_UCONTEXT uc_mcontext.gp_regs[PT_NIP]
 #elif defined(__riscv)
   #define PC_FROM_UCONTEXT uc_mcontext.__gregs[REG_PC]
+#elif defined(__alpha__)
+  #define PC_FROM_UCONTEXT uc_mcontext.sc_pc
+#elif defined(__hppa__)
+  #define PC_FROM_UCONTEXT uc_mcontext.sc_iaoq[0]
+#elif defined(__loongarch__)
+  #define PC_FROM_UCONTEXT uc_mcontext.__pc
+#elif defined(__m68k__)
+  #define PC_FROM_UCONTEXT uc_mcontext.gregs[R_PC]
+#elif defined(__powerpc__)
+  #define PC_FROM_UCONTEXT uc_mcontext.uc_regs->gregs[PT_NIP]
+#elif defined(__sh__)
+  #define PC_FROM_UCONTEXT uc_mcontext.mc_gregs[MC_PC]
+#elif defined(__sparc__)
+  #define PC_FROM_UCONTEXT uc_mcontext.pc
 #else
   /* linux, gnuc */
   #define PC_FROM_UCONTEXT uc_mcontext.gregs[REG_RIP]
