]> git.michaelhowe.org Git - packages/o/openafs.git/commit
hcrypto: Avoid 'double' param in arm64 kernel code
authorAndrew Deason <adeason@sinenomine.net>
Sun, 8 Mar 2015 16:47:28 +0000 (11:47 -0500)
committerBenjamin Kaduk <kaduk@mit.edu>
Sat, 2 Jun 2018 22:44:52 +0000 (18:44 -0400)
commit891cb67329d595d805289f533e6ee329c0a3851b
treead5500e902a528fa2a34874037787af257da486a
parent518220c7f9b22bac6b9a237708737a18ee7f285e
hcrypto: Avoid 'double' param in arm64 kernel code

Currently, the RAND_add function in hcrypto uses a floating point
argument (specifically, a 'double'), as well as any implementations of
RAND_add. On Linux arm64, we cannot use floating point code in the
kernel, since the kernel module is compiled with -mgeneral-regs-only,
which prevents the use of floating point registers. No code in the
tree actually makes use of this argument, but its mere presence is
enough to cause an error with at least some versions of gcc with
certain arguments.

To get around this, simply change all instances of 'double' in hcrypto
to be a void pointer instead. This allows the code to compile as long
as nobody actually uses that argument in the kernel. If the code is
changed such that we do actually use that argument, the argument will
be a void* and so will probably (hopefully) cause a compiler error,
and the code will need to be examined to make sure this workaround
doesn't break anything.

We already do this on Solaris, which has similar issues for different
compiler versions and compiler flags. Add arm64 Linux to the cases
where we do this, but restrict this to kernel code only, to try to
avoid doing this more often than necessary.

Reviewed-on: https://gerrit.openafs.org/11939
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit b792dea0f1f83673b0b045adf608412901b3024c)

Change-Id: I95a016ba4a3dc368680b512110eb0058fcfdb468
Reviewed-on: https://gerrit.openafs.org/13094
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
src/crypto/hcrypto/kernel/config.h