Summary: | security/nss: fix build on powerpc64 elfv1 | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | Ports & Packages | Reporter: | Piotr Kubaj <pkubaj> | ||||||||
Component: | Individual Port(s) | Assignee: | freebsd-gecko (Nobody) <gecko> | ||||||||
Status: | Closed FIXED | ||||||||||
Severity: | Affects Many People | CC: | gecko, powerpc | ||||||||
Priority: | --- | Flags: | bugzilla:
maintainer-feedback?
(gecko) pkubaj: merge-quarterly? |
||||||||
Version: | Latest | ||||||||||
Hardware: | powerpc | ||||||||||
OS: | Any | ||||||||||
Attachments: |
|
Description
Piotr Kubaj
![]() ![]() Comment on attachment 214416 [details] patch > -.abiversion 2 > +.abiversion 1 Can't you omit .abiversion to let the assembler use whatever is default on the target architecture? Created attachment 214418 [details]
v2
This indeed works as well and would actually be upstreamable.
Another issue is that sha512-p8.s is also compiled on 32-bit ppc and breaks there:
sha512-p8.s: Assembler messages:
sha512-p8.s:9: Error: unknown pseudo-op: `.localentry'
But that will require another fix.
Created attachment 214420 [details]
v3
More correct solution.
The previous patch worked, but sha512-p8 wasn't included in the final binary because USE_PPC_CRYPTO is disabled. sha512-p8 was just built, but not used earlier. This is why all tests passed.
The problem with it is that the assembly is tailored to little-endian and won't work on big-endian. However, there is a proper script to generate sha512-p8 for big-endian, both elfv1 and elfv2. There is also a variant for 32-bit powerpc. Ideally, this script should run always, but upstream seems to have forgotten that and just put the generated sha512-p8 to the source. This patch takes care of running this script.
Also, since USE_PPC_CRYPTO works on big-endian, put an option to enable that. It will use VSX, which is available on POWER8 and newer. I made it available on 32 bits as well, just in case someone on VSX-capable machine wants to run 32-bit chroot or jail.
Comment on attachment 214420 [details] v3 Looks OK. > VSX_DESC= Use VSX (POWER8 and newer) Maybe reword from SSE_DESC e.g., VSX_DESC= Use VSX optimized routines (POWER8 or newer) A commit references this bug: Author: pkubaj Date: Fri May 15 18:30:22 UTC 2020 New revision: 535312 URL: https://svnweb.freebsd.org/changeset/ports/535312 Log: security/nss: fix build on powerpc and powerpc64 with gcc PR: 246419 Approved by: jbeich (maintainer) MFH: 2020Q2 (fix build blanket) Changes: head/security/nss/Makefile head/security/nss/files/powerpc-lib_freebl_scripts_gen.sh head/security/nss/files/powerpc64elfv1-lib_freebl_scripts_gen.sh head/security/nss/files/powerpc64elfv2-lib_freebl_scripts_gen.sh A commit references this bug: Author: pkubaj Date: Fri May 15 18:31:17 UTC 2020 New revision: 535313 URL: https://svnweb.freebsd.org/changeset/ports/535313 Log: MFH: r535312 security/nss: fix build on powerpc and powerpc64 with gcc PR: 246419 Approved by: jbeich (maintainer) Approved by: portmgr (fix build blanket) Changes: _U branches/2020Q2/ branches/2020Q2/security/nss/Makefile branches/2020Q2/security/nss/files/powerpc-lib_freebl_scripts_gen.sh branches/2020Q2/security/nss/files/powerpc64elfv1-lib_freebl_scripts_gen.sh branches/2020Q2/security/nss/files/powerpc64elfv2-lib_freebl_scripts_gen.sh |