diff --git a/emulators/pcsx2/Makefile b/emulators/pcsx2/Makefile index ee09f40b5634..a9c78013c9a4 100644 --- a/emulators/pcsx2/Makefile +++ b/emulators/pcsx2/Makefile @@ -46,6 +46,16 @@ USE_SDL= sdl2 USE_XORG= ice x11 xcb xext xpm xrandr USE_QT= base tools +# SSE 4.1 instructions are a hard requirement, if CPUTYPE is defined +# use whatever is set and let the build fail if it fails below +# baseline requirements. If it's undefined set penryn as target +# as it's the oldest CPU arch that supports SSE 4.1 +.if defined(CPUTYPE) +EXTRA_PATCHES= ${PATCHDIR}/extra-patch-no-march-native +.else +EXTRA_PATCHES= ${PATCHDIR}/extra-patch-no-march-minimum-req +.endif + # See: cmake/BuildParameters.cmake CMAKE_ARGS+= \ -DCMAKE_REQUIRED_INCLUDES:STRING=${LOCALBASE}/include/ \ diff --git a/emulators/pcsx2/files/extra-patch-no-march-minimum-req b/emulators/pcsx2/files/extra-patch-no-march-minimum-req new file mode 100644 index 000000000000..1cc08427ac82 --- /dev/null +++ b/emulators/pcsx2/files/extra-patch-no-march-minimum-req @@ -0,0 +1,13 @@ +Allow relocation of resource files + +--- cmake/BuildParameters.cmake.orig 2023-06-25 15:34:40 UTC ++++ cmake/BuildParameters.cmake +@@ -120,7 +120,7 @@ if(${PCSX2_TARGET_ARCHITECTURES} MATCHES "x86_64") + endif() + else() + #set(ARCH_FLAG "-march=native -fabi-version=6") +- set(ARCH_FLAG "-march=native") ++ set(ARCH_FLAG "-march=penryn") + endif() + endif() + list(APPEND PCSX2_DEFS _ARCH_64=1 _M_X86=1) diff --git a/emulators/pcsx2/files/extra-patch-no-march-native b/emulators/pcsx2/files/extra-patch-no-march-native new file mode 100644 index 000000000000..2a9f598e6640 --- /dev/null +++ b/emulators/pcsx2/files/extra-patch-no-march-native @@ -0,0 +1,13 @@ +Allow relocation of resource files + +--- cmake/BuildParameters.cmake.orig 2023-06-25 15:34:40 UTC ++++ cmake/BuildParameters.cmake +@@ -120,7 +120,7 @@ if(${PCSX2_TARGET_ARCHITECTURES} MATCHES "x86_64") + endif() + else() + #set(ARCH_FLAG "-march=native -fabi-version=6") +- set(ARCH_FLAG "-march=native") ++ #set(ARCH_FLAG "-march=native") + endif() + endif() + list(APPEND PCSX2_DEFS _ARCH_64=1 _M_X86=1)