[Buildroot] [PATCH] package/libnss: fix build failure due to HW PPC Crypto bug

Giulio Benetti giulio.benetti at benettiengineering.com
Wed Jan 1 16:51:40 UTC 2020


Hi Thomas,

On 1/1/20 4:32 PM, Thomas Petazzoni wrote:
> On Wed, 1 Jan 2020 00:44:09 +0100
> Giulio Benetti <giulio.benetti at benettiengineering.com> wrote:
> 
>>>> So if we stick with nss-3.48, the package should likely depend on
>>>> BR2_TOOLCHAIN_GCC_AT_LEAST_8.
>>
>> This ^^^ is too restrictive, but...
>>
>>> Or don't utilize PPC hardware accelerated instructions by undefining
>>> USE_PPC_CRYPTO... which is probably the saner option :-). This would
>>> give the semblance that the compile worked as expected since the hashing
>>> function will now be available, but Thomas' concern re CPU_ARCH and the
>>> future inclusion of ppc specific source is still valid.
>>
>> ...this is a good idea. So with gcc version < 8.x let's disable
>> USE_PPC_CRYPTO and with gcc version >= 8.x let's enable it only if
>> LITTLE_ENDIAN. So at this point I would change my upstream patch to do
>> that in NSS, since there's already a gcc version check but only against
>> version 5.x(>=) that instead needs to be >= 8.x.
> 
> As I said in my previous e-mail, I also don't see how it can work with
> the current OS_TEST value that we pass in libnss.mk, which is never set
> to ppc64 or ppc64le as the libnss build system expects.

You're right, the problem is that it doesn't compile gcm-ppc.c because 
Buildroot sets OS_TEST to powerpc64le in this case but libnss expects 
ppc64le, so I'm testing a patch where I remap:
BR2_powerpc => ppc
BR2_powerpc64 => ppc64
BR2_powerpc64le => ppc64le

And I'm going to add a patch too to modify minimum gcc version required 
from 5.x to 8.x, because as Vincent pointed vec_xst_be() has been 
introduced only in version 8.x.
This way we avoid BR2_TOOLCHAIN_GCC_AT_LEAST_8 and later I send it upstream.

Thank you and
Best regards
-- 
Giulio Benetti
Benetti Engineering sas


More information about the buildroot mailing list