Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 779178 - www-client/firefox: musl patches break glibc build on ARM (note: the `armv7-gentoo-linux-musleabihf` target may not be installed) with =dev-lang/rust-1.47.0-r2
Summary: www-client/firefox: musl patches break glibc build on ARM (note: the `armv7-g...
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Mozilla Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-03-29 22:57 UTC by David Flogeras
Modified: 2021-07-31 00:56 UTC (History)
2 users (show)

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 David Flogeras 2021-03-29 22:57:49 UTC
I've successfully built rust-1.47.0-r2 on regular armv7a-unknown-linux-gnueabihf (glibc).  However, when attempting to build firefox with this version of rust, I get the following error:


 0:43.68 checking for rust target triplet...
 0:43.68 DEBUG: Creating `/var/tmp/portage/www-client/firefox-78.9.0/temp/confte
stthjvravq.rs` with content:
 0:43.68 DEBUG: | pub extern fn hello() { println!("Hello world"); }
 0:43.68 DEBUG: Executing: `/usr/bin/rustc --crate-type staticlib --target=armv7
-gentoo-linux-musleabihf -o /var/tmp/portage/www-client/firefox-78.9.0/temp/conf
testy5xmt0ay.rlib /var/tmp/portage/www-client/firefox-78.9.0/temp/conftestthjvra
vq.rs`
 0:43.68 DEBUG: The command returned non-zero exit status 1.
 0:43.68 DEBUG: Its error output was:
 0:43.68 DEBUG: | error[E0463]: can't find crate for `std`
 0:43.68 DEBUG: |   |
 0:43.68 DEBUG: |   = note: the `armv7-gentoo-linux-musleabihf` target may not b
e installed
 0:43.68 DEBUG: |
 0:43.68 DEBUG: | error: aborting due to previous error
 0:43.68 DEBUG: |
 0:43.69 DEBUG: | For more information about this error, try `rustc --explain E0
463`.
 0:43.69 ERROR: Cannot compile for armv7a-unknown-linux-gnueabihf with /usr/bin/
rustc



Going back to rust-1.46.0 allows me to build firefox.

emerge --info to follow

Reproducible: Always
Comment 1 David Flogeras 2021-03-29 22:58:12 UTC
emerge --info
Portage 3.0.17 (python 3.8.8-final-0, default/linux/arm/17.0/armv7a/desktop, gcc-10.2.0, glibc-2.31-r7, 5.4.97-gentoo armv7l)
=================================================================
System uname: Linux-5.4.97-gentoo-armv7l-ARMv7_Processor_rev_4_-v7l-with-glibc2.4
KiB Mem:    65797008 total,  53028588 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Mon, 29 Mar 2021 16:30:01 +0000
Head commit of repository gentoo: 7a46d24421c689e39582e0dda4bc7648e7719e6c
sh bash 5.0_p18
ld GNU ld (Gentoo 2.35.1 p2) 2.35.1
ccache version 4.2 [disabled]
app-shells/bash:          5.0_p18::gentoo
dev-lang/perl:            5.30.3::gentoo
dev-lang/python:          3.8.8::gentoo
dev-util/ccache:          4.2::gentoo
dev-util/cmake:           3.18.5::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.7::gentoo
sys-apps/openrc:          0.42.1-r1::gentoo
sys-apps/sandbox:         2.20::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r5::gentoo
sys-devel/automake:       1.16.2-r1::gentoo
sys-devel/binutils:       2.35.1-r1::gentoo
sys-devel/gcc:            6.5.0-r3::gentoo, 7.5.0-r1::gentoo, 8.4.0-r1::gentoo, 9.3.0-r2::gentoo, 10.2.0-r5::gentoo
sys-devel/gcc-config:     2.3.2-r1::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.3::gentoo
sys-kernel/linux-headers: 5.10::gentoo (virtual/os-headers)
sys-libs/glibc:           2.31-r7::gentoo
Repositories:

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

ACCEPT_KEYWORDS="arm"
ACCEPT_LICENSE="@FREE"
CBUILD="armv7a-unknown-linux-gnueabihf"
CFLAGS="-pipe -march=armv7-a -mfpu=neon-vfpv4 -mfloat-abi=hard -O2"
CHOST="armv7a-unknown-linux-gnueabihf"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-pipe -march=armv7-a -mfpu=neon-vfpv4 -mfloat-abi=hard -O2"
DISTDIR="/usr/portage/distfiles"
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 -pipe -march=armv7-a"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news nodoc noinfo parallel-fetch 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 -pipe -march=armv7-a"
GENTOO_MIRRORS="http://mirror.its.dal.ca/gentoo"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en"
MAKEOPTS="-j12"
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="X a52 aac acl alsa arm berkdb bluetooth branding bzip2 cairo cdda cdr cli crypt dbus dri dts dvdr elogind emboss encode exif flac gdbm gif gpm gtk gui iconv icu jpeg lcms libglvnd libnotify mad mng mp3 mp4 mpeg ncurses nls nptl ogg opengl openmp pam pango pcre pdf png policykit ppds qt5 readline sdl seccomp spell split-usr ssl startup-notification svg tcpd threads tiff truetype udev udisks unicode upower usb vorbis wxwidgets x264 xattr xcb xml xv xvid 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="neon vfpv3 edsp thumb thumb2 v4 v5 v6 v7 vfp" 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" KERNEL="linux" L10N="en" 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-3 php7-4" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_8" PYTHON_TARGETS="python3_8" RUBY_TARGETS="ruby26" USERLAND="GNU" 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:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 2 Sam James archtester gentoo-dev Security 2021-03-30 17:49:46 UTC
I was sure I filed a bug for this. The musl patch for Firefox/SpiderMonkey is broken and for some reason will assume musl in general even on glibc. I hit this too.
Comment 3 Sam James archtester gentoo-dev Security 2021-03-30 18:47:18 UTC
Unless there’s real interest in fixing this properly, are we able to just conditionally patch on musl for now?
Comment 4 tt_1 2021-03-30 20:19:53 UTC
yeah, me too. But which musl patch is broken though? I tried to remove them all in src_prepare, which didn't help much if I remember correctly. 

(I only tried with rust-bin)
Comment 5 David Flogeras 2021-03-31 10:30:58 UTC
I tried by removing the most likely (IMO) patch:

firefox-patches/0011-musl-Support-custom-vendor-strings.patch

To no avail.

I'll try rebuilding rust without the patch:
files/1.48.0-gentoo-musl-target-specs.patch

And then see if that changes the outcome, but this will take a bit since rust 1.48 locks up if I try a parallel build, and building -j1 takes a very long time in qemu-chroot.
Comment 6 David Flogeras 2021-04-04 15:43:57 UTC
Sorry, I mis-typed in my previous comment regarding rust-1.48, I meant 1.47.  Here's what I've tested

rebuilt rust-1.47 for arm glibc, but removing the following patch:

        "${FILESDIR}"/gentoo-musl-target-specs.patch

Then I rebuilt firefox-78.9.0 successfully without any modification.  Perhaps we would make the rust patch for musl apply only if elibc_musl is present?