Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to force rust target in firefox build

27 views
Skip to first unread message

John Frankish

unread,
Jul 1, 2020, 1:46:28 PM7/1/20
to dev-b...@lists.mozilla.org
I'm trying to compile firefox natively on an RPi4 running tinycorelinux piCore.

The configure phase fails because it tries to use arm-unknown-linux-gnueabihf as the rust target instead of armv7-unknown-linux-gnueabihf.

If I try the rust test manually, i.e.:

/usr/local/bin/rustc --crate-type staticlib --target=armv7-unknown-linux-gnueabihf -o /tmp/conftest.rlib /tmp/conftest.rs

..it passes.

Is there a way to force the rust target?

----

./mach build
...
0:07.54 checking for host system type... armv7l-unknown-linux-gnueabihf
0:07.54 checking for target system type... armv7l-unknown-linux-gnueabihf
...
0:16.71 checking for rust target triplet...
0:16.71 DEBUG: Creating `/tmp/conftestg7rtgcch.rs` with content:
0:16.71 DEBUG: | pub extern fn hello() { println!("Hello world"); }
0:16.71 DEBUG: Executing: `/usr/local/bin/rustc --crate-type staticlib --target=arm-unknown-linux-gnueabihf -o /tmp/conftestmw0yudfu.rlib /tmp/conftestg7rtgcch.rs`
0:16.72 DEBUG: The command returned non-zero exit status 1.
0:16.72 DEBUG: Its error output was:
0:16.72 DEBUG: | error[E0463]: can't find crate for `std`
0:16.72 DEBUG: | |
0:16.72 DEBUG: | = note: the `arm-unknown-linux-gnueabihf` target may not be installed
0:16.72 DEBUG: |
0:16.73 DEBUG: | error: aborting due to previous error
0:16.73 DEBUG: |
0:16.73 DEBUG: | For more information about this error, try `rustc --explain E0463`.
0:16.73 ERROR: Cannot compile for armv7l-unknown-linux-gnueabihf with /usr/local/bin/rustc
0:16.73 The target may be unsupported, or you may not have
0:16.73 a rust std library for that target installed. Try:
0:16.73 rustup target add arm-unknown-linux-gnueabihf
0:16.89 *** Fix above errors and then restart with\
0:16.89 "./mach build"
0:16.89 make: *** [client.mk:115: configure] Error 1

Mike Hommey

unread,
Jul 1, 2020, 5:07:28 PM7/1/20
to John Frankish, dev-b...@lists.mozilla.org
On Wed, Jul 01, 2020 at 05:34:16PM +0000, John Frankish wrote:
> I'm trying to compile firefox natively on an RPi4 running tinycorelinux piCore.
>
> The configure phase fails because it tries to use arm-unknown-linux-gnueabihf as the rust target instead of armv7-unknown-linux-gnueabihf.
>
> If I try the rust test manually, i.e.:
>
> /usr/local/bin/rustc --crate-type staticlib --target=armv7-unknown-linux-gnueabihf -o /tmp/conftest.rlib /tmp/conftest.rs
>
> ..it passes.
>
> Is there a way to force the rust target?

Not directly. But if configure is trying to use arm rather than armv7,
that suggests your C/C++ compiler is targetting something older than armv7 by
default. Can you try `--with-arch=armv7-a`?
> _______________________________________________
> dev-builds mailing list
> dev-b...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-builds

John Frankish

unread,
Jul 6, 2020, 11:33:44 PM7/6/20
to dev-b...@lists.mozilla.org, Mike Hommey
> > I'm trying to compile firefox natively on an RPi4 running tinycorelinux piCore.
> >
> > The configure phase fails because it tries to use arm-unknown-linux-gnueabihf
> > as the rust target instead of armv7-unknown-linux-gnueabihf.
> >
> > If I try the rust test manually, i.e.:
> >
> > /usr/local/bin/rustc --crate-type staticlib
> > --target=armv7-unknown-linux-gnueabihf -o /tmp/conftest.rlib
> > /tmp/conftest.rs
> >
> > ..it passes.
> >
> > Is there a way to force the rust target?
> >
> Not directly. But if configure is trying to use arm rather than armv7, that
> suggests your C/C++ compiler is targetting something older than armv7 by default.
> Can you try `--with-arch=armv7-a`?
>
It targets armv7l by default, but "--with-arch=armv7-a" fixed things - thanks.

After adjusting the location of nss headers and commenting out some simd code, firefox builds and runs :)

0 new messages