<pre style='margin:0'>
Herby Gillot (herbygillot) pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/a910a13fe316e9f4a3277a8766ece5590756ee92">https://github.com/macports/macports-ports/commit/a910a13fe316e9f4a3277a8766ece5590756ee92</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit a910a13fe316e9f4a3277a8766ece5590756ee92
</span>Author: Sergey Fedorov <barracuda@macos-powerpc.org>
AuthorDate: Tue Jun 4 23:14:30 2024 +0800
<span style='display:block; white-space:pre;color:#404040;'> mosh: fix PowerPC build
</span>---
net/mosh/Portfile | 2 ++
net/mosh/files/patch-fix-AltiVec.diff | 65 +++++++++++++++++++++++++++++++++++
2 files changed, 67 insertions(+)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/net/mosh/Portfile b/net/mosh/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index 9f924682a19..85b2adf1c8d 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/net/mosh/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/net/mosh/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -24,6 +24,8 @@ checksums rmd160 e5a06cbdee39cdf0259a4db08fe7919561ce52c5 \
</span>
compiler.cxx_standard 2011
<span style='display:block; white-space:pre;background:#e0ffe0;'>+patchfiles-append patch-fix-AltiVec.diff
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> perl5.require_variant yes
perl5.conflict_variants yes
perl5.branches 5.34
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/net/mosh/files/patch-fix-AltiVec.diff b/net/mosh/files/patch-fix-AltiVec.diff
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 00000000000..1f487bf2ff4
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/net/mosh/files/patch-fix-AltiVec.diff
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,65 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- src/crypto/ocb_internal.cc 2022-08-04 09:34:20.000000000 +0800
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ src/crypto/ocb_internal.cc 2024-06-04 23:09:15.000000000 +0800
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -220,12 +220,12 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #elif __ALTIVEC__ && _CALL_ELF != 2
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include <altivec.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- typedef vector unsigned block;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ typedef __vector unsigned block;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #define xor_block(x,y) vec_xor(x,y)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #define zero_block() vec_splat_u32(0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #define unequal_blocks(x,y) vec_any_ne(x,y)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #define swap_if_le(b) (b)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- #if __PPC64__
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ #if defined(__PPC64__) || defined(__ppc64__)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ static block gen_offset(uint64_t KtopStr[3], unsigned bot) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ union {uint64_t u64[2]; block bl;} rval;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ rval.u64[0] = (KtopStr[0] << bot) | (KtopStr[1] >> (64-bot));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -235,34 +235,34 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* Special handling: Shifts are mod 32, and no 64-bit types */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ static block gen_offset(uint64_t KtopStr[3], unsigned bot) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- const vector unsigned k32 = {32,32,32,32};
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- vector unsigned hi = *(vector unsigned *)(KtopStr+0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- vector unsigned lo = *(vector unsigned *)(KtopStr+2);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- vector unsigned bot_vec;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ const __vector unsigned k32 = {32,32,32,32};
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ __vector unsigned hi = *(__vector unsigned *)(KtopStr+0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ __vector unsigned lo = *(__vector unsigned *)(KtopStr+2);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ __vector unsigned bot_vec;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (bot < 32) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ lo = vec_sld(hi,lo,4);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- vector unsigned t = vec_sld(hi,lo,4);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ __vector unsigned t = vec_sld(hi,lo,4);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ lo = vec_sld(hi,lo,8);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ hi = t;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ bot = bot - 32;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (bot == 0) return hi;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ *(unsigned *)&bot_vec = bot;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- vector unsigned lshift = vec_splat(bot_vec,0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- vector unsigned rshift = vec_sub(k32,lshift);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ __vector unsigned lshift = vec_splat(bot_vec,0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ __vector unsigned rshift = vec_sub(k32,lshift);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ hi = vec_sl(hi,lshift);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ lo = vec_sr(lo,rshift);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return vec_xor(hi,lo);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ static inline block double_block(block b) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- const vector unsigned char mask = {135,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1};
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- const vector unsigned char perm = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,0};
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- const vector unsigned char shift7 = vec_splat_u8(7);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- const vector unsigned char shift1 = vec_splat_u8(1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- vector unsigned char c = (vector unsigned char)b;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- vector unsigned char t = vec_sra(c,shift7);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ const __vector unsigned char mask = {135,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1};
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ const __vector unsigned char perm = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,0};
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ const __vector unsigned char shift7 = vec_splat_u8(7);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ const __vector unsigned char shift1 = vec_splat_u8(1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ __vector unsigned char c = (__vector unsigned char)b;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ __vector unsigned char t = vec_sra(c,shift7);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ t = vec_and(t,mask);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ t = vec_perm(t,t,perm);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ c = vec_sl(c,shift1);
</span></pre><pre style='margin:0'>
</pre>