| Summary: | dev-libs/nettle-3.9.1[asm] - test failures (chacha, chacha-poly1305) and runtime failures (e.g. wget[19849]: illegal instruction (4) at 3fff882c2754 nip 3fff882c2754 lr 3fff882c24e8 code 1 in libnettle.so.8.8) on machines with less than POWER7 cpu | ||
|---|---|---|---|
| Product: | Gentoo Linux | Reporter: | ernsteiswuerfel <erhard_f> |
| Component: | Current packages | Assignee: | Gentoo's Team for Core System packages <base-system> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | erhard_f, ppc64, sam |
| Priority: | Normal | Keywords: | TESTFAILURE |
| Version: | unspecified | ||
| Hardware: | PPC64 | ||
| OS: | Linux | ||
| See Also: |
https://git.lysator.liu.se/nettle/nettle/-/issues/7 https://bugs.gentoo.org/show_bug.cgi?id=935410 |
||
| Whiteboard: | |||
| Package list: | Runtime testing required: | --- | |
| Attachments: |
build.log
emerge --info |
||
|
Description
ernsteiswuerfel
2023-12-18 01:13:13 UTC
Created attachment 879768 [details]
emerge --info
Yeah, in https://git.lysator.liu.se/nettle/nettle/-/tree/master/powerpc64, the minimum is p7. Upstream need to add a configure check to bail out / disable asm on <p7. On our side, it's maybe a bit more intesting about how we should handle (detect) it. Unfortunately the CHOST isn't enough. I did some testing with upstream nettle from git. Turns out the >=P7 assembly problem only shows up on the G5 as long as --disable-fat is set in ./configure. I mimicked configure options from the failing nettle-3.9.1 Gentoo ebuild and used them on git nettle_3.9.1_release_20230601 but without --disable-fat: ./.bootstrap ./configure --disable-dependency-tracking CC_FOR_BUILD=powerpc64-unknown-linux-gnu-gcc --disable-arm-neon --disable-arm64-crypto --enable-power-altivec --disable-power-crypto-ext --disable-power9 --disable-x86-aesni --disable-x86-sha-ni --disable-x86-pclmul --disable-s390x-vf --disable-s390x-msa --enable-assembler --disable-documentation --enable-public-key --enable-static --disable-openssl make -j3 make -j3 check This builds ok and passes tests on my G5 without throwing up illegal instructions. When --disable-fat is set in ./configure I get: chacha-test[232102]: illegal instruction (4) at 3fffa56ef714 nip 3fffa56ef714 lr 3fffa56cb604 code 1 in libnettle.so[3fffa56b0000+5a000] chacha-test[232102]: code: 38c00010 38e00020 39000030 3941ffc0 7e8051ce 7ea651ce 7ec751ce 7ee851ce chacha-test[232102]: code: 1210038c 122c038c 1248038c 1267038c <7c002619> 7c862619 7d072619 7d882619 chacha-poly1305[232473]: illegal instruction (4) at 3fffa0b9b90c nip 3fffa0b9b90c lr 3fffa0b9ba60 code 1 in libnettle.so[3fffa0b80000+5a000] chacha-poly1305[232473]: code: 80050000 38c00010 38e00020 39000030 1090038c 10ac038c 10c8038c 10e7038c chacha-poly1305[232473]: code: 39200000 7d89480c 11a3030c 118c6cc4 <7c002619> 7c262619 7c472619 7c682619 OK, so, coming back to this:
*powerpc64*)
if test "$ABI" = 64 ; then
GMP_ASM_POWERPC_R_REGISTERS
asm_path="powerpc64"
if test "x$enable_fat" = xyes ; then
asm_path="powerpc64/fat $asm_path"
OPT_NETTLE_SOURCES="fat-ppc.c $OPT_NETTLE_SOURCES"
FAT_TEST_LIST="none crypto_ext altivec power9"
else
if test "$enable_power9" = yes ; then
asm_path="powerpc64/p9 $asm_path"
fi
if test "$enable_power_crypto_ext" = yes ; then
asm_path="powerpc64/p8 $asm_path"
fi
if test "$enable_power_altivec" = yes ; then
asm_path="powerpc64/p7 $asm_path"
fi
fi
fi
;;
On our end, I guess we can do a compile-test to see if we're at least P7, and if not, we disable the altivec flag. meh.
I would file a bug on their gitlab but it's invite-only.
(In reply to Sam James from comment #4) > > I would file a bug on their gitlab but it's invite-only. Ah, wait, it's not anymore! https://lists.lysator.liu.se/mailman/hyperkitty/list/nettle-bugs@lists.lysator.liu.se/thread/GJF2Q72MHYLLKV63O7GCUSVZUAWBXT6X/ The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4551df6ec5cae19486cb63698e294a3f62015600 commit 4551df6ec5cae19486cb63698e294a3f62015600 Author: Sam James <sam@gentoo.org> AuthorDate: 2024-06-24 01:13:55 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2024-06-24 01:15:21 +0000 dev-libs/nettle: disable altivec for <P7 Thanks to awilfox for the help with ppc cpp. Closes: https://bugs.gentoo.org/920234 Signed-off-by: Sam James <sam@gentoo.org> dev-libs/nettle/{nettle-3.9.ebuild => nettle-3.9-r1.ebuild} | 9 ++++++++- dev-libs/nettle/{nettle-3.9.1.ebuild => nettle-3.9.1-r1.ebuild} | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) Many thanks! Seems the patch is also needed for just released 3.10. (In reply to ernsteiswuerfel from comment #8) > Many thanks! > > Seems the patch is also needed for just released 3.10. yw! I added the workaround there, right? (I did the bump after.) (In reply to Sam James from comment #9) > (In reply to ernsteiswuerfel from comment #8) > > Many thanks! > > > > Seems the patch is also needed for just released 3.10. > > I added the workaround there, right? (I did the bump after.) I built 3.10 from git, didn't even realize you already bumped Gentoo to 3.10. ;) And yes, works there too. The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c627cc231796bf88ce7ef664986863d32de4a5a4 commit c627cc231796bf88ce7ef664986863d32de4a5a4 Author: Sam James <sam@gentoo.org> AuthorDate: 2024-07-04 01:28:37 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2024-07-04 01:28:37 +0000 dev-libs/nettle: fix quoting for altivec sanity check Bug: https://bugs.gentoo.org/920234 Closes: https://bugs.gentoo.org/935410 Fixes: 4551df6ec5cae19486cb63698e294a3f62015600 Thanks-to: Nick Bowler <nbowler@draconx.ca> Signed-off-by: Sam James <sam@gentoo.org> dev-libs/nettle/nettle-3.10.ebuild | 2 +- dev-libs/nettle/nettle-3.9.1-r1.ebuild | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) |