Saturday, December 23, 2023

unbreak boost for powerpc, powerpc64

devel/boost is broken on powerpc and powerpc64, because
<boost/fiber/detail/cpu_relax.hpp> picks the wrong asm syntax.
This patch fixes it, ok?

The REVISION bump conflicts with tb's "boost futex diff";
I will do REVISION= 1 if tb commits before me.
--gkoehler

Index: Makefile
===================================================================
RCS file: /cvs/ports/devel/boost/Makefile,v
retrieving revision 1.139
diff -u -p -r1.139 Makefile
--- Makefile 19 Dec 2023 06:14:25 -0000 1.139
+++ Makefile 23 Dec 2023 18:33:03 -0000
@@ -11,6 +11,7 @@ COMMENT-md= machine-dependent libraries
VERSION= 1.84.0
DISTNAME= boost_${VERSION:S/./_/g}
PKGNAME= boost-${VERSION}
+REVISION= 0
EPOCH = 0
CATEGORIES= devel
SITES= https://boostorg.jfrog.io/artifactory/main/release/${VERSION}/source/
Index: patches/patch-boost_fiber_detail_cpu_relax_hpp
===================================================================
RCS file: patches/patch-boost_fiber_detail_cpu_relax_hpp
diff -N patches/patch-boost_fiber_detail_cpu_relax_hpp
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-boost_fiber_detail_cpu_relax_hpp 23 Dec 2023 18:33:03 -0000
@@ -0,0 +1,15 @@
+Fix powerpc and powerpc64, where clang defines __POWERPC__ but rejects
+Darwin's "r27" syntax with "error: invalid operand for instruction".
+
+Index: boost/fiber/detail/cpu_relax.hpp
+--- boost/fiber/detail/cpu_relax.hpp.orig
++++ boost/fiber/detail/cpu_relax.hpp
+@@ -59,7 +59,7 @@ namespace detail {
+ // processors
+ // extended mnemonics (available with POWER7)
+ // yield == or 27, 27, 27
+-# if defined(__POWERPC__) // Darwin PPC
++# if defined(__APPLE__) // Darwin PPC
+ # define cpu_relax() asm volatile ("or r27,r27,r27" ::: "memory");
+ # else
+ # define cpu_relax() asm volatile ("or 27,27,27" ::: "memory");

No comments:

Post a Comment