New release portability issue
Damien Miller
djm at mindrot.org
Fri Feb 21 09:16:56 AEDT 2025
On Thu, 20 Feb 2025, Dennis Clarke via openssh-unix-dev wrote:
>
> --------------------- apology ---------------
> Sorry for the resend, myself and Thunderbird are having problems also.
> ---------------------------------------------
> |
> | Initially sent 19 Feb 2025 :
> |
> | On an old Fujitsu SPARC64 server running Solaris 10 there is
> | no builtin compiler function for __builtin_popcount. This seems to
> | be something new in libcrux_mlkem768_sha3.h header. There was no
> | issue with openssh-9.8p1.
> |
> | The LLVM folks have neat little bit of code that can do the bit
> | shifting and adding :
> |
> |
> |
> https://github.com/llvm-mirror/compiler-rt/blob/master/lib/builtins/popcountdi2.c
> |
> | It would be better to use inline asm where the SPARC64 hardware
> | does indeed have the popc instruction.
> ---------------------------------------------
> |
> | There was a reply from Damien Miller 20 Feb 2025
> |
> |
> | This is weird, because this code has not changed significantly
> | since 9.8p1. It's possible that configure might be behaving
> | differently, could you try comparing the output of ./configure
> | run on each version?
> |
> ================= once more from the top ================
>
> Thank you for the reply and that is a good idea. I shall do that this
> morning once the coffee machine begins to work.
>
> In the meanwhile there is the problem with libcrux_mlkem768_sha3.h
> which is new. It did not exist in 9.8p1 at all. Neither did the need
> for that GCC builtin function.
>
> I have the two versions code extracted here :
>
> sparc64$ ls -lad openssh-9.8p1 openssh-9.9p2
> drwxr-xr-x 7 1000 1000 331 Jul 1 2024 openssh-9.8p1
> drwxr-xr-x 7 1000 1000 334 Feb 18 08:15 openssh-9.9p2
>
> That new header does not exist in 9.9p2 :
>
> sparc64$ grep -n '__builtin_popcount' openssh-9.8p1/libcrux_mlkem768_sha3.h
> grep: openssh-9.8p1/libcrux_mlkem768_sha3.h: No such file or directory
> sparc64$
Ah sorry, I was driving "git diff" badly. The code is indeed new.
Can you provide some more details about your compiler? We already have
logic to disable ML-KEM if the compiler is too old (search defines.h for
USE_MLKEM768X25519), and it would be trivial to extend that.
It's probably fairly easy to put a simple popcount in for compatibility
too, but I don't think we need to be very fancy there.
To do either of these in OpenSSH though, we need to be able to identify
compilers that lack __builtin_popcount...
-d
More information about the openssh-unix-dev
mailing list