All of lore.kernel.org
 help / color / mirror / Atom feed
From: Giulio Benetti <giulio.benetti@benettiengineering.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 1/4] package/libnss: fix build failure with ARM without NEON extension
Date: Thu, 24 Oct 2019 13:03:45 +0200	[thread overview]
Message-ID: <17916340-9334-f5ee-7bf5-52dd64b37ecd@benettiengineering.com> (raw)
In-Reply-To: <5b8cea47-a99e-cdeb-2d0c-2a69f237f691@mind.be>

Hi Arnout,

On 10/23/19 11:44 PM, Arnout Vandecappelle wrote:
> 
> 
> On 23/10/2019 12:23, Giulio Benetti wrote:
>> At the moment libnss assumes that every ARM has NEON extension but it's
>> not that way. So add a patch to make it aware of it and use native
>> functions in place of NEON optimized ones.
>>
>> Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
> 
>   You forgot:
> 
> Fixes:
> http://autobuild.buildroot.net/results/1342d305d1aeebef7af54a83afc094fda12421e2

Oops, yes.

>> ---
>> Already sent upstream:
>> https://bugzilla.mozilla.org/show_bug.cgi?id=1590676
>> ---
>>   ...ix-build-if-arm-doesn-t-support-NEON.patch | 47 +++++++++++++++++++
>>   1 file changed, 47 insertions(+)
>>   create mode 100644 package/libnss/0003-Bug-1590676-Fix-build-if-arm-doesn-t-support-NEON.patch
>>
>> diff --git a/package/libnss/0003-Bug-1590676-Fix-build-if-arm-doesn-t-support-NEON.patch b/package/libnss/0003-Bug-1590676-Fix-build-if-arm-doesn-t-support-NEON.patch
>> new file mode 100644
>> index 0000000000..e536282371
>> --- /dev/null
>> +++ b/package/libnss/0003-Bug-1590676-Fix-build-if-arm-doesn-t-support-NEON.patch
>> @@ -0,0 +1,47 @@
>> +From 946bc2864b0de7b63a4ec415e42e622d591a8753 Mon Sep 17 00:00:00 2001
>> +From: Giulio Benetti <giulio.benetti@benettiengineering.com>
>> +Date: Wed, 23 Oct 2019 11:47:03 +0200
>> +Subject: [PATCH] Bug 1590676 - Fix build if arm doesn't support NEON
>> +
>> +At the moment NSS assumes that ARM supports NEON extension but this is
>> +not true and leads to build failure on ARM without NEON extension.
>> +Add check to assure USE_HW_AES is not defined if ARM without NEON
>> +extension is used.
>> +
>> +Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
>> +---
>> + nss/lib/freebl/aes-armv8.c | 3 ++-
>> + nss/lib/freebl/rijndael.c  | 3 ++-
>> + 2 files changed, 4 insertions(+), 2 deletions(-)
>> +
>> +diff --git a/nss/lib/freebl/aes-armv8.c b/nss/lib/freebl/aes-armv8.c
>> +index 40d5e2d34..a5df53891 100644
>> +--- a/nss/lib/freebl/aes-armv8.c
>> ++++ b/nss/lib/freebl/aes-armv8.c
> 
>   That looks as if it is something that should be built only on armv8... Since
> the build failure is in fact for an armv4, don't we have a bigger issue here?
> 
>   I believe 32-bit armv8 always has neon.

Would it be a good idea to provide a variable to enable or not building 
aes-armv8 and define or not USE_HW_AES? I mean, this is a Makefile and I 
don't know how to make libnss capable of understand if there is NEON 
support or not, do you have any suggestions?

>> +@@ -7,7 +7,8 @@
>> +
>> + #if (defined(__clang__) ||                            \
>> +      (defined(__GNUC__) && defined(__GNUC_MINOR__) && \
>> +-      (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 8))))
>> ++      (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 8))) && \
>> ++      (defined(__ARM_NEON) || defined(__ARM_NEON__)))
> 
>   That parenthesis matching doesn't look right... I suppose with clang it doesn't
> magically support neon, right? So there should be an additional set of
> parenthesis around the defined(__clang__) ... > 8 part.

Oops again, you're right.

Thanks for reviewing
Best regards
-- 
Giulio Benetti
Benetti Engineering sas

  reply	other threads:[~2019-10-24 11:03 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-23 10:23 [Buildroot] [PATCH 1/4] package/libnss: fix build failure with ARM without NEON extension Giulio Benetti
2019-10-23 10:23 ` [Buildroot] [PATCH 2/4] package/libnss: fix build warning Giulio Benetti
2019-10-24  8:47   ` Arnout Vandecappelle
2019-10-24  8:50     ` Arnout Vandecappelle
2019-10-24  8:51       ` Arnout Vandecappelle
2019-10-24 10:49         ` Giulio Benetti
2019-10-23 10:23 ` [Buildroot] [PATCH 3/4] package/libnss: remove useless NSS_ENABLE_ECC variable Giulio Benetti
2019-10-24  8:48   ` Arnout Vandecappelle
2019-10-23 10:23 ` [Buildroot] [PATCH 4/4] package/libnss: remove NSS_ENABLE_WERROR=0 Giulio Benetti
2019-10-23 15:54   ` Thomas Petazzoni
2019-10-23 16:10     ` Giulio Benetti
2019-10-23 21:44 ` [Buildroot] [PATCH 1/4] package/libnss: fix build failure with ARM without NEON extension Arnout Vandecappelle
2019-10-24 11:03   ` Giulio Benetti [this message]
2019-10-28 16:55   ` [Buildroot] [PATCH v2] " Giulio Benetti
2019-10-29 11:55     ` Giulio Benetti

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=17916340-9334-f5ee-7bf5-52dd64b37ecd@benettiengineering.com \
    --to=giulio.benetti@benettiengineering.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.