Hi,

RetroArch is broken in the current macppc bulk:

> libretro-common/features/features_cpu.c:44:10: fatal error:
> 'ppu_intrinsics.h' file not found

The macppc fix i used with gcc is to blame. Meanwhile FreeBSD folks
came with a better solution [0], fixing the build on macppc [1].

The runtime is fine on macppc and amd64 (tested with mgba libretro)

Comments/feedback are welcome,

Charlène.


[0] https://github.com/libretro/RetroArch/pull/10383
[1] https://bin.charlenew.xyz/retroarch.clock.log


Index: Makefile
===================================================================
RCS file: /cvs/ports/emulators/retroarch/Makefile,v
retrieving revision 1.18
diff -u -p -u -p -r1.18 Makefile
--- Makefile    12 Jul 2019 20:46:09 -0000      1.18
+++ Makefile    26 Apr 2020 12:05:22 -0000
@@ -5,7 +5,7 @@ COMMENT =               generic multi-emulator fronte
 V =                    1.7.6
 DISTNAME =             RetroArch-$V
 PKGNAME =              retroarch-$V
-REVISION =             1
+REVISION =             2
 
 CATEGORIES =           emulators
 
Index: patches/patch-libretro-common_features_features_cpu_c
===================================================================
RCS file: 
/cvs/ports/emulators/retroarch/patches/patch-libretro-common_features_features_cpu_c,v
retrieving revision 1.2
diff -u -p -u -p -r1.2 patch-libretro-common_features_features_cpu_c
--- patches/patch-libretro-common_features_features_cpu_c       12 Apr 2020 
04:34:19 -0000      1.2
+++ patches/patch-libretro-common_features_features_cpu_c       26 Apr 2020 
12:05:22 -0000
@@ -1,7 +1,7 @@
 $OpenBSD: patch-libretro-common_features_features_cpu_c,v 1.2 2020/04/12 
04:34:19 bentley Exp $
 
-ppc fix for:
-features_cpu.c:(.text+0x20): undefined reference to `__mftb'
+Ensure that the undefined __mtfb() primitive is not used on powerpc, from:
+https://github.com/libretro/RetroArch/pull/10383
 
 Index: libretro-common/features/features_cpu.c
 --- libretro-common/features/features_cpu.c.orig
@@ -14,12 +14,12 @@ Index: libretro-common/features/features
  
  #if defined(_WIN32)
  #include <direct.h>
-@@ -39,7 +40,7 @@
- #include <windows.h>
- #endif
- 
--#if defined(__CELLOS_LV2__)
-+#if defined(__CELLOS_LV2__) || ( defined(__OpenBSD__) && defined(__powerpc__) 
)
- #ifndef _PPU_INTRINSICS_H
- #include <ppu_intrinsics.h>
- #endif
+@@ -166,7 +167,7 @@ retro_perf_tick_t cpu_features_get_perf_counter(void)
+    tv_sec     = (long)((ularge.QuadPart - epoch) / 10000000L);
+    tv_usec    = (long)(system_time.wMilliseconds * 1000);
+    time_ticks = (1000000 * tv_sec + tv_usec);
+-#elif defined(__linux__) || defined(__QNX__) || defined(__MACH__)
++#elif defined(_POSIX_MONOTONIC_CLOCK) || defined(__QNX__) || defined(__MACH__)
+    struct timespec tv = {0};
+    if (ra_clock_gettime(CLOCK_MONOTONIC, &tv) == 0)
+       time_ticks = (retro_perf_tick_t)tv.tv_sec * 1000000000 +

Reply via email to