Skip to content

Commit

Permalink
bowtie: fix build for powerpc
Browse files Browse the repository at this point in the history
  • Loading branch information
barracuda156 committed May 22, 2024
1 parent 7a36c62 commit 527dfc9
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
5 changes: 3 additions & 2 deletions science/bowtie/Portfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ checksums rmd160 c4aeaa1135bd40bbcbc38235878644d3b2b219da \
sha256 1e087c6bef7415419902d06b5a4f9d5180fd1daf39b3752044e6b448e46e6a1b \
size 7673131

patchfiles-append patch-Makefile.diff
patchfiles-append patch-Makefile.diff \
patch-powerpc.diff

post-patch {
reinplace -W ${worksrcpath} \
Expand All @@ -48,7 +49,7 @@ post-extract {

compiler.cxx_standard 2011

supported_archs x86_64 ppc64
supported_archs x86_64 ppc64 ppc
installs_libs no

depends_build-append port:seqan-1
Expand Down
26 changes: 26 additions & 0 deletions science/bowtie/files/patch-powerpc.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
--- Makefile
+++ Makefile 2024-05-11 06:49:40.000000000 +0800
@@ -69,6 +69,9 @@
ifeq (aarch64,$(shell uname -m))
POPCNT_CAPABILITY=0
endif
+ifeq (powerpc,$(shell uname -p))
+ POPCNT_CAPABILITY=0
+endif
ifeq (1, $(POPCNT_CAPABILITY))
override EXTRA_FLAGS += -DPOPCNT_CAPABILITY
endif

--- bt2_locks.h
+++ bt2_locks.h 2024-05-11 06:38:00.000000000 +0800
@@ -17,8 +17,8 @@
for (int32_t i = 0; i < count; i++) {
#ifdef __aarch64__
__asm__ __volatile__("yield" ::: "memory");
-#elif __ppc__
- __asm__ __volatile__("or 27,27,27" ::: "memory");
+#elif __ppc__ || __ppc64__
+ __asm__ __volatile__("or r27,r27,r27" ::: "memory");
#elif __x86_64__
__asm__ __volatile__("pause;");
#else

0 comments on commit 527dfc9

Please sign in to comment.