Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 699696 - dev-libs/nss fails to cross compile with host and target being musl based with: nss-3.46/temp/fakedir: No such file or directory
Summary: dev-libs/nss fails to cross compile with host and target being musl based wit...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Mozilla Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-11-09 19:57 UTC by tt_1
Modified: 2021-09-02 14:23 UTC (History)
1 user (show)

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


Attachments
compressed build log (build.log.gz,20.02 KB, application/gzip)
2019-11-09 19:57 UTC, tt_1
Details
output from emerge --info (host) (emerge-info,6.58 KB, text/plain)
2019-11-09 19:58 UTC, tt_1
Details
output from emerge --info (cross-target) (emerge-cross-info,5.19 KB, text/plain)
2019-11-09 19:59 UTC, tt_1
Details
build.log (build.log,572.75 KB, application/octet-stream)
2020-01-17 20:28 UTC, matoro
Details

Note You need to log in before you can comment on or make changes to this bug.
Description tt_1 2019-11-09 19:57:30 UTC
Created attachment 595582 [details]
compressed build log

from the build log, it seems, that signing with shlibs doesn't work: 

make[3]: Leaving directory '/usr/aarch64-unknown-linux-musl/tmp/portage/dev-libs/nss-3.46/work/nss-3.46/nss-.arm64/cmd/shlibsign/mangle'
cd Linux2.6_aarch64_aarch64-unknown-linux-musl-gcc_glibc_PTH_64_OPT.OBJ ; sh '/usr/aarch64-unknown-linux-musl/tmp/portage/dev-libs/nss-3.46/work/nss-3.46/nss-.arm64/cmd/shlibsign/.'/sign.sh '/usr/aarch64-unknown-linux-musl/tmp/portage/dev-libs/nss-3.46/work/nss-3.46/nss-.arm64/cmd/shlibsign/../../dist/Linux2.6_aarch64_aarch64-unknown-linux-musl-gcc_glibc_PTH_64_OPT.OBJ' \
'/usr/aarch64-unknown-linux-musl/tmp/portage/dev-libs/nss-3.46/work/nss-3.46/nss-.arm64/cmd/shlibsign/Linux2.6_aarch64_aarch64-unknown-linux-musl-gcc_glibc_PTH_64_OPT.OBJ' Linux \
'/usr/aarch64-unknown-linux-musl/tmp/portage/dev-libs/nss-3.46/temp/fakedir' '/usr/aarch64-unknown-linux-musl/tmp/portage/dev-libs/nss-3.46/work/nss-3.46/nss-.arm64/cmd/shlibsign/../../dist/Linux2.6_aarch64_aarch64-unknown-linux-musl-gcc_glibc_PTH_64_OPT.OBJ/lib/libsoftokn3.so'
/usr/aarch64-unknown-linux-musl/tmp/portage/dev-libs/nss-3.46/work/nss-3.46/nss-.arm64/cmd/shlibsign/./sign.sh: line 36: cd: /usr/aarch64-unknown-linux-musl/tmp/portage/dev-libs/nss-3.46/temp/fakedir: No such file or directory
shlibsign -v -i /usr/aarch64-unknown-linux-musl/tmp/portage/dev-libs/nss-3.46/work/nss-3.46/nss-.arm64/cmd/shlibsign/../../dist/Linux2.6_aarch64_aarch64-unknown-linux-musl-gcc_glibc_PTH_64_OPT.OBJ/lib/libsoftokn3.so
loading softokn3 failedmake[2]: *** [Makefile:92: ../../dist/Linux2.6_aarch64_aarch64-unknown-linux-musl-gcc_glibc_PTH_64_OPT.OBJ/lib/libsoftokn3.chk] Error 1
make[2]: Leaving directory '/usr/aarch64-unknown-linux-musl/tmp/portage/dev-libs/nss-3.46/work/nss-3.46/nss-.arm64/cmd/shlibsign'
make[1]: *** [../coreconf/rules.mk:101: libs] Error 2

It does however work when the host is glibc based, and only the target is musl based. Since it seems as if the nss source code does ship some binaries, who are crucial to the build and which rely on glibc, I'm not very optimistic about this, but still: is there a way to solve this? 

I'm going to attach the full build log.
Comment 1 tt_1 2019-11-09 19:58:54 UTC
Created attachment 595584 [details]
output from emerge --info (host)
Comment 2 tt_1 2019-11-09 19:59:24 UTC
Created attachment 595586 [details]
output from emerge --info (cross-target)
Comment 3 matoro archtester 2020-01-16 00:06:08 UTC
Weird, I just ran into this issue on =dev-libs/nss-3.49.1, non-cross-compile, on arm, for glibc.  No cross-compiling or musl weirdness involved.  Did you ever find a fix for this issue?
Comment 4 tt_1 2020-01-16 07:35:25 UTC
please post your build logs and emerge --info
Comment 5 matoro archtester 2020-01-17 13:50:04 UTC
(In reply to tt_1 from comment #4)
> please post your build logs and emerge --info

Sorry, it actually turned out to be an instance of https://bugs.gentoo.org/show_bug.cgi?id=705640 instead of this problem.  I don't have the build log anymore because I was able to solve it at the time by explicitly applying "-mfpu=neon" to my CFLAGS (redundant, but necessary apparently).
Comment 6 matoro archtester 2020-01-17 20:25:23 UTC
Actually scratch that I just tried recompiling and this did pop up again.  Will add build log.
Comment 7 matoro archtester 2020-01-17 20:28:16 UTC
Created attachment 603632 [details]
build.log
Comment 8 matoro archtester 2020-01-17 20:30:09 UTC
$ emerge --info dev-libs/nss                                                                                                                                                                                                                                                              Portage 2.3.84 (python 3.8.1-final-0, default/linux/arm/17.0/armv7a, gcc-9.2.0, glibc-2.30-r3, 4.4.182-mainline-rev1 armv7l)
=================================================================
                         System Settings                                                                                                                                                                                                                                                                                 
=================================================================
System uname: Linux-4.4.182-mainline-rev1-armv7l-ARMv7_Processor_rev_2_-v7l-with-glibc2.4
KiB Mem:     2069232 total,    288784 free
KiB Swap:    8388600 total,   8293080 free
Timestamp of repository gentoo: Fri, 17 Jan 2020 19:46:09 +0000                                                                                                                                                                                                                                                          
Head commit of repository gentoo: f20391c480293e0a2cd6f010c08d8bc0ba6265ef

sh bash 5.0_p11                                                                                                                                                                                                                                                                                                          ld GNU ld (Gentoo 2.33.1 p2) 2.33.1                                                                                                                                                                                                                                                                                      app-shells/bash:          5.0_p11::gentoo                                                                                                                                                                                                                                                                                dev-java/java-config:     2.2.0-r4::x-portage                                                                                                                                                                                                                                                                            dev-lang/perl:            5.30.1::gentoo                                                                                                                                                                                                                                                                                 dev-lang/python:          3.8.1::gentoo   
dev-util/cmake:           3.16.2-r1::gentoo                                                                                                                                                                                                                                                                              
sys-apps/baselayout:      2.6-r1::gentoo
sys-apps/openrc:          0.42.1::gentoo
sys-apps/sandbox:         2.18::gentoo
sys-devel/autoconf:       2.69-r5::gentoo
sys-devel/automake:       1.16.1-r2::gentoo
sys-devel/binutils:       2.33.1-r1::gentoo
sys-devel/gcc:            9.2.0-r3::gentoo
sys-devel/gcc-config:     2.2::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.2.1-r4::gentoo
sys-kernel/linux-headers: 5.4::gentoo (virtual/os-headers)
sys-libs/glibc:           2.30-r3::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/gentoo
    priority: -1000

x-portage
    location: /usr/local/portage
    masters: gentoo
    priority: 0

chaoslab
    location: /var/lib/layman/chaoslab
    sync-type: laymansync
    sync-uri: https://gitlab.com/chaoslab/chaoslab-overlay.git
    masters: gentoo
    priority: 50

pg_overlay
    location: /var/lib/layman/pg_overlay
    sync-type: laymansync
    sync-uri: https://github.com/perfect7gentleman/pg_overlay.git
    masters: gentoo
    priority: 50

ACCEPT_KEYWORDS="arm ~arm"
ACCEPT_LICENSE="@FREE"
CBUILD="armv7a-unknown-linux-gnueabihf"
CFLAGS="-O3 -pipe -march=native -funroll-loops -flto=3 -floop-block -floop-interchange -floop-strip-mine -ftree-loop-distribution"
CHOST="armv7a-unknown-linux-gnueabihf"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt /var/bind"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O3 -pipe -march=native -funroll-loops -flto=3 -floop-block -floop-interchange -floop-strip-mine -ftree-loop-distribution"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--usepkg"
ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN 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 -pipe -march=armv7-a"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg compressdebug 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 sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe -march=armv7-a"
GENTOO_MIRRORS="https://mirrors.soeasyto.com/distfiles.gentoo.org/ https://gentoo.osuosl.org https://mirrors.evowise.com/gentoo/ https://gentoo.ussg.indiana.edu/ https://mirrors.lug.mtu.edu/gentoo/"
LANG="en_US.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"
USE="acl arm armv5te armv6 armv6t2 berkdb bzip2 cli crypt cxx dri fortran gdbm graphite hardened iconv ipv6 lto ncurses nls nptl openmp pam pax_kernel pcre pgo pic pie readline seccomp split-usr ssl tcpd threads unicode vhosts vim-syntax xattr zlib" ADA_TARGET="gnat_2018" 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 vfp vfp-d32 vfpv3" 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 keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" NETBEANS_MODULES="apisupport cnd groovy gsf harness ide identity j2ee java mobility nb php profiler soa visualweb webcommon websvccommon xml" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-2" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_8" PYTHON_TARGETS="python3_8" RUBY_TARGETS="ruby27" USERLAND="GNU" VIDEO_CARDS="exynos fbdev omap dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LC_ALL, LINGUAS, MAKEOPTS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 9 tt_1 2020-01-17 20:39:44 UTC
I hit this only when cross compiling, and it seems that's not what you're doing here. Instead, you're going for a native comile with CHOST=armv7a-unknown-linux-gnueabihf, right?
Comment 10 matoro archtester 2020-01-18 20:24:10 UTC
(In reply to tt_1 from comment #9)
> I hit this only when cross compiling, and it seems that's not what you're
> doing here. Instead, you're going for a native comile with
> CHOST=armv7a-unknown-linux-gnueabihf, right?

Right, that's what I posted in my previous comment:

> Weird, I just ran into this issue on =dev-libs/nss-3.49.1, non-cross-compile, on arm, for glibc.  No cross-compiling or musl weirdness involved.

Since I am doing a native compile and everything is glibc-based, yet still ran into the same issue, that leads me to believe that neither cross-compile nor musl are the culprits here.  I am still looking into the build scripts to see if I can identify it.
Comment 11 yshuiv7 2020-10-24 22:04:20 UTC
This is because of changes made in 436216, which runs the host shlibsign tool.

sign.sh runs shlibsign with LD_LIBRARY_PATH pointing to the build directory, causing the host shlibsign to not be able to find the libraries.

I think the right solution here is to remove the `export LD_LIBRARY_PATH` from sign.sh
Comment 12 yshuiv7 2020-10-24 22:12:32 UTC
The "fakedir" error is not relevant, BTW.
Comment 13 tt_1 2020-10-25 15:49:17 UTC
Are you able to provide some sort of patch to hack around this? I still haven't been able to figure out by myself yet what exactly to do, even though you provided some informations that seem reasonable to me. thanks