# SDL: Define illegal\_instruction() when it will be actually used (33644)

**URL:** <https://discourse.libsdl.org/t/sdl-define-illegal-instruction-when-it-will-be-actually-used-33644/59613>\
**Category:** SDL Commits\
**Created:** [May 8, 2025, 8:10pm UTC](https://discourse.libsdl.org/t/sdl-define-illegal-instruction-when-it-will-be-actually-used-33644/59613 "2025-05-08T20:10:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SDLPushPostBot](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/sdlpushpostbot/32/4370_2.png) [@SDLPushPostBot](https://discourse.libsdl.org/u/SDLPushPostBot)\
**Post date:** [May 8, 2025, 8:10pm UTC](https://discourse.libsdl.org/t/sdl-define-illegal-instruction-when-it-will-be-actually-used-33644/59613/1 "2025-05-08T20:10:33Z")

</div>

> <https://github.com/libsdl-org/SDL/commit/3364486f56f42e54a7a63e34810f9c375d6bd34d>
>
> (cherry picked from commit 29d21164951e5884c98bc8d817ffeceef76b00ff)
> (cherry pic…ked from commit 2163887f2945003debde660d8112e80b18fb5800)

```diff
From 3364486f56f42e54a7a63e34810f9c375d6bd34d Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Thu, 8 May 2025 11:51:35 -0700
Subject: [PATCH] Define illegal_instruction() when it will be actually used

(cherry picked from commit 29d21164951e5884c98bc8d817ffeceef76b00ff)
(cherry picked from commit 2163887f2945003debde660d8112e80b18fb5800)
---
 src/cpuinfo/SDL_cpuinfo.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/cpuinfo/SDL_cpuinfo.c b/src/cpuinfo/SDL_cpuinfo.c
index 3075f6ab3f020..b0e31531ba38b 100644
--- a/src/cpuinfo/SDL_cpuinfo.c
+++ b/src/cpuinfo/SDL_cpuinfo.c
@@ -127,7 +127,11 @@
 #define CPU_CFG2_LSX (1 << 6)
 #define CPU_CFG2_LASX (1 << 7)
 
-#if defined(SDL_ALTIVEC_BLITTERS) && defined(HAVE_SETJMP) && !defined( __MACOSX__ ) && !defined( __OpenBSD__ ) && !defined( __FreeBSD__ ) && (defined( __LINUX__ ) && !defined(HAVE_GETAUXVAL))
+#if !defined(SDL_CPUINFO_DISABLED) && \
+ !((defined( __MACOSX__ ) && (defined( __ppc__ ) || defined( __ppc64__ ))) || (defined( __OpenBSD__ ) && defined( __powerpc__ ))) && \
+ !(defined( __FreeBSD__ ) && defined( __powerpc__ )) && \
+ !(defined( __LINUX__ ) && defined( __powerpc__ ) && defined(HAVE_GETAUXVAL)) && \
+ defined(SDL_ALTIVEC_BLITTERS) && defined(HAVE_SETJMP)
 /* This is the brute force way of detecting instruction sets...
    the idea is borrowed from the libmpeg2 library - thanks!
  */

```
