math/oink: fix build on powerpc*

/wrkdirs/usr/ports/math/oink/work/oink-c1259fe/src/lace.c:973:9: error: invalid instruction
        mfence();
        ^
/wrkdirs/usr/ports/math/oink/work/oink-c1259fe/src/lace.h:296:33: note: expanded from macro 'mfence'
                                ^
<inline asm>:1:2: note: instantiated into assembly here
        mfence
This commit is contained in:
Piotr Kubaj 2021-07-13 09:26:23 +00:00
parent 3ed820108d
commit 071c6bdd22

View file

@ -0,0 +1,14 @@
--- src/lace.h.orig 2021-07-12 11:27:04 UTC
+++ src/lace.h
@@ -293,7 +293,11 @@ void lace_yield(WorkerP *__lace_worker, Task *__lace_d
#endif
#ifndef mfence
+#ifdef __amd64__
#define mfence() { asm volatile("mfence" ::: "memory"); }
+#elif defined(__powerpc__)
+#define mfence() { asm volatile("sync" ::: "memory"); }
+#endif
#endif
/* Compiler specific branch prediction optimization */