From: Giulio Benetti <giulio.benetti@benettiengineering.com>
To: Fabrice Fontaine <fontaine.fabrice@gmail.com>, buildroot@buildroot.org
Cc: Joseph Kogut <joseph.kogut@gmail.com>
Subject: Re: [Buildroot] [PATCH 1/1] package/libnss: fix build on ARM big endian
Date: Sun, 8 Aug 2021 14:30:03 +0200 [thread overview]
Message-ID: <bc8b0e97-ba69-07fe-88dc-e528d8f3c0fa@benettiengineering.com> (raw)
In-Reply-To: <352f1f15-f569-cd20-db72-3b47b2949084@benettiengineering.com>
Hi Fabrice,
On 8/7/21 11:47 PM, Giulio Benetti wrote:
> Hi Fabrice,
>
> On 8/7/21 11:32 PM, Fabrice Fontaine wrote:
>> Fix the follownig build failure on ARM big endian raised since bump to
>> version 3.68 in commit 0a73b9b962421ce7a72c88e5f5bbd8849f21b041:
>>
>> Linux2.6_aarch64_aarch64_be-linux-gnu-gcc_glibc_PTH_64_DBG.OBJ/Linux_SINGLE_SHLIB/sha256-armv8.o: In function `SHA256_Compress_Native':
>> sha256-armv8.c:(.text.SHA256_Compress_Native+0x0): multiple definition of `SHA256_Compress_Native'
>> Linux2.6_aarch64_aarch64_be-linux-gnu-gcc_glibc_PTH_64_DBG.OBJ/Linux_SINGLE_SHLIB/sha512.o:sha512.c:(.text.SHA256_Compress_Native+0x0): first defined here
>> Linux2.6_aarch64_aarch64_be-linux-gnu-gcc_glibc_PTH_64_DBG.OBJ/Linux_SINGLE_SHLIB/sha256-armv8.o: In function `SHA256_Update_Native':
>> sha256-armv8.c:(.text.SHA256_Update_Native+0x0): multiple definition of `SHA256_Update_Native'
>> Linux2.6_aarch64_aarch64_be-linux-gnu-gcc_glibc_PTH_64_DBG.OBJ/Linux_SINGLE_SHLIB/sha512.o:sha512.c:(.text.SHA256_Update_Native+0x0): first defined here
>>
>> Fixes:
>> - http://autobuild.buildroot.org/results/237aba0c16a34fec1b0fe50fe08cace438eda1bf
>>
>> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
>> ---
>> ...2.c-fix-SHA256-redefinition-on-ARM-b.patch | 47 +++++++++++++++++++
>> 1 file changed, 47 insertions(+)
>> create mode 100644 package/libnss/0001-lib-freebl-sha512.c-fix-SHA256-redefinition-on-ARM-b.patch
>>
>> diff --git a/package/libnss/0001-lib-freebl-sha512.c-fix-SHA256-redefinition-on-ARM-b.patch b/package/libnss/0001-lib-freebl-sha512.c-fix-SHA256-redefinition-on-ARM-b.patch
>> new file mode 100644
>> index 0000000000..f925f20051
>> --- /dev/null
>> +++ b/package/libnss/0001-lib-freebl-sha512.c-fix-SHA256-redefinition-on-ARM-b.patch
>> @@ -0,0 +1,47 @@
>> +From 434d79c52db5b680accc531572319bd7094fa470 Mon Sep 17 00:00:00 2001
>> +From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
>> +Date: Sat, 7 Aug 2021 23:19:01 +0200
>> +Subject: [PATCH] lib/freebl/sha512.c: fix SHA256 redefinition on ARM big
>> + endian
>> +
>> +For an unknown reason, SHA256_{Compress,Update}_Native are defined in
>> +lib/freebl/sha512.c if IS_LITTLE_ENDIAN is undefined since version 3.68
>> +and
>> +https://github.com/nss-dev/nss/commit/e1e00f21f2d73e0d5d27651ad5606efa5714abe4
>> +
>> +This raises the following build failure on ARM big endian:
>> +
>> +Linux2.6_aarch64_aarch64_be-linux-gnu-gcc_glibc_PTH_64_DBG.OBJ/Linux_SINGLE_SHLIB/sha256-armv8.o: In function `SHA256_Compress_Native':
>> +sha256-armv8.c:(.text.SHA256_Compress_Native+0x0): multiple definition of `SHA256_Compress_Native'
>> +Linux2.6_aarch64_aarch64_be-linux-gnu-gcc_glibc_PTH_64_DBG.OBJ/Linux_SINGLE_SHLIB/sha512.o:sha512.c:(.text.SHA256_Compress_Native+0x0): first defined here
>> +Linux2.6_aarch64_aarch64_be-linux-gnu-gcc_glibc_PTH_64_DBG.OBJ/Linux_SINGLE_SHLIB/sha256-armv8.o: In function `SHA256_Update_Native':
>> +sha256-armv8.c:(.text.SHA256_Update_Native+0x0): multiple definition of `SHA256_Update_Native'
>> +Linux2.6_aarch64_aarch64_be-linux-gnu-gcc_glibc_PTH_64_DBG.OBJ/Linux_SINGLE_SHLIB/sha512.o:sha512.c:(.text.SHA256_Update_Native+0x0): first defined here
>> +
>> +Revert this change as it seems completely unrelated to the commit title
>> +"Bug 1655493 - Support SHA2 HW acceleration using Intel SHA Extension"
>
> I'm not completely sure about this, since I remember most of armv8
> accelerations only work for LITTLE_ENDIAN. But I can't login to the
> Mozilla Bugzilla because of two factor authentication I've never enabled
> and I've asked help to fix this days ago with no answer. Do you have
> access to it?
>
> Can you please clarify if that acceleration is valid on BIG_ENDIAN too?
> It's not written anywhere, but more than one lib/freebl/ lib
> acceleration has been done only for LITTLE_ENDIAN. What worries me is
> the hash table at the top that *maybe* is only suitable for LITTLE_ENDIAN:
> https://hg.mozilla.org/projects/nss/file/tip/lib/freebl/sha256-armv8.c#l24
>
> For example check this patch I've sent time ago:
> https://hg.mozilla.org/projects/nss/rev/fa0d958de0c3cf99a7ec66e819b128c7bc88ff9f
> and the related bug:
> https://bugzilla.mozilla.org/show_bug.cgi?id=1580126
>
> That makes me believe that is only LITTLE_ENDIAN compatible also due to
> this:
> https://hg.mozilla.org/projects/nss/file/tip/lib/freebl/sha512.c#l167
>
> BUT I can't reach anyone, and they don't sign off the commits, so no
> e-mail to CC. Maybe you can through Mozilla Bugzilla?
Finally I have access to Mozilla Bugzilla and i've filed the bug:
https://bugzilla.mozilla.org/show_bug.cgi?id=1724629
So I'd wait for their response and fix according to it.
Kind regards
--
Giulio Benetti
Benetti Engineering sas
_______________________________________________
buildroot mailing list
buildroot@busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
next prev parent reply other threads:[~2021-08-08 12:30 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-07 21:32 [Buildroot] [PATCH 1/1] package/libnss: fix build on ARM big endian Fabrice Fontaine
2021-08-07 21:47 ` Giulio Benetti
2021-08-08 12:30 ` Giulio Benetti [this message]
2021-08-08 20:22 ` Thomas Petazzoni
2021-08-08 21:59 ` Giulio Benetti
2021-08-10 16:37 ` 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=bc8b0e97-ba69-07fe-88dc-e528d8f3c0fa@benettiengineering.com \
--to=giulio.benetti@benettiengineering.com \
--cc=buildroot@buildroot.org \
--cc=fontaine.fabrice@gmail.com \
--cc=joseph.kogut@gmail.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox