Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 730172 - dev-libs/nss-3.54: fails to build on ppc64(le) SHA512_Update: undefined reference to `sha512_block_p8'
Summary: dev-libs/nss-3.54: fails to build on ppc64(le) SHA512_Update: undefined refe...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Mozilla Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-06-29 19:14 UTC by Georgy Yakovlev
Modified: 2020-06-29 21:03 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
nss build log (nss-3.54-ppc64.log.gz,16.92 KB, application/gzip)
2020-06-29 20:44 UTC, Georgy Yakovlev
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Georgy Yakovlev gentoo-dev 2020-06-29 19:14:09 UTC
details will follow
Comment 1 Georgy Yakovlev gentoo-dev 2020-06-29 20:43:28 UTC
so the patch committed in #722110 actually breaks compilation on ppc64le

it will also break musl big-endian target which is ELFv2 ABI (but that's fine for now as we don't actively support it yet)


upstream defines this

#if defined(USE_PPC_CRYPTO)
    sha512_block_p8(&H[0], &W[0], 1);
#else /* USE_PPC_CRYPTO */


in  lib/freebl/sha512.c

and sha512_block_p8 is in sha512-p8.s


but 2 separate checks are used.

so if USE_PPC_CRYPTO is defined

but

sha512-p8.s is not included we get build failure as in the log.


idk why it's not included

manually running abi check returns expected result

> cc -dM -E - < /dev/null | grep _CALL_ELF | awk '{ print $3 }'
> 2
Comment 2 Georgy Yakovlev gentoo-dev 2020-06-29 20:44:51 UTC
Created attachment 647106 [details]
nss build log
Comment 3 Georgy Yakovlev gentoo-dev 2020-06-29 20:58:27 UTC
ok, getting closer

added this to makefile

$(error   VAR is $(PPC_ABI))

> Makefile:271: *** VAR is #define _CALL_ELF 2.  Stop.


so the awk in the pipe does not work.

and the reason is that local patch committed to our repo is a bit incorrect.


it references args with single $ characters

> PPC_ABI := $(shell $(CC) -dM -E - < /dev/null | grep _CALL_ELF | awk '{ print $3 }')


but since it's in a makefile, it should be 

> PPC_ABI := $(shell $(CC) -dM -E - < /dev/null | awk '$$2 == "_CALL_ELF" {print $$3}')


like upstream updated version v3

https://bug1642174.bmoattachments.org/attachment.cgi?id=9156182
Comment 4 Larry the Git Cow gentoo-dev 2020-06-29 21:03:09 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5c5607e394bfaf88ebba5792ff2354e26c5707ee

commit 5c5607e394bfaf88ebba5792ff2354e26c5707ee
Author:     Georgy Yakovlev <gyakovlev@gentoo.org>
AuthorDate: 2020-06-29 20:59:31 +0000
Commit:     Georgy Yakovlev <gyakovlev@gentoo.org>
CommitDate: 2020-06-29 21:02:18 +0000

    dev-libs/nss: update ppc abi patch
    
    Bug: https://bugs.gentoo.org/722110
    Closes: https://bugs.gentoo.org/730172
    Package-Manager: Portage-2.3.103, Repoman-2.3.23
    Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>

 dev-libs/nss/files/nss-3.53-fix-building-on-ppc.patch | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)