Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 845273 - >=dev-libs/nss-3.68: build fails on big endian ARM64: multiple definition of `SHA256_Compress_Native'
Summary: >=dev-libs/nss-3.68: build fails on big endian ARM64: multiple definition of...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: ARM64 Linux
: Normal normal
Assignee: Mozilla Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-05-18 06:42 UTC by Marcus Comstedt
Modified: 2023-07-02 16:47 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marcus Comstedt 2022-05-18 06:42:34 UTC
nss 3.68 contains an incorrect compile time check which leads to both software
and hardware implementations of SHA256 being defined on big endian ARM64.

Please see e.g.
http://lists.busybox.net/pipermail/buildroot/2021-August/621590.html
for a fix

Reproducible: Always

Steps to Reproduce:
1.Try to build dev-libs/nss-3.68.3 on big endian ARM
2.
3.
Actual Results:  
Build fails with the following error:

/usr/lib/gcc/aarch64_be-unknown-linux-gnu/11.2.1/../../../../aarch64_be-unknown-linux-gnu/bin/ld: Linux5.4_aarch64_aarch64_be-unknown-linux-gnu-gcc_glibc_PTH_64_OPT.OBJ/Linux_SINGLE_SHLIB/sha256-armv8.o: in function `SHA256_Compress_Native':
sha256-armv8.c:(.text.SHA256_Compress_Native+0x0): multiple definition of `SHA256_Compress_Native'; Linux5.4_aarch64_aarch64_be-unknown-linux-gnu-gcc_glibc_PTH_64_OPT.OBJ/Linux_SINGLE_SHLIB/sha512.o:sha512.c:(.text.SHA256_Compress_Native+0x0): first defined here
/usr/lib/gcc/aarch64_be-unknown-linux-gnu/11.2.1/../../../../aarch64_be-unknown-linux-gnu/bin/ld: Linux5.4_aarch64_aarch64_be-unknown-linux-gnu-gcc_glibc_PTH_64_OPT.OBJ/Linux_SINGLE_SHLIB/sha256-armv8.o: in function `SHA256_Update_Native':
sha256-armv8.c:(.text.SHA256_Update_Native+0x0): multiple definition of `SHA256_Update_Native'; Linux5.4_aarch64_aarch64_be-unknown-linux-gnu-gcc_glibc_PTH_64_OPT.OBJ/Linux_SINGLE_SHLIB/sha512.o:sha512.c:(.text.SHA256_Update_Native+0x0): first defined here
collect2: error: ld returned 1 exit status

Expected Results:  
Build succeeds

Portage 3.0.30 (python 3.9.11-final-0, default/linux/arm64/17.0/big-endian, gcc-11.2.1, glibc-2.34-r13, 5.4.175 aarch64_be)
=================================================================
System uname: Linux-5.4.175-aarch64_be-with-glibc2.34
KiB Mem:     6084180 total,   4012016 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Tue, 10 May 2022 16:00:01 +0000
Head commit of repository gentoo: 0be9ae93c59cdce8cfb6a6d195965a7b3ab48471
sh bash 5.1_p16
ld GNU ld (Gentoo 2.37_p1 p2) 2.37
app-misc/pax-utils:        1.3.3::gentoo
app-shells/bash:           5.1_p16::gentoo
dev-lang/perl:             5.34.0-r9::gentoo
dev-lang/python:           3.9.11::gentoo, 3.10.3::gentoo
dev-util/cmake:            3.22.2::gentoo
dev-util/meson:            0.60.3::gentoo
sys-apps/baselayout:       2.7-r3::gentoo
sys-apps/openrc:           0.44.10::gentoo
sys-apps/sandbox:          2.29::gentoo
sys-devel/autoconf:        2.71-r1::gentoo
sys-devel/automake:        1.16.5::gentoo
sys-devel/binutils:        2.37_p1-r2::gentoo
sys-devel/binutils-config: 5.4.1::gentoo
sys-devel/gcc:             11.2.1_p20220115::gentoo
sys-devel/gcc-config:      2.5-r1::gentoo
sys-devel/libtool:         2.4.6-r6::gentoo
sys-devel/make:            4.3::gentoo
sys-kernel/linux-headers:  5.15-r3::gentoo (virtual/os-headers)
sys-libs/glibc:            2.34-r13::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-verify-metamanifest: yes
    sync-rsync-verify-max-age: 24
    sync-rsync-extra-opts: 
    sync-rsync-verify-jobs: 1

crossdev
    location: /usr/local/portage-crossdev
    masters: gentoo
    priority: 10

ACCEPT_KEYWORDS="arm64"
ACCEPT_LICENSE="@FREE"
CBUILD="aarch64_be-unknown-linux-gnu"
CFLAGS="-O2 -pipe -fomit-frame-pointer"
CHOST="aarch64_be-unknown-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe -fomit-frame-pointer"
DISTDIR="/tmp/distfiles"
EMERGE_DEFAULT_OPTS="--autounmask"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-O2"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="sv_SE.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
SHELL="/bin/tcsh"
USE="acl arm64 big-endian bzip2 cli crypt dri fortran gdbm iconv ipv6 libglvnd libtirpc ncurses nls nptl openmp pam pcre readline seccomp split-usr ssl unicode xattr zlib" ADA_TARGET="gnat_2020" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_ARM="edsp thumb thumb2 v4 v5 v6 v7 v8 vfp vfp-d32 vfpv3 vfpv4" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-4 php8-0" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_9" PYTHON_TARGETS="python3_9" RUBY_TARGETS="ruby26 ruby27" USERLAND="GNU" VIDEO_CARDS="fbdev dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LEX, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, MAKEOPTS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS
Comment 1 Joonas Niilola gentoo-dev 2022-05-25 13:04:40 UTC
So this is the .patch file everyone can drop onto /etc/portage/patches meanwhile:
https://git.buildroot.net/buildroot/plain/package/libnss/0001-lib-freebl-sha512.c-fix-SHA256-redefinition-on-ARM-b.patch?id=3e524755a943e1d22b404c256deeb137fd895100

(Or: https://hg.mozilla.org/projects/nss/rev/7e31b8f7f7414524029a3c025d502ff52338bc07 for an official one)

I'm not sure whether I want to patch the current stable ebuild and looks like it's been fixed upstream - although for whatever reason not on ESR. I think we should wait for the next nss-esr and patch it there if it's not added by upstream by then.
Comment 2 tt_1 2022-12-26 11:16:48 UTC
seems its fixed in nss-3.86?
Comment 3 Marcus Comstedt 2022-12-28 11:22:25 UTC
I haven't tried 3.86 yet, but 3.85 is ok, so probably.  :-)
Comment 4 Larry the Git Cow gentoo-dev 2023-07-02 16:47:34 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=76dc2166c56050fbb03b31c7fce26dc4340057c2

commit 76dc2166c56050fbb03b31c7fce26dc4340057c2
Author:     Joonas Niilola <juippis@gentoo.org>
AuthorDate: 2023-07-02 16:45:03 +0000
Commit:     Joonas Niilola <juippis@gentoo.org>
CommitDate: 2023-07-02 16:45:03 +0000

    dev-libs/nss: add 3.91
    
    Closes: https://bugs.gentoo.org/907932
    Closes: https://bugs.gentoo.org/845273
    Signed-off-by: Joonas Niilola <juippis@gentoo.org>

 dev-libs/nss/Manifest        |   1 +
 dev-libs/nss/nss-3.91.ebuild | 414 +++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 415 insertions(+)