Tarsnap / tarsnap

Command-line client code for Tarsnap.
https://tarsnap.com
Other
871 stars 60 forks source link

master fails to build on old gcc (below version 9) #473

Closed 0xkag closed 3 years ago

0xkag commented 3 years ago

Perhaps this is intentional? But in any case, master at d067c043d01e doesn't build on i686. It fails with the following error:

libcperciva/crypto/crypto_aesctr_aesni.c: In function ‘crypto_aesctr_aesni_stream_wholeblocks’:
libcperciva/crypto/crypto_aesctr_aesni.c:47:13: warning: implicit declaration of function ‘_mm_loadu_si64’ [-Wimplicit-function-declaration]
  nonce_be = _mm_loadu_si64(stream->pblk);
             ^~~~~~~~~~~~~~
libcperciva/crypto/crypto_aesctr_aesni.c:47:11: error: incompatible types when assigning to type ‘__m128i {aka __vector(2) long long int}’ from type ‘int’
  nonce_be = _mm_loadu_si64(stream->pblk);
           ^
libcperciva/crypto/crypto_aesctr_aesni.c:63:10: error: incompatible types when assigning to type ‘__m128i {aka __vector(2) long long int}’ from type ‘int’
   bufsse = _mm_loadu_si64(block_counter_be_arr);
          ^

I did not bother bisecting to determine when it was introduced.

0xkag commented 3 years ago

A quick git blame shows changes in c0046fa6 and 27837300 on these lines made on 2021-01-19 by @gperciva.

gperciva commented 3 years ago

Huh, that shouldn't be enabled unless your CPU supports AESNI. Could you please paste the contents of your cpusupport-config.h? It should be in the main build directory (probably the top level of the source tree).

gperciva commented 3 years ago

Never mind, I've reproduce it inside virtualbox. I'll have a fix soon.

gperciva commented 3 years ago

Looks like a compiler thing:

On my debian buster system, it works with clang-6 and clang-7 (the available version of clang), but not an version of gcc that's in the default package tree. So a temporary fix might be to try

CC=clang make

I'm working on a fix for old gcc.

gperciva commented 3 years ago

Ah, on that note, for the curious: I can reproduce this on modern freebsd amd64, via

CC=gcc8 make
gperciva commented 3 years ago

I believe that this was fixed in #474.

cperciva commented 3 years ago

@0xkag Can you confirm that this is now working for you?

0xkag commented 3 years ago

@gperciva, @cperciva, master builds for me now:

% uname -a
Linux <redacted> 5.10.13-x86-linode161 #1 SMP Thu Feb 4 13:51:28 EST 2021 i686 GNU/Linux
% tarsnap --version
tarsnap 1.0.39-head
% git rev-parse HEAD
b27038c31906c0c8a7426d1a50d0d04e9342d929
gperciva commented 3 years ago

Thanks, @0xkag!