Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 768906 - dev-lang/spidermonkey-78.7.0 ARM build failure, misdetects musl on glibc (note: the `armv7-gentoo-linux-musleabihf` target may not be installed)
Summary: dev-lang/spidermonkey-78.7.0 ARM build failure, misdetects musl on glibc (not...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: ARM Linux
: Normal normal (vote)
Assignee: Mozilla Gentoo Team
URL:
Whiteboard:
Keywords:
: 805293 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-02-05 21:14 UTC by Sven E.
Modified: 2021-08-08 23:47 UTC (History)
4 users (show)

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


Attachments
build.log (build.log,23.08 KB, text/plain)
2021-02-05 21:21 UTC, Sven E.
Details
emerge.info (emerge.info,6.36 KB, application/x-info)
2021-02-05 21:23 UTC, Sven E.
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sven E. 2021-02-05 21:14:46 UTC
Spidermonkey fails to build because wrong rust target is chosen.

Reproducible: Always

Actual Results:  
Build fails, because it tries to use the wrong rust compiler.

Expected Results:  
normal build.

DEBUG: Executing: `/usr/bin/rustc --crate-type staticlib --target=armv7-gentoo-linux-musleabihf -o /home/portage/dev-lang/spidermonkey-78.7.0/temp/conftest5okne8yo.rlib /home/portage/dev-lang/spidermonkey-78.7.0/temp/conftestj5zl4boc.rs`
DEBUG: The command returned non-zero exit status 1.
DEBUG: Its error output was:
DEBUG: | error[E0463]: can't find crate for `std`
DEBUG: |   |
DEBUG: |   = note: the `armv7-gentoo-linux-musleabihf` target may not be installed
DEBUG: |
DEBUG: | error: aborting due to previous error

This seems reasonable, cause I am not on glibc. In contrast:
Called econf '--host=armv7a-raspberrypi-linux-gnueabihf' '--target=armv7a-raspberrypi-linux-gnueabihf' '--disable-jemalloc' '--disable-optimize' '--disable-strip' '--enable-readline' '--enable-shared-js' '--with-intl-api' '--with-system-icu' '--with-system-nspr' '--with-system-zlib' '--with-toolchain-prefix=armv7a-raspberrypi-linux-gnueabihf-' '--disable-debug' '--disable-jit' '--disable-tests' 'XARGS=/usr/bin/xargs'

As can be seem econf uses -glibceabihf. However, using rust-bin I can build spidermonkey as expected.

Logs will be added.
Comment 1 Sven E. 2021-02-05 21:21:13 UTC
Created attachment 685887 [details]
build.log

build.log
Comment 2 Sven E. 2021-02-05 21:23:45 UTC
Created attachment 685890 [details]
emerge.info

emerge --info
Comment 3 Sven E. 2021-02-05 21:25:28 UTC
That should of course read -gnueabihf up there...
Comment 4 Sven E. 2021-02-06 00:01:39 UTC
Looking into config.log, I can see:

DEBUG: Executing: `/usr/bin/rustc --print target-list`
INFO: checking for rust target triplet...
DEBUG: Creating `/home/portage/dev-lang/spidermonkey-78.7.0/temp/conftest9lyavcv8.rs` with content:
DEBUG: | pub extern fn hello() { println!("Hello world"); }
DEBUG: Executing: `/usr/bin/rustc --crate-type staticlib --target=armv7-gentoo-linux-musleabihf -o /home/portage/dev-lang/spidermonkey-78.7.0/temp/conftestqdhmzqax.rlib /home/portage/dev-lang/spidermonkey-78.7.0/temp/conftest9lyavcv8.rs`

Let's look at the output of the target list:

# /usr/bin/rustc --print target-list|grep armv7
armv7-apple-ios
armv7-gentoo-linux-musleabihf
armv7-linux-androideabi
armv7-unknown-cloudabi-eabihf
armv7-unknown-freebsd
armv7-unknown-linux-gnueabi
armv7-unknown-linux-gnueabihf
armv7-unknown-linux-musleabi
armv7-unknown-linux-musleabihf
armv7-unknown-netbsd-eabihf
armv7-wrs-vxworks-eabihf
armv7a-none-eabi
armv7a-none-eabihf
armv7r-none-eabi
armv7r-none-eabihf
armv7s-apple-ios

Looks like the very first possible match is chosen. For rust-bin the output looks like this:
# /usr/bin/rustc --print target-list|grep armv7
armv7-apple-ios
armv7-linux-androideabi
armv7-unknown-cloudabi-eabihf
armv7-unknown-freebsd
armv7-unknown-linux-gnueabi
armv7-unknown-linux-gnueabihf
armv7-unknown-linux-musleabi
armv7-unknown-linux-musleabihf
armv7-unknown-netbsd-eabihf
armv7-wrs-vxworks-eabihf
armv7a-none-eabi
armv7a-none-eabihf
armv7r-none-eabi
armv7r-none-eabihf
armv7s-apple-ios

I don't know where the musleabif target in the target list of the local build originates from...
Comment 5 Sven E. 2021-02-06 14:44:22 UTC
I did some testing.. I modified the target list (the bad way) and as soon as I am taking care of crippling the armv7-gentoo-linux-musleabihf a little, spidermonkey will instead choose armv7-unknown-linux-gnueabihf.

Simply put, it looks a lot like spidemonkey's triplet choosing is broken.
Comment 6 Sven E. 2021-02-08 23:37:12 UTC
I had a chance to take a peek at rust.configure. IT does some narrowing on the target, unfortunately it is not as readable as I hoped. I did not find otu yet, what's going wrong there.

From what I can guess so far, the narrowing does not take the ABI into account at all, but maybe I am missing out on something.
Comment 7 Peter Serbe 2021-03-07 12:34:28 UTC
I see that bug when trying to compile spidermonkey-78.6.0, too.
One more interesting observation: I have successfully built a spidermonkey-78.6.0 binary package on January 22nd. And now I no longer can. So it looks to me as that bug had been covered until some package was updated between January 22nd and February 5th.
Comment 8 Peter Anderson 2021-03-24 02:05:56 UTC
Am also experiencing this issue when attempting to build versions 78.6.0, 78.7.1, 78.8.0 and 78.9.0 of spidermonkey on a raspberry pi 4 (i.e. native compile).

If required/requested, am happy to attach copy of build.log and output from 'emerge --info' for attempted build of 78.6.0 on my raspberry pi 4.
Comment 9 xiaojie+bugzillagentoo 2021-05-21 10:25:13 UTC
Same problem/error, on a Raspi 2 B+, when trying to compile 78.10.1.
Comment 10 Sam James archtester gentoo-dev Security 2021-07-31 00:54:31 UTC
*** Bug 805293 has been marked as a duplicate of this bug. ***
Comment 11 Sam James archtester gentoo-dev Security 2021-07-31 00:56:06 UTC
This is the same as bug 779178. Note that it affects *glibc* where misdetection occurs.
Comment 12 Piotr Kubaj 2021-08-01 22:19:12 UTC
Same issue affects arm64 on musl, except that aarch64-gentoo-linux usage is attempted.
Comment 13 Alex Buell 2021-08-08 23:47:34 UTC
(In reply to Piotr Kubaj from comment #12)
> Same issue affects arm64 on musl, except that aarch64-gentoo-linux usage is
> attempted.

I have installed the 64 bit version on a new SD card over the weekend. After a great deal of faffing about with upgrading Perl to latest, rebuilding kernel, and tool-chain, along with Rust, Spidermonkey built just fine on arm64. It's happily building Gnome right now.