Cross compiling for Solaris SPARC on Ubuntu

I managed to build native Firefox in Ubuntu 19.10 by following the directio=
ns here: https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/B=
uild_Instructions/Simple_Firefox_build/Linux_and_MacOS_build_preparation

Now, also in Ubuntu I'd like to cross compile Firefox for Solaris (either 1=
0 or 11) SPARC.  But the only information I've been able to find is this: h=
ttps://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instr=
uctions/Cross-compiling_Mozilla

But that contains the disclaimer that "If you have to ask "where do I get..=
.. or why doesn't 'X' work", then this isn't for you."  So I guess it isn't =
for me.  It seems like it should be possible according to the post: https:/=
/groups.google.com/forum/#!topicsearchin/mozilla.dev.builds/solaris;context=
-place=3Dtopic/mozilla.dev.builds/kAnRhBYi9f0/mozilla.dev.builds/BjfjLJmUQk=
8/mozilla.dev.builds/BjfjLJmUQk8

"For Solaris, it should still be possible to cross-compile Firefox to SPARC=
 from x86."

And Oracle is sending out FF 68 in their Solaris 11.4 updates, so it should=
 indeed be possible.  The question is, how?  Can anyone give me some pointe=
rs on how to do this, more along the lines of the first link above rather t=
han the second?  It would be nice if I could just say "./mach build --targe=
t=3Dsolaris-sparc" but something tells me that's not how it works.  Thanks!

0
mdenber
1/7/2020 7:31:50 PM
mozilla.dev.builds 1759 articles. 0 followers. Post Follow

1 Replies
70 Views

Similar Articles

[PageSpeed] 25

Am I perhaps asking in the wrong place?  I could really use some help here.  I now have a complete Rust cross-compiler working and have set the various env vars and created a mozconfig file.  But I'm getting this:

$ ../configure --target=sparcv9-sun-solaris
....
checking for the target C compiler... /usr/bin/clang
checking whether the target C compiler can be used... yes
checking the target C compiler version... 9.0.0
checking the target C compiler works... yes
checking for the target C++ compiler... /usr/bin/clang++
checking whether the target C++ compiler can be used... yes
checking the target C++ compiler version... 9.0.0
checking the target C++ compiler works... yes
checking for the host C compiler... /usr/bin/clang
checking whether the host C compiler can be used... yes
checking the host C compiler version... 9.0.0
checking the host C compiler works... yes
checking for the host C++ compiler... /usr/bin/clang++
checking whether the host C++ compiler can be used... yes
checking the host C++ compiler version... 9.0.0
checking the host C++ compiler works... yes
....
checking for rustc... /home/michele/.cargo/bin/rustc
checking for cargo... /home/michele/.cargo/bin/cargo
Actually using '/home/michele/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/rustc'
Actually using '/home/michele/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/cargo'
....

DEBUG: configure:4041: /usr/bin/clang -std=gnu99 --target=sparcv9-solaris2 -o conftest  -Qunused-arguments    conftest.c  1>&5
DEBUG: /usr/bin/ld: unrecognized option '-C'
DEBUG: /usr/bin/ld: use the --help option for usage information
DEBUG: clang: error: linker command failed with exit code 1 (use -v to see invocation)
DEBUG: configure: failed program was:
DEBUG: #line 4034 "configure"
DEBUG: #include "confdefs.h"
DEBUG: 
DEBUG: int main() {
DEBUG: 
DEBUG: ; return 0; }
DEBUG: configure: error: compiler is incompatible with sanitize options
ERROR: old-configure failed

It appears it's using the wrong target gcc and the wrong rustc too.

Part of the problem may be this (confusing) statement in the cross-compiling guide:

"The main thing to remember is that when --target=${xtarget_arch} is passed to configure, configure expects to find the compiler toolchain as ${xtarget_arch}-TOOL where TOOL is gcc, g++, ranlib, etc."

So if my target is "sparcv9-sun-solaris", then it's going to look for "sparcv9-sun-solaris-gcc"?  Where?  That's not a complete file specification.  FWIW, mine is here:

   /usr/sparcv9-solaris/solaris/cross/sparcv9-solaris2.11/bin/sparcv9-solaris2.11-gcc

Any help would be most appreciated.
0
mdenber
2/29/2020 8:04:05 PM
Reply: