mobile-shell / mosh

Mobile Shell
https://mosh.org
GNU General Public License v3.0
12.56k stars 730 forks source link

Altivec code in `crypto/ocb_internal.cc` fails to compile, needs to use `__vector` instead of `vector` #1321

Open barracuda156 opened 3 months ago

barracuda156 commented 3 months ago

Code in ocb_internal.cc is broken and fails to compile:

ocb_internal.cc:223:13: error: 'vector' does not name a type; did you mean 'vec_or'?
  223 |     typedef vector unsigned block;
      |             ^~~~~~
      |             vec_or
ocb_internal.cc:237:16: error: 'block' does not name a type
  237 |         static block gen_offset(uint64_t KtopStr[3], unsigned bot) {
      |                ^~~~~
ocb_internal.cc:259:23: error: 'block' does not name a type
  259 |         static inline block double_block(block b) {
      |                       ^~~~~
ocb_internal.cc:456:13: error: variable or field 'ecb_encrypt_blks' declared void
  456 | static void ecb_encrypt_blks(block *blks, unsigned nblks, KEY *key) {
      |             ^~~~~~~~~~~~~~~~
ocb_internal.cc:456:30: error: 'block' was not declared in this scope; did you mean 'clock'?
  456 | static void ecb_encrypt_blks(block *blks, unsigned nblks, KEY *key) {
      |                              ^~~~~
      |                              clock
ocb_internal.cc:456:37: error: 'blks' was not declared in this scope
  456 | static void ecb_encrypt_blks(block *blks, unsigned nblks, KEY *key) {
      |                                     ^~~~
ocb_internal.cc:456:43: error: expected primary-expression before 'unsigned'
  456 | static void ecb_encrypt_blks(block *blks, unsigned nblks, KEY *key) {
      |                                           ^~~~~~~~
ocb_internal.cc:456:63: error: expected primary-expression before '*' token
  456 | static void ecb_encrypt_blks(block *blks, unsigned nblks, KEY *key) {
      |                                                               ^
ocb_internal.cc:456:64: error: 'key' was not declared in this scope
  456 | static void ecb_encrypt_blks(block *blks, unsigned nblks, KEY *key) {
      |                                                                ^~~
ocb_internal.cc:463:13: error: variable or field 'ecb_decrypt_blks' declared void
  463 | static void ecb_decrypt_blks(block *blks, unsigned nblks, KEY *key) {
      |             ^~~~~~~~~~~~~~~~
ocb_internal.cc:463:30: error: 'block' was not declared in this scope; did you mean 'clock'?
  463 | static void ecb_decrypt_blks(block *blks, unsigned nblks, KEY *key) {
      |                              ^~~~~
      |                              clock
ocb_internal.cc:463:37: error: 'blks' was not declared in this scope
  463 | static void ecb_decrypt_blks(block *blks, unsigned nblks, KEY *key) {
      |                                     ^~~~
ocb_internal.cc:463:43: error: expected primary-expression before 'unsigned'
  463 | static void ecb_decrypt_blks(block *blks, unsigned nblks, KEY *key) {
      |                                           ^~~~~~~~
ocb_internal.cc:463:63: error: expected primary-expression before '*' token
  463 | static void ecb_decrypt_blks(block *blks, unsigned nblks, KEY *key) {
      |                                                               ^
ocb_internal.cc:463:64: error: 'key' was not declared in this scope
  463 | static void ecb_decrypt_blks(block *blks, unsigned nblks, KEY *key) {
      |                                                                ^~~
ocb_internal.cc:625:5: error: 'block' does not name a type
  625 |     block offset;                          /* Memory correct               */
      |     ^~~~~
ocb_internal.cc:626:5: error: 'block' does not name a type
  626 |     block checksum;                        /* Memory correct               */
      |     ^~~~~
ocb_internal.cc:627:5: error: 'block' does not name a type
  627 |     block Lstar;                           /* Memory correct               */
      |     ^~~~~
ocb_internal.cc:628:5: error: 'block' does not name a type
  628 |     block Ldollar;                         /* Memory correct               */
      |     ^~~~~
ocb_internal.cc:629:5: error: 'block' does not name a type
  629 |     block L[L_TABLE_SZ];                   /* Memory correct               */
      |     ^~~~~
ocb_internal.cc:630:5: error: 'block' does not name a type
  630 |     block ad_checksum;                     /* Memory correct               */
      |     ^~~~~
ocb_internal.cc:631:5: error: 'block' does not name a type
  631 |     block ad_offset;                       /* Memory correct               */
      |     ^~~~~
ocb_internal.cc:632:5: error: 'block' does not name a type
  632 |     block cached_Top;                      /* Memory correct               */
      |     ^~~~~
ocb_internal.cc: In function 'int ae_init(ae_ctx*, const void*, int, int, int)':
ocb_internal.cc:692:5: error: 'block' was not declared in this scope; did you mean 'clock'?
  692 |     block tmp_blk;
      |     ^~~~~
      |     clock
ocb_internal.cc:708:10: error: 'ae_ctx' {aka 'struct _ae_ctx'} has no member named 'cached_Top'
  708 |     ctx->cached_Top = ctx->ad_checksum = zero_block();
      |          ^~~~~~~~~~
ocb_internal.cc:708:28: error: 'ae_ctx' {aka 'struct _ae_ctx'} has no member named 'ad_checksum'
  708 |     ctx->cached_Top = ctx->ad_checksum = zero_block();
      |                            ^~~~~~~~~~~
ocb_internal.cc:712:62: error: 'ae_ctx' {aka 'struct _ae_ctx'} has no member named 'cached_Top'
  712 |     ocb_aes::encrypt(reinterpret_cast<unsigned char *>(&ctx->cached_Top),
      |                                                              ^~~~~~~~~~
ocb_internal.cc:713:69: error: 'ae_ctx' {aka 'struct _ae_ctx'} has no member named 'Lstar'
  713 |                             reinterpret_cast<unsigned char *>(&ctx->Lstar), ctx->encrypt_key);
      |                                                                     ^~~~~
ocb_internal.cc:714:5: error: 'tmp_blk' was not declared in this scope
  714 |     tmp_blk = swap_if_le(ctx->Lstar);
      |     ^~~~~~~
ocb_internal.cc:714:31: error: 'ae_ctx' {aka 'struct _ae_ctx'} has no member named 'Lstar'
  714 |     tmp_blk = swap_if_le(ctx->Lstar);
      |                               ^~~~~
ocb_internal.cc:227:37: note: in definition of macro 'swap_if_le'
  227 |     #define swap_if_le(b)          (b)
      |                                     ^
ocb_internal.cc:715:15: error: 'double_block' was not declared in this scope
  715 |     tmp_blk = double_block(tmp_blk);
      |               ^~~~~~~~~~~~
ocb_internal.cc:716:10: error: 'ae_ctx' {aka 'struct _ae_ctx'} has no member named 'Ldollar'
  716 |     ctx->Ldollar = swap_if_le(tmp_blk);
      |          ^~~~~~~
ocb_internal.cc:718:10: error: 'ae_ctx' {aka 'struct _ae_ctx'} has no member named 'L'
  718 |     ctx->L[0] = swap_if_le(tmp_blk);
      |          ^
ocb_internal.cc:721:14: error: 'ae_ctx' {aka 'struct _ae_ctx'} has no member named 'L'
  721 |         ctx->L[i] = swap_if_le(tmp_blk);
      |              ^
ocb_internal.cc: At global scope:
ocb_internal.cc:735:8: error: 'block' does not name a type
  735 | static block gen_offset_from_nonce(ae_ctx *ctx, const void *nonce)
      |        ^~~~~
ocb_internal.cc: In function 'void process_ad(ae_ctx*, const void*, int, int)':
ocb_internal.cc:763:50: error: 'block' does not name a type
  763 |         union { uint32_t u32[4]; uint8_t u8[16]; block bl; } tmp;
      |                                                  ^~~~~
ocb_internal.cc:764:5: error: 'block' was not declared in this scope; did you mean 'clock'?
  764 |     block ad_offset, ad_checksum;
      |     ^~~~~
      |     clock
ocb_internal.cc:765:11: error: 'block' does not name a type
  765 |     const block *  adp = (block *)ad;
      |           ^~~~~
ocb_internal.cc:768:5: error: 'ad_offset' was not declared in this scope
  768 |     ad_offset = ctx->ad_offset;
      |     ^~~~~~~~~
ocb_internal.cc:768:22: error: 'ae_ctx' {aka 'struct _ae_ctx'} has no member named 'ad_offset'
  768 |     ad_offset = ctx->ad_offset;
      |                      ^~~~~~~~~
ocb_internal.cc:769:5: error: 'ad_checksum' was not declared in this scope
  769 |     ad_checksum = ctx->ad_checksum;
      |     ^~~~~~~~~~~
ocb_internal.cc:769:24: error: 'ae_ctx' {aka 'struct _ae_ctx'} has no member named 'ad_checksum'
  769 |     ad_checksum = ctx->ad_checksum;
      |                        ^~~~~~~~~~~
ocb_internal.cc:774:30: error: expected ';' before 'ta'
  774 |                         block ta[BPI], oa[BPI];
      |                              ^~~
      |                              ;
ocb_internal.cc:777:25: error: 'oa' was not declared in this scope
  777 |                         oa[0] = xor_block(ad_offset, ctx->L[0]);
      |                         ^~
ocb_internal.cc:777:59: error: 'ae_ctx' {aka 'struct _ae_ctx'} has no member named 'L'
  777 |                         oa[0] = xor_block(ad_offset, ctx->L[0]);
      |                                                           ^
ocb_internal.cc:224:46: note: in definition of macro 'xor_block'
  224 |     #define xor_block(x,y)         vec_xor(x,y)
      |                                              ^
ocb_internal.cc:778:25: error: 'ta' was not declared in this scope; did you mean 'tz'?
  778 |                         ta[0] = xor_block(oa[0], adp[0]);
      |                         ^~
      |                         tz
ocb_internal.cc:778:50: error: 'adp' was not declared in this scope; did you mean 'ad'?
  778 |                         ta[0] = xor_block(oa[0], adp[0]);
      |                                                  ^~~
ocb_internal.cc:224:46: note: in definition of macro 'xor_block'
  224 |     #define xor_block(x,y)         vec_xor(x,y)
      |                                              ^
ocb_internal.cc:779:55: error: 'ae_ctx' {aka 'struct _ae_ctx'} has no member named 'L'
  779 |                         oa[1] = xor_block(oa[0], ctx->L[1]);
      |                                                       ^
ocb_internal.cc:224:46: note: in definition of macro 'xor_block'
  224 |     #define xor_block(x,y)         vec_xor(x,y)
      |                                              ^
ocb_internal.cc:781:59: error: 'ae_ctx' {aka 'struct _ae_ctx'} has no member named 'L'
  781 |                         oa[2] = xor_block(ad_offset, ctx->L[1]);
      |                                                           ^
ocb_internal.cc:224:46: note: in definition of macro 'xor_block'
  224 |     #define xor_block(x,y)         vec_xor(x,y)
      |                                              ^
ocb_internal.cc:648:34: error: 'ae_ctx' {aka 'struct _ae_ctx'} has no member named 'L'
  648 | #define getL(_ctx, _tz) ((_ctx)->L[_tz])
      |                                  ^
ocb_internal.cc:224:46: note: in definition of macro 'xor_block'
  224 |     #define xor_block(x,y)         vec_xor(x,y)
      |                                              ^
ocb_internal.cc:784:62: note: in expansion of macro 'getL'
  784 |                                 ad_offset = xor_block(oa[2], getL(ctx, tz));
      |                                                              ^~~~
ocb_internal.cc:798:34: error: 'ecb_encrypt_blks' is not a member of 'ocb_aes'
  798 |                         ocb_aes::ecb_encrypt_blks(ta, BPI, ctx->encrypt_key);
      |                                  ^~~~~~~~~~~~~~~~
ocb_internal.cc:812:22: error: 'ae_ctx' {aka 'struct _ae_ctx'} has no member named 'ad_offset'
  812 |                 ctx->ad_offset = ad_offset;
      |                      ^~~~~~~~~
ocb_internal.cc:813:22: error: 'ae_ctx' {aka 'struct _ae_ctx'} has no member named 'ad_checksum'
  813 |                 ctx->ad_checksum = ad_checksum;
      |                      ^~~~~~~~~~~
ocb_internal.cc:817:22: error: expected ';' before 'ta'
  817 |                 block ta[BPI];
      |                      ^~~
      |                      ;
ocb_internal.cc:838:71: error: 'ae_ctx' {aka 'struct _ae_ctx'} has no member named 'L'
  838 |                                 ad_offset = xor_block(ad_offset, ctx->L[0]);
      |                                                                       ^
ocb_internal.cc:224:46: note: in definition of macro 'xor_block'
  224 |     #define xor_block(x,y)         vec_xor(x,y)
      |                                              ^
ocb_internal.cc:839:33: error: 'ta' was not declared in this scope; did you mean 'tz'?
  839 |                                 ta[k] = xor_block(ad_offset, adp[k]);
      |                                 ^~
      |                                 tz
ocb_internal.cc:839:62: error: 'adp' was not declared in this scope; did you mean 'ad'?
  839 |                                 ta[k] = xor_block(ad_offset, adp[k]);
      |                                                              ^~~
ocb_internal.cc:224:46: note: in definition of macro 'xor_block'
  224 |     #define xor_block(x,y)         vec_xor(x,y)
      |                                              ^
ocb_internal.cc:648:34: error: 'ae_ctx' {aka 'struct _ae_ctx'} has no member named 'L'
  648 | #define getL(_ctx, _tz) ((_ctx)->L[_tz])
      |                                  ^
ocb_internal.cc:224:46: note: in definition of macro 'xor_block'
  224 |     #define xor_block(x,y)         vec_xor(x,y)
      |                                              ^
ocb_internal.cc:840:66: note: in expansion of macro 'getL'
  840 |                                 ad_offset = xor_block(ad_offset, getL(ctx, ntz(k+2)));
      |                                                                  ^~~~
ocb_internal.cc:846:71: error: 'ae_ctx' {aka 'struct _ae_ctx'} has no member named 'L'
  846 |                                 ad_offset = xor_block(ad_offset, ctx->L[0]);
      |                                                                       ^
ocb_internal.cc:224:46: note: in definition of macro 'xor_block'
  224 |     #define xor_block(x,y)         vec_xor(x,y)
      |                                              ^
ocb_internal.cc:847:33: error: 'ta' was not declared in this scope; did you mean 'tz'?
  847 |                                 ta[k] = xor_block(ad_offset, adp[k]);
      |                                 ^~
      |                                 tz
ocb_internal.cc:847:62: error: 'adp' was not declared in this scope; did you mean 'ad'?
  847 |                                 ta[k] = xor_block(ad_offset, adp[k]);
      |                                                              ^~~
ocb_internal.cc:224:46: note: in definition of macro 'xor_block'
  224 |     #define xor_block(x,y)         vec_xor(x,y)
      |                                              ^
ocb_internal.cc:852:70: error: 'ae_ctx' {aka 'struct _ae_ctx'} has no member named 'Lstar'
  852 |                                 ad_offset = xor_block(ad_offset,ctx->Lstar);
      |                                                                      ^~~~~
ocb_internal.cc:224:46: note: in definition of macro 'xor_block'
  224 |     #define xor_block(x,y)         vec_xor(x,y)
      |                                              ^
ocb_internal.cc:853:37: error: 'union process_ad(ae_ctx*, const void*, int, int)::<unnamed>' has no member named 'bl'
  853 |                                 tmp.bl = zero_block();
      |                                     ^~
ocb_internal.cc:854:48: error: 'adp' was not declared in this scope; did you mean 'ad'?
  854 |                                 memcpy(tmp.u8, adp+k, remaining);
      |                                                ^~~
      |                                                ad
ocb_internal.cc:856:33: error: 'ta' was not declared in this scope; did you mean 'tz'?
  856 |                                 ta[k] = xor_block(ad_offset, tmp.bl);
      |                                 ^~
      |                                 tz
ocb_internal.cc:856:66: error: 'union process_ad(ae_ctx*, const void*, int, int)::<unnamed>' has no member named 'bl'
  856 |                                 ta[k] = xor_block(ad_offset, tmp.bl);
      |                                                                  ^~
ocb_internal.cc:224:46: note: in definition of macro 'xor_block'
  224 |     #define xor_block(x,y)         vec_xor(x,y)
      |                                              ^
ocb_internal.cc:859:34: error: 'ecb_encrypt_blks' is not a member of 'ocb_aes'
  859 |                         ocb_aes::ecb_encrypt_blks(ta, k, ctx->encrypt_key);
      |                                  ^~~~~~~~~~~~~~~~
ocb_internal.cc:859:51: error: 'ta' was not declared in this scope; did you mean 'tz'?
  859 |                         ocb_aes::ecb_encrypt_blks(ta, k, ctx->encrypt_key);
      |                                                   ^~
      |                                                   tz
ocb_internal.cc:879:30: error: 'ae_ctx' {aka 'struct _ae_ctx'} has no member named 'ad_checksum'
  879 |                         ctx->ad_checksum = ad_checksum;
      |                              ^~~~~~~~~~~
ocb_internal.cc: In function 'int ae_encrypt(ae_ctx*, const void*, const void*, int, const void*, int, void*, void*, int)':
ocb_internal.cc:896:50: error: 'block' does not name a type
  896 |         union { uint32_t u32[4]; uint8_t u8[16]; block bl; } tmp;
      |                                                  ^~~~~
ocb_internal.cc:897:5: error: 'block' was not declared in this scope; did you mean 'clock'?
  897 |     block offset, checksum;
      |     ^~~~~
      |     clock
ocb_internal.cc:899:19: error: 'ctp' was not declared in this scope; did you mean 'ctx'?
  899 |     block       * ctp = (block *)ct;
      |                   ^~~
      |                   ctx
ocb_internal.cc:899:33: error: expected primary-expression before ')' token
  899 |     block       * ctp = (block *)ct;
      |                                 ^
ocb_internal.cc:900:11: error: 'block' does not name a type
  900 |     const block * ptp = (block *)pt;
      |           ^~~~~
ocb_internal.cc:904:14: error: 'ae_ctx' {aka 'struct _ae_ctx'} has no member named 'offset'
  904 |         ctx->offset = gen_offset_from_nonce(ctx, nonce);
      |              ^~~~~~
ocb_internal.cc:904:23: error: 'gen_offset_from_nonce' was not declared in this scope
  904 |         ctx->offset = gen_offset_from_nonce(ctx, nonce);
      |                       ^~~~~~~~~~~~~~~~~~~~~
ocb_internal.cc:905:14: error: 'ae_ctx' {aka 'struct _ae_ctx'} has no member named 'ad_offset'
  905 |         ctx->ad_offset = ctx->checksum   = zero_block();
      |              ^~~~~~~~~
ocb_internal.cc:905:31: error: 'ae_ctx' {aka 'struct _ae_ctx'} has no member named 'checksum'
  905 |         ctx->ad_offset = ctx->checksum   = zero_block();
      |                               ^~~~~~~~
ocb_internal.cc:908:22: error: 'ae_ctx' {aka 'struct _ae_ctx'} has no member named 'ad_checksum'
  908 |                 ctx->ad_checksum = zero_block();
      |                      ^~~~~~~~~~~
ocb_internal.cc:916:5: error: 'offset' was not declared in this scope; did you mean 'off_t'?
  916 |     offset = ctx->offset;
      |     ^~~~~~
      |     off_t
ocb_internal.cc:916:19: error: 'ae_ctx' {aka 'struct _ae_ctx'} has no member named 'offset'
  916 |     offset = ctx->offset;
      |                   ^~~~~~
ocb_internal.cc:917:5: error: 'checksum' was not declared in this scope
  917 |     checksum  = ctx->checksum;
      |     ^~~~~~~~
ocb_internal.cc:917:22: error: 'ae_ctx' {aka 'struct _ae_ctx'} has no member named 'checksum'
  917 |     checksum  = ctx->checksum;
      |                      ^~~~~~~~

Same failure with gcc-4.2 and gcc-13.2.1.

achernya commented 3 months ago

Please provide details about your system. This works in our CI and in all distribution packages.

barracuda156 commented 3 months ago

@achernya Thank you for responding! macOS 10.6, gcc-13.2 (in fact gcc-4.2 is not picked at all due to C++ standard requirement, I just did not notice that initially).

It could be that either code is correct but uses VSX and not Altivec, in which case fixing a macro will work (i.e., use __VSX__). Or if the code is supposed to by ISA 2.03-compliant, then something is wrong in it (maybe includes).

If it is supposed to be ISA 2.03-compliant, then a macro for ppc64 has to be fixed as well, since the current one will lead to Darwin on ppc64 trying to use 32-bit chunk (it should also check for __ppc64__ to have an intended effect).

barracuda156 commented 3 months ago

With includes by the way configure does not check for machine/endian.h, which is the path on Darwin, but it is likely unrelated to the issue here and possibly inconsequential, since libkern macros are checked for.

barracuda156 commented 3 months ago

A lazy fix will be

--- src/crypto/ocb_internal.cc
+++ src/crypto/ocb_internal.cc
@@ -220,7 +220,7 @@
        bl = _mm_slli_epi32(bl, 1);
        return _mm_xor_si128(bl,tmp);
    }
-#elif __ALTIVEC__ && _CALL_ELF != 2
+#elif __VSX__ && _CALL_ELF != 2
     #include <altivec.h>
     typedef vector unsigned block;
     #define xor_block(x,y)         vec_xor(x,y)

or if it is known that it works on G4/G5 but not on MacOS, then

--- src/crypto/ocb_internal.cc
+++ src/crypto/ocb_internal.cc
@@ -220,7 +220,7 @@
        bl = _mm_slli_epi32(bl, 1);
        return _mm_xor_si128(bl,tmp);
    }
-#elif __ALTIVEC__ && _CALL_ELF != 2
+#elif (__ALTIVEC__ && _CALL_ELF != 2) && !defined(__APPLE__)
     #include <altivec.h>
     typedef vector unsigned block;
     #define xor_block(x,y)         vec_xor(x,y)

However it may be just some error, and the code could work. In which case we would not want to simply disable vectorization.

achernya commented 3 months ago

macOS 10.6 is no longer in support and ocb_internal is vendered code from https://www.cs.ucdavis.edu/~rogaway/ocb/news/code/ocb.c so I'm hesitant to touch it in a meaningful way other than deletions. I suggest you try enabling the openssl-based ocb implementation instead. (That would have been our default for mosh-1.4.0 if it hasn't been for CVE-2022-2097)

barracuda156 commented 3 months ago

@achernya Well, if no one knows how to fix it to work on macOS (I do not know Altivec syntax), then just disabling is fine. It will not affect anything else, obviously, since __APPLE__ is defined only for macOS. That will at least unbreak the build and allow it to function.

achernya commented 3 months ago

@barracuda156 please demonstrate that the build is broken on a modern, supported macOS -- otherwise we are not interested in this patchset.

barracuda156 commented 3 months ago

@achernya The patch specifically disables it where it is broken. It does not affect other systems where the code is presumed to work. I also fix the failing case here.

achernya commented 3 months ago

@barracuda156 as I mentioned in my comment above: I am not willing to take any changes to this file other than deletions. If you would like to get mosh to work, please enable the openssl-based ocb build instead. If you would like to submit a PR to delete all the altivec code instead, I would be willing to merge that.

nethershaw commented 3 months ago

ocb_internal is vendered code

This is why you don't bundle vendored libraries.

barracuda156 commented 3 months ago

@achernya I guess I did not understand correctly your reasoning. If you do not want to modify the code because it is vendored, I am not a legal expert, but I can accept that.

I am not sure if it is a right thing to remove the code, since while it will fix the bug for one platform, it may result in suboptimal performance on another platform, and I have no way to verify if the code builds on BSD and Linux or not.

achernya commented 3 months ago

@barracuda156 there's nothing about legality or not of modifying it. It's our inability to have CI for this configuration, therefore a desire to not support it.

barracuda156 commented 3 months ago

@achernya What you do with your project is up to you, of course, but to be honest I cannot see how my fix could have any conceivable adverse effect on any platform whatsoever. The only effect of it was to disable usage of that Altivec code on macOS. It was as non-invasive as possible. I am not asking you to support PowerPC proactively nor expect anyone to do it. But no one is better off if the broken code is left unfixed, when the cost of the fix is a single line change with no effect on other systems.

achernya commented 3 months ago

Your fix creates an ongoing expectation of support by the maintainers of this project. I've already expressed my desires here that we reduce that support burden since we cannot easily test for altivec on ppc. As a result, I can't take your contribution as is.

Continuing to discuss won't cause us to accept the single-line fix since it doesn't change our ability to test it in an ongoing basis.

barracuda156 commented 3 months ago

Just for the record if anyone ever bumps into the issue: the correct fix is to change vector to __vector (and obviously fix a macro for ppc64). Like this: https://github.com/macports/macports-ports/commit/a910a13fe316e9f4a3277a8766ece5590756ee92

My initial suggestion to disable it was suboptimal. The code is fine, but type used is inaccurate.

Related chunk in altivec.h is here: https://github.com/gcc-mirror/gcc/blob/58ecd2eb507ab216861408cf10ec05efc4e8344e/gcc/config/rs6000/altivec.h#L37-L49