Hi,
A few months ago, i marked agar BROKEN since it was freezing on my
machine [0]. But a very recent diff from jsg@ [1] is fixing the issue.
As such, i'm proposing again the powerpc fixes i brought then
(see [0]):
- `rlwimi' requires 32-bit integers
- add AltiVec detection for OpenBSD
The changes only impact powerpc. No REVISION bump has been added,
because it has never been built since the fourth REVISION, that
brought powerpc64 fixes.
With the below diff, agartest runs without issues on powerpc.
Comments/feedback are welcome,
Charlène.
[0] https://marc.info/?l=openbsd-ports&m=159249433106503&w=2
[1] https://marc.info/?l=openbsd-ppc&m=160484891410244&w=2
Index: Makefile.inc
===================================================================
RCS file: /cvs/ports/x11/agar/Makefile.inc,v
retrieving revision 1.3
diff -u -p -u -p -r1.3 Makefile.inc
--- Makefile.inc 22 Jun 2020 09:43:45 -0000 1.3
+++ Makefile.inc 8 Nov 2020 16:01:58 -0000
@@ -1,7 +1,5 @@
# $OpenBSD: Makefile.inc,v 1.3 2020/06/22 09:43:45 cwen Exp $
-BROKEN-powerpc = agartest causes system freezes
-
V ?= 1.5.0
DISTNAME ?= agar-$V
Index: agar/patches/patch-core_byteswap_h
===================================================================
RCS file: /cvs/ports/x11/agar/agar/patches/patch-core_byteswap_h,v
retrieving revision 1.1
diff -u -p -u -p -r1.1 patch-core_byteswap_h
--- agar/patches/patch-core_byteswap_h 1 Aug 2020 18:47:33 -0000 1.1
+++ agar/patches/patch-core_byteswap_h 8 Nov 2020 16:01:58 -0000
@@ -1,11 +1,12 @@
$OpenBSD: patch-core_byteswap_h,v 1.1 2020/08/01 18:47:33 jasper Exp $
-Extracted from https://github.com/JulNadeauCA/libagar/commit/56b3500
+Hunk #1: Fix the build on powerpc, upstream code has been totally changed
+Hunk #2: Extracted from https://github.com/JulNadeauCA/libagar/commit/56b3500
Index: core/byteswap.h
--- core/byteswap.h.orig
+++ core/byteswap.h
-@@ -33,7 +33,9 @@ AG_Swap16(Uint16 x)
+@@ -33,15 +33,17 @@ AG_Swap16(Uint16 x)
"0" (x));
return (x);
}
@@ -16,6 +17,16 @@ Index: core/byteswap.h
static __inline__ Uint16
AG_Swap16(Uint16 x)
{
+- Uint16 rv;
++ Uint32 rv;
+ __asm__("rlwimi %0,%2,8,16,23" :
+ "=&r" (rv) :
+ "0" (x >> 8), "r" (x));
+- return (rv);
++ return (Uint16) (rv);
+ }
+ #else
+ static __inline__ Uint16
@@ -72,7 +74,9 @@ AG_Swap32(Uint32 x)
"0" (x));
return (x);
Index: agar/patches/patch-core_cpuinfo_c
===================================================================
RCS file: /cvs/ports/x11/agar/agar/patches/patch-core_cpuinfo_c,v
retrieving revision 1.1
diff -u -p -u -p -r1.1 patch-core_cpuinfo_c
--- agar/patches/patch-core_cpuinfo_c 1 Aug 2020 18:47:33 -0000 1.1
+++ agar/patches/patch-core_cpuinfo_c 8 Nov 2020 16:01:58 -0000
@@ -1,6 +1,7 @@
$OpenBSD: patch-core_cpuinfo_c,v 1.1 2020/08/01 18:47:33 jasper Exp $
Extracted from https://github.com/JulNadeauCA/libagar/commit/56b3500
+Also add proper AltiVec detection on powerpc
Index: core/cpuinfo.c
--- core/cpuinfo.c.orig
@@ -16,8 +17,14 @@ Index: core/cpuinfo.c
#include <agar/core/core.h>
#if defined(__APPLE__) || defined(__MACOSX__)
-@@ -44,13 +40,6 @@
+@@ -42,15 +38,12 @@
+ # include <exec/exec.h>
+ # include <interfaces/exec.h>
# include <proto/exec.h>
++#elif defined(__OpenBSD__) && defined(__ppc__)
++# include <machine/cpu.h>
++# include <sys/types.h>
++# include <sys/sysctl.h>
No comments:
Post a Comment