PPC64le linux build failure: error: undefined reference to 'chacha20vsx'

Talk about code development, features, specific bugs, enhancements, patches, and similar things.
Forum rules
Please keep everything here strictly on-topic.
This board is meant for Pale Moon source code development related subjects only like code snippets, patches, specific bugs, git, the repositories, etc.

This is not for tech support! Please do not post tech support questions in the "Development" board!
Please make sure not to use this board for support questions. Please post issues with specific websites, extensions, etc. in the relevant boards for those topics.

Please keep things on-topic as this forum will be used for reference for Pale Moon development. Expect topics that aren't relevant as such to be moved or deleted.
User avatar
o _ o
New to the forum
New to the forum
Posts: 2
Joined: 2024-04-29, 00:16
Contact:

PPC64le linux build failure: error: undefined reference to 'chacha20vsx'

Unread post by o _ o » 2024-04-29, 00:50

Trying to build on ppc64le, but it seems the VSX speedups are causing a build failure.

CPU: Power8nv (supports altivec, vsx, and vsx2, but not vsx3)
OS: Gentoo Linux
CC: GCC 13.2.1

Will attach full build log, but the relevant lines seem to be:

Code: Select all

91021: 4:27.67 /var/tmp/portage/www-client/palemoon-33.1.0/work/palemoon-33.1.0/platform/security/nss/lib/freebl/chacha20poly1305.c:224: error: undefined reference to 'chacha20vsx'
91022: 4:27.67 /var/tmp/portage/www-client/palemoon-33.1.0/work/palemoon-33.1.0/platform/security/nss/lib/freebl/chacha20poly1305.c:297: error: undefined reference to 'Chacha20Poly1305_vsx_aead_encrypt'
91023: 4:27.67 /var/tmp/portage/www-client/palemoon-33.1.0/work/palemoon-33.1.0/platform/security/nss/lib/freebl/chacha20poly1305.c:366: error: undefined reference to 'Chacha20Poly1305_vsx_aead_decrypt'
91024: 4:27.67 /var/tmp/portage/www-client/palemoon-33.1.0/work/palemoon-33.1.0/platform/security/nss/lib/freebl/chacha20poly1305.c:422: error: undefined reference to 'Chacha20Poly1305_vsx_aead_encrypt'
91025: 4:27.67 /var/tmp/portage/www-client/palemoon-33.1.0/work/palemoon-33.1.0/platform/security/nss/lib/freebl/chacha20poly1305.c:476: error: undefined reference to 'Chacha20Poly1305_vsx_aead_decrypt'
Will also attach an `emerge --info`, it gives basic information about my system, available libs, etc.

Any palemoon or basilisk devs are also free to send me an SSH pubkey if they want to use this box for development or testing. Host is little endian glibc but planning to make kvm hosts for every combination of endianness, glibc/musl, and 32/64bit.
Attachments
build.log.xz.log
allow .xz as an attachment lol
(556.89 KiB) Not downloaded yet
emerge.info.txt
(12.12 KiB) Downloaded 3 times

User avatar
Gaming4JC
Hobby Astronomer
Hobby Astronomer
Posts: 22
Joined: 2018-09-08, 17:10

Re: PPC64le linux build failure: error: undefined reference to 'chacha20vsx'

Unread post by Gaming4JC » 2024-05-13, 01:25

This is a known issue in the NSS library from upstream on older PPC64 that don't have the full VSX ABI.

Try disabling it in /platform/security/nss/coreconf/config.gypi:

Code: Select all

'disable_crypto_vsx%': 1,
See here for more info: https://bugzilla.mozilla.org/show_bug.cgi?id=1687164

User avatar
o _ o
New to the forum
New to the forum
Posts: 2
Joined: 2024-04-29, 00:16
Contact:

Re: PPC64le linux build failure: error: undefined reference to 'chacha20vsx'

Unread post by o _ o » 2024-05-23, 02:13

Hello @Gaming4JC-- thanks for the reply!!

Sadly, this issue I'm pretty sure is unrelated. While it's true that these flags (-mvsx and -mcrypto) would produce binaries that would error out on POWER6 and POWER7 respectively, they are both fully supported on my POWER8 ppc64le box, and I use both of these flags globally on my gentoo system without issue. Plus, looking at this bug doesn't show any build failures, just the bin quitting at runtime.

These VSX optimizations seemed to be introduced in palemoon 32.1.0, which I tested and encountered the same build failure.

While disabling the vsx and crypto would likely result in a successful build (and will do so after I submit this comment), that doesn't solve the issue of this vsx/crypto related code not being functional and causing a build failure. Either the offending code should be removed, or the `undefined references` should be fixed(which I'd personally much prefer)
Gaming4JC wrote:
2024-05-13, 01:25
This is a known issue in the NSS library from upstream on older PPC64 that don't have the full VSX ABI.

Try disabling it in /platform/security/nss/coreconf/config.gypi:

Code: Select all

'disable_crypto_vsx%': 1,
See here for more info: https://bugzilla.mozilla.org/show_bug.cgi?id=1687164

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35785
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: PPC64le linux build failure: error: undefined reference to 'chacha20vsx'

Unread post by Moonchild » 2024-05-23, 07:54

o _ o wrote:
2024-05-23, 02:13
While disabling the vsx and crypto would likely result in a successful build (and will do so after I submit this comment), that doesn't solve the issue of this vsx/crypto related code not being functional and causing a build failure. Either the offending code should be removed, or the `undefined references` should be fixed(which I'd personally much prefer)
I'm sorry but that is not how building for multiple target platforms works. We cannot start removing code that works for other target platforms just because it doesn't work on yours. On top, this is in a third party library and we don't have control over what code goes in there (and we really don't want to fork NSS)
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

Post Reply