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...
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Mozilla Gentoo Team
Depends on:
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: ---

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

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


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
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):

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

    dev-libs/nss: update ppc abi patch
    Package-Manager: Portage-2.3.103, Repoman-2.3.23
    Signed-off-by: Georgy Yakovlev <>

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